Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed useless gl error checking, especially after draw calls.

  • Loading branch information...
commit 3d21b10913863a0c7d0c02926f4ab45bde87359d 1 parent bb8c060
Yohann Ferreira authored
View
5 src/engine/video/image.cpp
@@ -634,11 +634,6 @@ void ImageDescriptor::_DrawTexture(const Color* draw_color) const {
// Use a vertex array to draw all of the vertices
glDrawArrays(GL_QUADS, 0, 4);
-
- if (VideoManager->CheckGLError()) {
- IF_PRINT_WARNING(VIDEO_DEBUG) << "an OpenGL error occurred: "
- << VideoManager->CreateGLErrorString() << std::endl;
- }
} // void ImageDescriptor::_DrawTexture(const Color* color_array) const
View
4 src/engine/video/texture.cpp
@@ -189,10 +189,6 @@ void TexSheet::DEBUG_Draw() const {
VideoManager->EnableVertexArray();
glVertexPointer(2, GL_FLOAT, 0, vertex_coords);
glDrawArrays(GL_QUADS, 0, 4);
-
- if (VideoManager->CheckGLError() == true) {
- IF_PRINT_WARNING(VIDEO_DEBUG) << "an OpenGL error occurred: " << VideoManager->CreateGLErrorString() << std::endl;
- }
} // void TexSheet::DEBUG_Draw() const
// -----------------------------------------------------------------------------
View
12 src/engine/video/texture_controller.cpp
@@ -269,7 +269,7 @@ GLuint TextureController::_CreateBlankGLTexture(int32 width, int32 height) {
return INVALID_TEXTURE_ID;
}
- _BindTexture(tex_id); // NOTE: this call makes another call to VideoManager->CheckGLError()
+ _BindTexture(tex_id);
// If the binding was successful, initialize the texture with glTexImage2D()
if (VideoManager->GetGLError() == GL_NO_ERROR) {
@@ -302,11 +302,7 @@ void TextureController::_BindTexture(GLuint tex_id) {
_last_tex_id = tex_id;
glBindTexture(GL_TEXTURE_2D, tex_id);
- _debug_num_tex_switches++;
-
- if (VideoManager->CheckGLError()) {
- PRINT_WARNING << "an OpenGL error was detected: " << VideoManager->CreateGLErrorString() << std::endl;
- }
+ ++_debug_num_tex_switches;
}
@@ -316,10 +312,6 @@ void TextureController::_DeleteTexture(GLuint tex_id) {
if (_last_tex_id == tex_id)
_last_tex_id = INVALID_TEXTURE_ID;
-
- if (VideoManager->CheckGLError()) {
- PRINT_WARNING << "an OpenGL error was detected: " << VideoManager->CreateGLErrorString() << std::endl;
- }
}
View
13 src/engine/video/video.cpp
@@ -336,10 +336,6 @@ void VideoEngine::Clear(const Color &c) {
glClear(GL_COLOR_BUFFER_BIT);
TextureManager->_debug_num_tex_switches = 0;
-
- if (CheckGLError() == true) {
- IF_PRINT_WARNING(VIDEO_DEBUG) << "an OpenGL error occured: " << CreateGLErrorString() << std::endl;
- }
}
@@ -778,9 +774,6 @@ StillImage VideoEngine::CaptureScreen() throw(Exception) {
StillImage screen_image;
- // TEMP: temporary resolution until capture screen bug is fixed
-// return screen_image;
-
// Retrieve width/height of the viewport. viewport_dimensions[2] is the width, [3] is the height
GLint viewport_dimensions[4];
glGetIntegerv(GL_VIEWPORT, viewport_dimensions);
@@ -828,11 +821,7 @@ StillImage VideoEngine::CaptureScreen() throw(Exception) {
new_image->v1 = new_image->v2;
new_image->v2 = temp;
- if (CheckGLError() == true) {
- IF_PRINT_WARNING(VIDEO_DEBUG) << "an OpenGL error occurred: " << CreateGLErrorString() << std::endl;
- }
-
- capture_id++;
+ ++capture_id;
return screen_image;
}
Please sign in to comment.
Something went wrong with that request. Please try again.