Browse Source

Minor code cleanup.

pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
eb0565b5d9
  1. 8
      src/AbstractShaderProgram.cpp
  2. 2
      src/Contexts/CMakeLists.txt

8
src/AbstractShaderProgram.cpp

@ -72,8 +72,7 @@ AbstractShaderProgram::UniformMatrix4x3dvImplementation AbstractShaderProgram::u
AbstractShaderProgram::~AbstractShaderProgram() {
/* Remove current usage from the state */
GLuint& current = Context::current()->state()->shaderProgram->current;
if(current == _id)
current = 0;
if(current == _id) current = 0;
glDeleteProgram(_id);
}
@ -83,10 +82,7 @@ bool AbstractShaderProgram::use() {
/* Use only if the program isn't already in use */
GLuint& current = Context::current()->state()->shaderProgram->current;
if(current != _id) {
current = _id;
glUseProgram(_id);
}
if(current != _id) glUseProgram(current = _id);
return true;
}

2
src/Contexts/CMakeLists.txt

@ -72,7 +72,7 @@ if(NEED_ABSTRACTXWINDOWCONTEXT)
install(FILES AbstractXWindowContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
endif()
# GLX window context
# GLX context
if(NEED_GLXCONTEXT)
add_library(MagnumGlxContextHandler OBJECT GlxContextHandler.cpp)
# X11 macros are a mess, disable warnings for C-style casts

Loading…
Cancel
Save