Archived

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

Frank Henry

Problems with Lines and Textured Triangles

Recommended Posts

hi, when i draw regular lines everything works (in color), but as soon as i add a textured triangle-strip the lines are only black! am i missing something? do i have to set something? thanks Stephan-Frank HENRY ------------------- Frank.Henry@gmx.net

Share this post


Link to post
Share on other sites
You need to disable texturing before drawing the lines and then re-enable texturing as soon as you finish that.

a.k.a. something like...

glStart(GL_TRIANGLE_STRIPS);
// Draw Triangles
glEnd();

glDisable(GL_TEXTURE_2D);

glStart(GL_LINES);
// Draw Lines
glEnd();

glEnable(GL_TEXTURE_2D);

Hope this helps.

~ Dragonus

Share this post


Link to post
Share on other sites
hi,

thanks, works like a charm!
but i''m using it like this:

void drawTexturedSomething ()

glEnable (GL_TEXTURE_2D);

//do texture stuff

glDisable (GL_TEXTURE_2D);

does the (un)setting or the
en/disableing of stuff comprimise the
speed?

i''m working on capsuling as much as possible,
any tips?

thanks

Share this post


Link to post
Share on other sites
I don''t think it really makes a difference if it''s on or off -- performance-wise. Using my handy-dandy little GL FAQ that I have here, the only comments made about it are that glEnable() and glDisable() "enable or disable various GL capabilities", and for glEnable(GL_TEXTURE_2D), "if enabled, two-dimensional texturing is performed".

The way it sounds as if glEn/Disable() simply sets a bit somewhere in memory, referring to the GL''s texturing mode, and before drawing anything, simply grabs that bit to determine whether texture needs to be done or not. In fact, since you don''t have to texture the lines, I''d assume you''d have a performance increase rather than decrease, but then again, I''ve never bothered to display or calculate FPS''s.

Hope this helps!

~ Dragonus

Share this post


Link to post
Share on other sites