Advertisement

Drawing offscreen and viewport size

Started by September 22, 2003 07:03 PM
3 comments, last by Crispy 21 years, 5 months ago
These are the two questions that have been bugging me for more than an hour now (I guess I''m having one of those blocks...). 1) I need to draw into the frame buffer offscreen to precreate a set of images before I start displaying anything. This is all cool and it works, but only as long as the window is completely visible (otherwise Windows does its statutory clipping) - that means, if the window is partially outside of the desktop or covered by the start bar/some other window - parts of it are not cleared properly. I, on the other hand need full access to the entire updated frame buffer... 2) I have viewport and perspective properly set up. In the perspective view everything is fine, but the ortho view extens from (-1, -1) to (1, 1), instead of (0, 0) to (vp_x, vp_y). I''ve never had this problem before so I guess I''m just forgetting something (since I started a brand new basecode and went through the whole mess of getting every rudimentary detail properly set up again). To be more precise, I''m having trouble working out any kind of correlation between outline font size and viewport size. I''d appreciate a pointer or two where I might be messing up. Cheers
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
Re: question 1 - wouldn''t it be better to render into an offscreen DIBSection?
Advertisement
Why don't you use pbuffers for offscreen rendering? See http://oss.sgi.com/projects/ogl-sample/registry/ for more information on pbuffer (WGL_ARB_pbuffer extension)!

--------------------------------------------------------

"If it looks good, it is good computer graphics"
"If it looks like computer graphics, it is bad computer graphics"

Corrail
corrail@gmx.at
ICQ#59184081

[edited by - Corrail on September 23, 2003 9:19:43 AM]
--------------------------------------------------------There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.There is another theory which states that this has already happened...
quote:
Original post by Ferdinand the Bull
Re: question 1 - wouldn''t it be better to render into an offscreen DIBSection?


1) You mean, independently from OpenGL?
2) I need the video cards features (blending, etc)...


quote:
Original post by Ferdinand the Corrail
Why don''t you use pbuffers for offscreen rendering? See http://oss.sgi.com/projects/ogl-sample/registry/ for more information on pbuffer (WGL_ARB_pbuffer extension)!



Thanks for the clickerson. I never really knew/took interest in what this extension was for

Alternatvely, I''m thinking of force-switching to fullscreen, which pretty effectively gets rid of this problem...
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
1) No, not independently from GL. Windows' implementation provides the capability of selecting a rendering context into a memory DC. It's slower than blting an image from the screen, and you lose the advantage of hardware acceleration, but it allows you to get a complete image, regardless of whether or not the app window is partially/completely obscured. Also, since the GL implementation used is the basic MS OpenGL 1.1, any advanced features (> 1.1) won't work.

I tend to code for the minimum expected configuration, avoiding the use of extensions and features not supported by the basic software implementation, so the limitations I described don't bother me. (BTW, blending ops are supported in 1.1).

I'm not familiar with the pBuffer extension, but this has piqued my curiousity so I'll probably check it out, now. If pBuffer rendering allows the hardware implementation to be used when rendering off-screen, that would eliminate the restriction imposed by the software implementation - you'd have access to whatever features are supported by the video board. (For my own use, this won't change the way I do things- I'll still program for the lowest common denominator. I don't write games, and am not as concerned w/ using the latest, greatest features as others who hang out here.)

[edited by - Ferdinand the Bull on September 25, 2003 12:04:57 PM]

This topic is closed to new replies.

Advertisement