texture question
hi,
i am wondering if i do it correctly,
i want to display a square and some textured font, i have to disable the texture to draw my square then turn it back on to display my text, is it a good way to work or there is some other more efficient way to do it?
glDisable(GL_TEXTURE_2D);
glBegin(GL_POLYGON);
glVertex3f(0.1,0.2,0.0);
glVertex3f(0.6,0.2,0.0);
glVertex3f(0.6,0.6,0.0);
glVertex3f(0.1,0.6,0.0);
glVertex3f(0.1,0.2,0.0);
glEnd();
glEnable(GL_TEXTURE_2D);
CWriter::Instance()->glPrint(10,10,"Star Wars");
glPrint use textures.
thanks
Siddim.
One texture enable/disable per frame won''t kill your framerate. But when you have more stuff to render batch them up so you minimize state changes. Also try to awoid use of GL_POLYGON. Look into GL_TRIANGLE_STRIP/GL_TRIANGLE_FAN.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
You should never let your fears become the boundaries of your dreams.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement