Moves default GL state setup to GL device.

This was SVN commit r26187.
This commit is contained in:
Vladislav Belov 2022-01-07 22:21:22 +00:00
parent 5610c71fc6
commit 9924450d36
2 changed files with 11 additions and 11 deletions

View File

@ -382,17 +382,6 @@ bool CRenderer::Open(int width, int height)
m_Width = width;
m_Height = height;
// set packing parameters
glPixelStorei(GL_PACK_ALIGNMENT,1);
glPixelStorei(GL_UNPACK_ALIGNMENT,1);
// setup default state
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
glCullFace(GL_BACK);
glFrontFace(GL_CCW);
glEnable(GL_CULL_FACE);
// Validate the currently selected render path
SetRenderPath(g_RenderingOptions.GetRenderPath());

View File

@ -192,6 +192,17 @@ std::unique_ptr<CDevice> CDevice::Create(SDL_Window* window, const bool arb)
device->m_DriverInformation = GetDriverInformationImpl();
device->m_Extensions = GetExtensionsImpl();
// Set packing parameters for uploading and downloading data.
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
// Setup default state.
glDepthFunc(GL_LEQUAL);
glEnable(GL_DEPTH_TEST);
glCullFace(GL_BACK);
glFrontFace(GL_CCW);
glEnable(GL_CULL_FACE);
return device;
}