Package mdesl.graphics

Examples of mdesl.graphics.Texture


   * @param filter
   * @param wrap
   * @throws LWJGLException
   */
  public FrameBuffer(int width, int height, int filter, int wrap) throws LWJGLException {
    this(new Texture(width, height, filter, wrap), true);
  }
View Full Code Here


      region.set(tex, x, y, width, height);
    }
  }
 
  public BitmapFont(URL fontDef, URL texture) throws IOException {
    this(fontDef, new Texture(texture));
  }
View Full Code Here

  protected void create() throws LWJGLException {
    super.create();

    //Load some textures
    try {
      tex = new Texture(Util.getResource("res/tiles.png"), Texture.NEAREST);
      tex2 = new Texture(Util.getResource("res/ptsans_00.png"));
      tile = new TextureRegion(tex, 128, 64, 64, 64);
     
      font = new BitmapFont(Util.getResource("res/ptsans.fnt"), Util.getResource("res/ptsans_00.png"));
     
    } catch (IOException e) {
View Full Code Here

   
    batch = new SpriteBatch(shader, 1000);
   
   
    try {
      tex0 = new Texture(Util.getResource("res/dirt.png"));
      tex1 = new Texture(Util.getResource("res/grass.png"));
      mask = new Texture(Util.getResource("res/mask.png"));
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      Sys.alert("Error", "Could not load images");
      System.exit(0);
View Full Code Here

 
  protected void create() throws LWJGLException {
    super.create();
    //create our font
    try {
      atlas = new Texture(Util.getResource("res/slider.png"), Texture.NEAREST);
     
      //ideally you would use a texture packer like in LibGDX
      track = new TextureRegion(atlas, 0, 0, 64, 256);
      thumb = new TextureRegion(atlas, 65, 0, 64, 128);
     
View Full Code Here

    Display.setResizable(false);

    //In later lessons, we'll learn about "post-processing" an entire scene using an FBO.
    //For now we will apply the concepts to individual textures.
    try {
      tex = new Texture(Util.getResource("res/scene.png"), Texture.NEAREST);
    } catch (IOException e) {
      throw new RuntimeException("couldn't decode texture");
    }
   
    //load our shader program and sprite batch
View Full Code Here

  protected void create() throws LWJGLException {
    super.create();

    //this will be ignored in this lesson...
    try {
      tex = new Texture(Util.getResource("res/grass.png"), Texture.NEAREST);
    } catch (IOException e) {
      throw new RuntimeException("couldn't decode texture");
    }
   
    //load our shader program and sprite batch
View Full Code Here

 
  protected void create() throws LWJGLException {
    super.create();
   
    try {
      tex0 = new Texture(Util.getResource("res/grass.png"), Texture.NEAREST, Texture.REPEAT);
      tex1 = new Texture(Util.getResource("res/dirt.png"), Texture.NEAREST, Texture.REPEAT);
      mask = new Texture(Util.getResource("res/mask.png"), Texture.NEAREST, Texture.REPEAT);
    } catch (IOException e) {
      throw new RuntimeException("couldn't decode textures");
    }
   
    //load our shader program and sprite batch
View Full Code Here

   
  protected void create() throws LWJGLException {
    super.create();
   
    try {
      tex0 = new Texture(Util.getResource("res/grass.png"), Texture.LINEAR, Texture.REPEAT);
      tex1 = new Texture(Util.getResource("res/dirt.png"), Texture.LINEAR, Texture.REPEAT);
      mask = new Texture(Util.getResource("res/mask.png"), Texture.LINEAR, Texture.REPEAT);
    } catch (IOException e) {
      throw new RuntimeException("couldn't decode textures");
    }
   
    //load our shader program and sprite batch
View Full Code Here

 
  protected void create() throws LWJGLException {
    super.create();
    //create our font
    try {
      fontTex = new Texture(Util.getResource("res/ptsans_00.png"), Texture.NEAREST);
     
      //in Photoshop, we included a small white box at the bottom right of our font sheet
      //we will use this to draw lines and rectangles within the same batch as our text
      rect = new TextureRegion(fontTex, fontTex.getWidth()-2, fontTex.getHeight()-2, 1, 1);
     
View Full Code Here

TOP

Related Classes of mdesl.graphics.Texture

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.