Skip to content

Instantly share code, notes, and snippets.

@flexd
Created March 4, 2012 14:42
Show Gist options
  • Save flexd/1973306 to your computer and use it in GitHub Desktop.
Save flexd/1973306 to your computer and use it in GitHub Desktop.
public void initGL() {
//2D Initialization
/*glClearColor(0.0f,0.0f,0.0f,0.0f);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);*/
//glEnable(GL_TEXTURE_2D);
font = new TrueTypeFont(awtFont, false);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0, DISPLAY_WIDTH, DISPLAY_HEIGHT, 0, 1, -1);
glMatrixMode(GL_MODELVIEW);
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
//glScalef(1f/32f, 1f/32f, 1f);
tManager.load("world", "world", 32); // spritesheet name, filename, slotSize
tManager.define("world", "character", 0, 10); // Sheet named "world", "name of sprite", slot 0,0 in spritesheet.
box = new AbstractTexturedMoveableEntity(15, 15, "character"); // Position x, y, sprite named "character"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment