OpenGLRenderer: Choose between OpenGL/OpenGL ES at loading
This commit is contained in:
@@ -19,6 +19,8 @@ namespace Nz::GL
|
||||
|
||||
bool WGLContext::Create(const WGLContext* baseContext, const ContextParams& params, const WGLContext* shareContext)
|
||||
{
|
||||
Destroy();
|
||||
|
||||
// Creating a context requires a device context, create window to get one
|
||||
HWNDHandle window(::CreateWindowA("STATIC", nullptr, WS_DISABLED | WS_POPUP, 0, 0, 1, 1, nullptr, nullptr, GetModuleHandle(nullptr), nullptr));
|
||||
if (!window)
|
||||
@@ -47,6 +49,8 @@ namespace Nz::GL
|
||||
{
|
||||
NazaraAssert(window.type == WindowManager::Windows, "expected Windows window");
|
||||
|
||||
Destroy();
|
||||
|
||||
m_deviceContext = ::GetDC(static_cast<HWND>(window.windows.window));
|
||||
if (!m_deviceContext)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user