Archived

This topic is now archived and is closed to further replies.

NumberXaero

Quick enable question and suggestion

Recommended Posts

NumberXaero    2624
Say you glEnable() ex. texturing which is off by default, then you glEnable() texturing again later, but its still on, is there a hit for this? would there be any point to tracking it yourself? Whats the ''best'' way to render small amounts of vertex data, say windows with only four corners in a gui, that need to be dragged, picked and kept track of? Any suggestions as to what ogl functions/extensions to look at/begin with?

Share this post


Link to post
Share on other sites
JinJo    100
As far as I know there is no extra hit in performance as OGL checks first if it is already enabled.

You could just use GL_QUADS to render rectangles for windows, I wouldn''t imagine it would turn out to slow for window management.
I am just in the middle of coding (well just designed it on paper) a GUI just now for my engine (which is coming along nicely) and I have a base class which e.g E_GUIObject (I always seem to prefix classes with E if they are for the engine and G if its for game code) which has like position (which is an offset of its parent object) and then i derive like window and buttons from this, if it works i''ll post a little demo app of it (which i would give source to but then u would need to look through the material rendering etc which isnt nessesary for the actual GUI), sorry I just rambled but i''ll get back to you soon hopefully.

Share this post


Link to post
Share on other sites
Trienco    2555
for a gui just stick with immediate mode. its unlikely that vertex arrays, buffers, display lists or whatever will make any difference (especially none justifying the extra work). once you have so many things on screen that you _might_ profit from faster vertex submission youll also burn so much fillrate that it doesnt matter.

Share this post


Link to post
Share on other sites