Jump to content
  • Advertisement

Archived

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

smitty1276

OpenGL Raster graphics in OpenGL

This topic is 6319 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m having a hard time figuring this out! I''ve seen a lot of examples for glDrawPixels() and glBitmap(), but they all seem to be written using a single buffered window. Is there any thing in particular I need to do differently in a double-buffered window? The program will run, but the pixels are never drawn. Just an empty window.

Share this post


Link to post
Share on other sites
Advertisement
Well, I''m wanting to be able to do the raster graphics on top of the 3d stuff... Fonts, HUDs, etc. How do I go from rendering polygons to drawing in 2D onto the screen?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Well, I''m wanting to be able to do the raster graphics on top of the 3d stuff... Fonts, HUDs, etc. How do I go from rendering polygons to drawing in 2D onto the screen?

Share this post


Link to post
Share on other sites
Do a glPushMatrix, then do this:
  
glViewport(0,0,width,height);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();

glOrtho(0.0f,width,height,0.0f,near,far);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

Then when you''re done drawing 2D stuff, do a glPopMatrix.

Resist Windows XP''s Invasive Production Activation Technology!
http://druidgames.cjb.net/

Share this post


Link to post
Share on other sites
glDrawBuffer(..), glDrawBuffer(..) u can set these to the front/back buffers with GL_FRONT/GL_BACK. standard for a single buffer is both GL_FRONT + double buffered window GL_BACK.
note with glDrawPixels() + glBitmap() it draws from the current raster position use glRasterPos..(..) to change this.

but all this is prolly of little use cause for a HUD textured quads are normally the way to go.

http://members.xoom.com/myBollux

Share this post


Link to post
Share on other sites
Thanks for the info guys! Pushing the matrix and the ortho mode stuff wasn''t discussed AT ALL in the book I''m learning from.

So you think textured quads would work best for, as an example, the instrument panel in an airplane? I always thought the way to go would be to draw the panel itself onto the screen and use sprite type images for the individual dials and needles and stuff.

Thanks for the info...

Share this post


Link to post
Share on other sites
raster is really really slow. using textured quads would be many times faster. the only reason to use raster graphics is if the target computer doesn''t have hardware accel(like school comps). then in that case, raster is slightly faster.

life is unfair, take advantage of it.
UNMB2 - if the link doesn''t work, try clicking it

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!