PDA

View Full Version : windowless rendering possible?



SonOfGrey
05-11-2007, 04:46 AM
Hi all,

I want to render an image in my application, but it has to happen all in the background. So no visible window may be created. The image has to be written to disk in the end.

I already tried some things to create an invisible window, but still the screen flickers.

Are there any standard solutions for this?
Thanks a lot!

SonOfGrey
05-11-2007, 04:56 AM
It's a Windows application by the way...

SonOfGrey
05-11-2007, 05:37 AM
So far I found info about PBuffers and framebuffer object extension (FBO).

Any reason to use one or the other?

H.Stony
05-11-2007, 05:41 AM
definitely FBO. with FBOs you don't need to swap contexts and they are plattform independet.

k_szczech
05-11-2007, 05:57 AM
You still need at least one rendering context - FBO does not create context. There was a topic aout this some time ago (a few months back). Somebody tried to run application as service so search for that.

RigidBody
05-11-2007, 06:26 AM
i'm not so familiar with windows- but i guess you can create a window without showing it on screen and still create a gl context for it... right?

SonOfGrey
05-11-2007, 06:34 AM
Idd I can create a window without showing it, but it still flickers on the screen, or at least the desktop redraws its icons and it should really be completely unnoticable.

Can't seem to find the other topic about the services though...

SonOfGrey
05-11-2007, 07:09 AM
If I need a rendering context, I call wglCreateContext(hDC)...but then I need a device context too to pass it (hDC).

I usually get that from GetDC(hWnd) where I pass the window handle from the window I created before, but this time I don't want a window. How can I create a rendering context then please?

Thank you!

k_szczech
05-11-2007, 08:35 AM
Look at these two topics. I hope they will be of some use to you:

http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=9;t=000731#000001

http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=4;t=001576#000002

SonOfGrey
05-11-2007, 10:48 AM
Thanks!
I'll check out the links!

Kumar K
05-13-2007, 11:16 PM
Please check this link
http://www.fengyuan.com/article/wmprint.html

It uses WM_PRINT command to capture the hidden screen.

I have used this in the past for drawing some thing on an invisible window and capturing as image. However its pure GDI no OpenGL, i guess it wont be a problem if you make this GL window.

Thanks
kumar.k