

Note that I have the images for all possible field-types in one. GlTexCoord2f(textArea.b.x,textArea.b.y) glVertex2f(display.b.x,display.a.y) GlTexCoord2f(textArea.b.x,textArea.a.y) glVertex2f(display.b.x,display.b.y) GlTexCoord2f(textArea.a.x,textArea.a.y) glVertex2f(display.a.x,display.b.y)

GlTexCoord2f(textArea.a.x,textArea.b.y) glVertex2f(display.a.x,display.a.y) This is my current Code for each of the 300 fields: glColor3f(1,1,1) Then I would have to output only one texture with 4 Texture Coordinates (0/0)(0/1)(1/1)(1/0) and 4 glVertex2f() which specifies the position in the Window. So I'm currently outputting a texture for each field which is quite slow (300 textures/frame).īut due to the reason that the level never changes, I wondered if it's possible to combine the textures to a big, single texture before the game-loop starts. I'm programming a 2D-Game in OpenGL and I have to output a level which consists of 20x15 fields.
