Drawing to the finished frame
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
Brought to you by: [email=ogapo@ithink.net]O.G.A.P.O.[/email] +----------------------------------------+| Surgeon General's Warning - || OGAPO can cause serious mental damage || if taken in large doses. |+----------------------------------------+/* Never underestimate the power of stupid people in large groups */
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
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
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.
Brought to you by: [email=ogapo@ithink.net]O.G.A.P.O.[/email] +----------------------------------------+| Surgeon General's Warning - || OGAPO can cause serious mental damage || if taken in large doses. |+----------------------------------------+/* Never underestimate the power of stupid people in large groups */
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!
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!
IpSeDiXiT
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement