mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 20:43:26 +02:00
fix initialization opengl glitch
This commit is contained in:
@@ -208,6 +208,7 @@ void Application::run()
|
||||
m_foregroundFrameCounter.processNextFrame();
|
||||
|
||||
// draw foreground
|
||||
g_painter->clearScreen();
|
||||
g_ui.render(true);
|
||||
|
||||
// copy the foreground to a texture
|
||||
|
@@ -86,10 +86,6 @@ void Graphics::init()
|
||||
glEnable(GL_CULL_FACE);
|
||||
*/
|
||||
|
||||
// clear color buffer
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
// determine max texture size
|
||||
GLint maxTextureSize = 0;
|
||||
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
|
||||
|
@@ -86,6 +86,12 @@ void Painter::restoreSavedState()
|
||||
setTexture(m_olderStates[m_oldStateIndex].texture);
|
||||
}
|
||||
|
||||
void Painter::clearScreen()
|
||||
{
|
||||
glClearColor(0,0,0,1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void Painter::setCompositionMode(Painter::CompositionMode compositionMode)
|
||||
{
|
||||
if(m_compositionMode == compositionMode)
|
||||
|
@@ -65,6 +65,7 @@ public:
|
||||
void saveState();
|
||||
void saveAndResetState();
|
||||
void restoreSavedState();
|
||||
void clearScreen();
|
||||
|
||||
virtual void drawCoords(CoordsBuffer& coordsBuffer, DrawMode drawMode = Triangles) = 0;
|
||||
virtual void drawTextureCoords(CoordsBuffer& coordsBuffer, const TexturePtr& texture) = 0;
|
||||
|
Reference in New Issue
Block a user