Code:
Procedure DrawImage(...);
begin
glENABLE(GL_Texture_2D);
glBindTexture(GL_Texture_2D, Tex^);
glBegin(GL_Quads);
...
glEnd();
glDISABLE(GL_Texture_2D)
end;
You have this as a base for every drawing operation. Especially the glBindTexture() is a heavy operation. Consider when you would need to draw 10000 particles with same texture, it would call that pointlessly 9999 times per frame. It's possible to store last used texture-index and skip bind if its unchanged, but it comes with problems if some other operation binds without letting your engine know. I went with SetTex() function myself, but that might not go well with SDL-style programming.
Other thing i found when quickly skimming through, was:
Code:
Procedure SetGLAttributes(R,G,B,Double:LongWord);
Is that even possible, i could do this?
Code:
var double: double;
Usually recommended to avoid using reserved names in variables and constants.
But overall seemed good work of course
Bookmarks