Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / Game Design & Programming / using OpenGL without initializing a window Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
d3lphi

January 03, 2005, 04:39 AM

Hi.

I'm trying to get an OGL-rendering-context initialized without initializing any kind of window. The reason why is that (1.) I don't need a window and (2.) later I want to choose between several graphic-boards installed to my workstation. That means I want to get a device-/rendering-context that is not dependend to a window, but to a specific display adapter. First question:

Does anybody know if that is possible at all?

By now the DC is created from an enumerated display adapter. I then choose a pixel format. The then generated ogl-RC is working only with the pixel-formats PFD_DRAW_TO_BITMAP-flag set. The most important issue: the OpenGL-implementation used by the system is the software Windows-built-in version 1.1, which is not really sufficient.. . If I set PFD_DRAW_TO_WINDOW, the RC is created but wglMakeCurrent fails. (I've tried quite some variations defining the pixelformat)
So second question:

How can I tell my system to give me hardware-support via OpenGL without having to nurse a window?

Or third:

Is there a way of telling Windows which display adapter to use during window-creation?



Thanks for help in advance.
d3lphi





 
Chris

January 03, 2005, 05:01 AM

AFAIK things are as follows:

1. Most cards/drivers don't like to render to memory DCs, thus you're seeing the Microsoft OpenGL 1.1 rendering taking over when specifying PFD_DRAW_TO_BITMAP. If you want hardware acceleration, use p-buffers (but to establish a p-buffer you need a DC, and that DC most likely must be supported by the hardware OpenGL driver or else the Microsoft OpenGL would tell you that it doesn't support p-buffers).

So accelerated OpenGL is only available when rendering to a window.

2. The DC you create from an enumerated display adapter probably is a memory DC (since it has no association with some part of the screen), so 1. follows.

3. To choose a specific adapter, you would have to create a window on the monitor/desktop part handled by that adapter (e.g. place it there). The GLRC created from a DC on that window should then use the adapater's GL acceleration, I think.

But maybe I missed a point here.

 
d3lphi

January 03, 2005, 06:50 AM

thanks for your reply.


>>2. The DC you create from an enumerated display adapter probably is a memory DC (since it has no association with some part of the screen), so 1. follows.


btw: then what do you enumerate the devices for? Memory DC does not mean VRAM, does it?


>>3. To choose a specific adapter, you would have to create a window on the monitor/desktop part handled by that adapter (e.g. place it there). The GLRC created from a DC on that window should then use the adapater's GL acceleration, I think.


That's quite an idea I think, but actually the second adapter is not meant to be attached to any display at all. Hmm, maybe Windows doesn't mind..

Well, thank you again and enjoy coding.
d3lphi

 
Chris

January 03, 2005, 07:31 AM

Memory DC does not mean VRAM, no.

On-screen DCs get a backbuffer in VRAM is you set their display format accordingly.

Also if the second adapter has no display attached to it, then the desktop does not extend to it. I think then you cannot get a HMONITOR handle for it, and cannot create a window on it. So no chance to use it, I fear.

Your only option may be to extend you desktop onto a second adapter (if that hardware works w/o a physical display attached).

 
d3lphi

January 03, 2005, 08:43 AM

now I crunch that stuff better.

d3lphi

 
This thread contains 5 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.