Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


OpenGL window size?

This topic is 5293 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

Right, im having trouble creating a full screen window with OpenGl i''ve been over the code countless times, and can''t find whats wrong or what flag is missing can anyone help with this? if (!RegisterClassEx(&windowClass)) return 0; if (fullscreen) // fullscreen? { DEVMODE dmScreenSettings; // device mode memset(&dmScreenSettings,0,sizeof(dmScreenSettings)); dmScreenSettings.dmSize = sizeof(dmScreenSettings); dmScreenSettings.dmPelsWidth = windowWidth; // screen width dmScreenSettings.dmPelsHeight = windowHeight; // screen height dmScreenSettings.dmBitsPerPel = windowBits; // bits per pixel dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT; // if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) { // setting display mode failed, switch to windowed MessageBox(NULL, "Display mode failed", NULL, MB_OK); fullscreen = FALSE; } } if (fullscreen) // Are We Still In Fullscreen Mode? { dwExStyle=WS_EX_APPWINDOW; // Window Extended Style dwStyle=WS_POPUP; // Windows Style ShowCursor(FALSE); // Hide Mouse Pointer } else { dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; // Window Extended Style dwStyle=WS_OVERLAPPEDWINDOW; // Windows Style } AdjustWindowRectEx(&windowRect, dwStyle, FALSE, dwExStyle); // Adjust Window To True Requested Size // class registered, so now create our window hwnd = CreateWindowEx(NULL, // extended style "GLClass", // class name "BOGLGP - Chapter 2 - OpenGL Application", // app name dwStyle | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, // x,y coordinate 0, 0, // width, height NULL, // handle to parent NULL, // handle to menu hInstance, // application instance NULL); // no extra params hDC = GetDC(hwnd); // check if window creation failed (hwnd would equal NULL) if (!hwnd) return 0; ShowWindow(hwnd, SW_SHOW); // display the window UpdateWindow(hwnd); // update the window i never posted code snippet before so unsure how its goin to come out??

Share this post

Link to post
Share on other sites
right it didn''t come off too well...

but the snippet is from the highly recommended bk of beginning opengl, which im sure most people in gamedev know about...as its written by the bole who runs it.

umm.. so yer any help please

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!