Advertisement Jump to content
Sign in to follow this  

OpenGL Win32 open a window on a display device

This topic is 4909 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 First post, so hello everyone. I have an SLI machine (2 GeForce 6600 GT cards). I'm trying to open 2 openGL windows: 1 window on each of the cards. I haven't been able to find any win32 commands that enable me to open a window with an openGL rendering context for a specific device. The normal process I use to open a window with an openGL rendering context: // declare a window class HWND hWnd = CreateWindow(...); HDC hDC = GetDC(hWnd); // choose pixel format code comes here HGLRC hGLRC = wglCreateContext(hDC); // ... According to MSDN if I want to open a DC for a specific device I have to do something like this: // first get the device: // can use EnumDisplayDevices to get and verify the device index. int deviceIndex = 0 ; DISPLAY_DEVICE displayDevice; EnumDisplayDevices(NULL, deviceIndex, &displayDevice, 0); // create a DC for the device HDC hdc = CreateDC(deviceInfo->DeviceName, deviceInfo->DeviceName, 0, 0); This is where I get stuck: How do I create a window for the DC I just created for the device? (Or how do I disconnect a window from its DC and connect it to another DC?) The CreateWindow win32 function doesn't get any parameter that allows me to set the device that I want to use. I need a code sample that shows how to create a window over a specifc device (or DC), or how to diconnect a window from its DC and connect it to another DC. Thanks.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!