Package client.ogl

Examples of client.ogl.Texture


  }
 
  public void drawSprite(int id)
  {
    Sprite s = unitManager.getSprite(id);
    Texture tex = s.getTexture();
    Vector2f wc_position = s.getPosition();
    float rotation = s.getRotation();
   
    if(map.isInMap(Math.worldToMap(wc_position, map.getTilesize())) && viewport.scale_cpy(1.1f).isInside(wc_position))
    {
      glEnableClientState(GL_VERTEX_ARRAY);
      glEnableClientState(GL_TEXTURE_COORD_ARRAY);
      glEnable(GL_TEXTURE_2D);
     
      glPushMatrix();
     
      tex.bind();   
     
      glTranslatef(Math.worldToScreen(wc_position.x(),viewport.getLeft()), Math.worldToScreen(wc_position.y(),viewport.getTop()), 0f);
     
      glRotatef(rotation, 0, 0, 1.0f);
      //glTranslatef(-texture.getImageWidth()/2, -texture.getImageHeight()/2, 0);
View Full Code Here

TOP

Related Classes of client.ogl.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.