Page 1 of 1

[2.1] "wglMakeCurrent failed" on Windows when creating a renderwindow.

Posted: Mon May 06, 2019 10:23 am
by gabbsson
Ogre Version: 2.1
Operating System: Windows
Render System: OpenGL

A co-worker ran into this error when attempting to run my project on windows, additional difference is that it has an Nvida quadro card whereas I have been running on integrated intel graphics.
Since I have been developing and testing on linux I have never encountered this error before and I'm curious if someone knows whats causing it / how to fix it.

The error is:

Code: Select all


 OGRE EXCEPTION(3:RenderingAPIException): wglMakeCurrent failed: The pixel format is invalid.
 in Win32Window::create at C:\cygwin\home-EEE\IntegrationRepPC\lib\Ogre\Ogre-2.1\RenderSystems\GL3Plus\src\windowing\win32\OgreWin32Window.cpp (line 514)

The project starts by creating a dummy window which does nothing. Later one or more renderwindows are created which are placed in Qt widgets.
I mention this since I have had to mess around with contexts.
The initial dummy window uses currentGLContext = false, then all following windows use currentGLContext = true.

Full ogre log here:
Ogre.log
(34.73 KiB) Downloaded 33 times

Re: [2.1] "wglMakeCurrent failed" on Windows when creating a renderwindow.

Posted: Thu May 09, 2019 4:33 am
by ExtraSauce
Are you using wingdi to setup the gl contexts? How are you setting up the pixel format?