• Advertisement

Archived

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

Drawing to the finished frame

This topic is 6384 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

Hi, anyone know how to draw directly to the frame buffer (while using double buffering) for doing things like displaying stats, etc. (stuff that just needs ortho). OGAPO

Share this post


Link to post
Share on other sites
Advertisement
just create a othro matrix after youve done the 3d stuff

eg draw 3d stuff
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,winWidth,0,winHeight,-1.0,1.0); //?? why am i going -1 that doesn''t sound right
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
// draw HUD

Share this post


Link to post
Share on other sites
Wont that cause quite a bit of lag though? I meanhaving to switch back and fourth from ortho to projrction each frame. I was kinda just wanting to use the DC commands and such. i just need to know how to make sure i''m drawing to the buffer and not the screen itself.

Share this post


Link to post
Share on other sites
zedzeek is right! The time you spend every frame to change projection matrix is not significant (and it''s faster than other operations you certainly have...). You have simply to load a 4x4 floating point matrix!

Yes you can access directly the back-buffer but you waste a lot of band-width to pass data from/to video card memory!!!

A third solution should be to use Windows GDI but I think it''s not a good and clear solution!

Share this post


Link to post
Share on other sites

  • Advertisement