OpenGL glIsEnabled Calls

Go down

OpenGL glIsEnabled Calls

Post  uprise78 on Wed Mar 25, 2009 5:21 pm

Im still a super newbie in openGL so please correct me if i am wrong on this. From the couple books i am in the process of reading they all make mention that you should try to reduce or eliminate any calls to glIsEnabled and keep the state yourself in your own code. I see a lot of calls like the following in sio2:

      if( !glIsEnabled( GL_BLEND ) )
      { glEnable( GL_BLEND ); }

Would there be a significant advantage to keeping state in the sio2 struct instead of querying openGL?


Posts : 228
Join date : 2008-10-31

View user profile

Back to top Go down

Re: OpenGL glIsEnabled Calls

Post  sio2interactive on Wed Mar 25, 2009 6:01 pm

yes that can be done... however glIsEnabled will check the client state on a GL_CONTEXT basis held in the client memory (and from what I understand in software) so basically Im not sure that the speed gain will be significant... but still worth the try...

SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum