Fixed crash when changing filters
Changed expected sampler in shaders to "OGL2Texture" git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@210 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
3e73213099
commit
d796bebb0b
|
@ -82,7 +82,6 @@ private:
|
||||||
void initializeFont();
|
void initializeFont();
|
||||||
void InitShader();
|
void InitShader();
|
||||||
void DeInitShader();
|
void DeInitShader();
|
||||||
void rasterise();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -309,8 +308,20 @@ void OpenGLDisplay::clear()
|
||||||
glClear( GL_COLOR_BUFFER_BIT );
|
glClear( GL_COLOR_BUFFER_BIT );
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGLDisplay::rasterise()
|
void OpenGLDisplay::render()
|
||||||
{
|
{
|
||||||
|
clear();
|
||||||
|
if (theApp.GLSLShaders){
|
||||||
|
InitShader();
|
||||||
|
glUseProgramObjectARB(ShaderProgram);
|
||||||
|
int texture_location = glGetUniformLocationARB(ShaderProgram, "OGL2Texture");
|
||||||
|
glUniform1iARB(texture_location, 0);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
glUseProgramObjectARB(NULL);
|
||||||
|
DeInitShader();
|
||||||
|
}
|
||||||
|
|
||||||
int pitch = theApp.filterWidth * (systemColorDepth>>3) + 4;
|
int pitch = theApp.filterWidth * (systemColorDepth>>3) + 4;
|
||||||
u8 *data = pix + ( theApp.sizeX + 1 ) * 4;
|
u8 *data = pix + ( theApp.sizeX + 1 ) * 4;
|
||||||
|
|
||||||
|
@ -428,23 +439,6 @@ void OpenGLDisplay::rasterise()
|
||||||
theApp.screenMessage = false;
|
theApp.screenMessage = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenGLDisplay::render()
|
|
||||||
{
|
|
||||||
clear();
|
|
||||||
if (theApp.GLSLShaders){
|
|
||||||
InitShader();
|
|
||||||
glUseProgramObjectARB(ShaderProgram);
|
|
||||||
int texture_location = glGetUniformLocationARB(ShaderProgram, "ShaderTexture");
|
|
||||||
glUniform1iARB(texture_location, 0);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
glUseProgramObjectARB(NULL);
|
|
||||||
DeInitShader();
|
|
||||||
}
|
|
||||||
rasterise();
|
|
||||||
|
|
||||||
glFlush();
|
glFlush();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue