Jump to content

  • Log In with Google      Sign In   
  • Create Account


glEnable/Disable question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Jesper T   Members   -  Reputation: 322

Like
Likes
Like

Posted 01 August 2001 - 11:26 AM

Just a little question... If I want to render a scene with a texture mapped quad, a colored poly without texture and a raster positioned image, and I want it all to show at once.. can I do all that like this : glEnable(GL_TEXTURES) drawQuadFunction() glDisable(GL_TEXTURES) drawColoredPolyFunction() glEnable(GL_TEXTURES) glRasterPos2i(x3,y3) drawRasterImageFunction() Or does the glEnable/Disable functions count for the entire loop ? ( i.e. the last one counts, so everything i draw will be with textured and rasterpositioned( or whatever its called ))

Sponsor:

#2 mittens   Moderators   -  Reputation: 1315

Like
Likes
Like

Posted 01 August 2001 - 12:01 PM


/* Snippet one */
glEnable(GL_TEXTURE_2D);
DrawTex1();
DrawTex2();
DrawTex3();

/* Snippet two */
glDisable(GL_TEXTURE_2D);
DrawTex1();
DrawTex2();
DrawTex3();


Snippet one will all get rendered textured, whereas snippet two will all get rendered non-textured.
So to plainly answer your question, if you Enable texturing at the start of your program, and never
disable it, you program will have texturing enabled throughout it''s life.

------------------------------
Trent (ShiningKnight)
E-mail me
OpenGL Game Programming Tutorials




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS