mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-26 03:46:14 +00:00
Moves default GL state setup to GL device.
This was SVN commit r26187.
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user