Results 1 to 3 of 3

Thread: [Unit] Sour

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    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
    Last edited by User137; 08-10-2012 at 12:50 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •