1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-26 16:24:35 +01:00

Fixed Depricated Enum Drawing Errors

This commit is contained in:
LRFLEW
2016-06-12 17:43:13 -05:00
parent 3db558f236
commit 0311fdd35c
6 changed files with 15 additions and 6 deletions

View File

@@ -42,8 +42,6 @@ CopyFramebufferShader::~CopyFramebufferShader()
{
glDeleteBuffers(1, &_vbo);
glDeleteVertexArrays(1, &_vao);
glBindVertexArray(_vao);
}
void CopyFramebufferShader::GetLocations()
@@ -79,7 +77,7 @@ void CopyFramebufferShader::SetTexture(GLuint texture)
void CopyFramebufferShader::Draw()
{
glBindVertexArray(_vao);
glDrawArrays(GL_QUADS, 0, 4);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
#endif /* DISABLE_OPENGL */

View File

@@ -87,7 +87,7 @@ void DrawImageMaskedShader::Draw(sint32 left, sint32 top, sint32 right, sint32 b
SetBounds(left, top, right, bottom);
glBindVertexArray(_vao);
glDrawArrays(GL_QUADS, 0, 4);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
#endif /* DISABLE_OPENGL */

View File

@@ -100,7 +100,7 @@ void DrawImageShader::Draw(sint32 left, sint32 top, sint32 right, sint32 bottom)
SetBounds(left, top, right, bottom);
glBindVertexArray(_vao);
glDrawArrays(GL_QUADS, 0, 4);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
#endif /* DISABLE_OPENGL */

View File

@@ -95,7 +95,7 @@ void FillRectShader::Draw(sint32 left, sint32 top, sint32 right, sint32 bottom)
SetBounds(left, top, right, bottom);
glBindVertexArray(_vao);
glDrawArrays(GL_QUADS, 0, 4);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
#endif /* DISABLE_OPENGL */

View File

@@ -154,6 +154,16 @@ GLAPI_DECL PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer GLAP
#endif /* OPENGL_NO_LINK */
inline void CheckGLError()
{
GLenum error = glGetError();
while (error != GL_NO_ERROR)
{
log_error("OpenGL Error 0x%04X", error);
error = glGetError();
}
}
namespace OpenGLAPI
{
bool Initialise();

View File

@@ -330,6 +330,7 @@ public:
->GetTexture());
_copyFramebufferShader->Draw();
CheckGLError();
Display();
}