Skip to content

Commit

Permalink
ofShader: fix ubo ext check
Browse files Browse the repository at this point in the history
  • Loading branch information
arturoc committed Sep 16, 2016
1 parent 8678879 commit 95ab11f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libs/openFrameworks/gl/ofShader.cpp
Expand Up @@ -17,9 +17,6 @@
#include "ofxAndroidUtils.h"
#endif

#ifndef GLEW_ARB_uniform_buffer_object
#define GLEW_ARB_uniform_buffer_object 0
#endif

static const string COLOR_ATTRIBUTE="color";
static const string POSITION_ATTRIBUTE="position";
Expand Down Expand Up @@ -698,6 +695,7 @@ bool ofShader::linkProgram() {
}

#ifndef TARGET_OPENGLES
#ifdef GLEW_ARB_uniform_buffer_object
if(GLEW_ARB_uniform_buffer_object) {
// Pre-cache all active uniforms blocks
GLint numUniformBlocks = 0;
Expand All @@ -713,6 +711,7 @@ bool ofShader::linkProgram() {
}
}
#endif
#endif

#ifdef TARGET_ANDROID
ofAddListener(ofxAndroidEvents().unloadGL,this,&ofShader::unloadGL);
Expand Down Expand Up @@ -1287,6 +1286,7 @@ GLint ofShader::getUniformLocation(const string & name) const{
}

#ifndef TARGET_OPENGLES
#ifdef GLEW_ARB_uniform_buffer_object
//--------------------------------------------------------------
GLint ofShader::getUniformBlockIndex(const string & name) const{
if(!bLoaded) return -1;
Expand Down Expand Up @@ -1369,6 +1369,7 @@ void ofShader::bindUniformBlock(GLuint binding, const string & name) const{
}
}
#endif
#endif

//--------------------------------------------------------------
void ofShader::printActiveUniforms() const{
Expand Down
2 changes: 2 additions & 0 deletions libs/openFrameworks/gl/ofShader.h
Expand Up @@ -177,11 +177,13 @@ class ofShader {
GLint getAttributeLocation(const string & name) const;

#ifndef TARGET_OPENGLES
#ifdef GLEW_ARB_uniform_buffer_object
GLint getUniformBlockIndex(const string & name) const;
GLint getUniformBlockBinding(const string & name) const;
void bindUniformBlock(GLuint bindind, const string & name) const;
void printActiveUniformBlocks() const;
#endif
#endif

#ifndef TARGET_OPENGLES
void setAttribute1s(GLint location, short v1) const;
Expand Down

0 comments on commit 95ab11f

Please sign in to comment.