Fixed crash when changing filters

Changed expected sampler in shaders to "OGL2Texture"
This commit is contained in:
mudlord 2007-12-15 23:55:21 +00:00
parent 512c68d091
commit e3f1a33834
1 changed files with 14 additions and 20 deletions

View File

@ -82,7 +82,6 @@ private:
void initializeFont();
void InitShader();
void DeInitShader();
void rasterise();
public:
@ -309,8 +308,20 @@ void OpenGLDisplay::clear()
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;
u8 *data = pix + ( theApp.sizeX + 1 ) * 4;
@ -428,23 +439,6 @@ void OpenGLDisplay::rasterise()
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();