-
Question about glDisable/glEnable
Hi,
I'm coding a small rendering engine with OpenGL and I have a doubt about glEnable/glDisable:
In my rendering loop I first set a bunch of default states (TEXTURE_2D and vertex/color arrays), then each single object draws itself and finally the default states are disabled before swapping buffers. What I am unsure about is: is it more efficient to enable those default states only once and leave them enabled all the time instead of disabling/enabling them at the start/end of each loop?
-
Advanced Member
Frequent Contributor
The fastest way to do things is to not do them. What I mean here is that if you know that the state doesn't change between objects then don't change it.
Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
Technical Blog:
http://www.rastergrid.com/blog/
-
Ok, perfect. Thanks for your advice!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules