Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Set shader again after displaying OSD
Some titles like Resident Evil 2/Biohazard 2 display a cutscene and the shader
is only set for the first frame. The next frames just expect that the old
shader is still set.

The OSD workaround only disabled the shader program before and expected that
the next frame automatically sets it again. This assumption was wrong and
instead the program has to be reassigned again to the current rendering
context when the renderCallback for the OSD was called.
  • Loading branch information
ecsv committed Dec 15, 2013
1 parent 977e839 commit 1e1d1f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Glitch64/glitchmain.cpp
Expand Up @@ -1661,11 +1661,17 @@ grBufferClear( GrColor_t color, GrAlpha_t alpha, FxU32 depth )
FX_ENTRY void FX_CALL
grBufferSwap( FxU32 swap_interval )
{
GLuint program;

glFinish();
glUseProgramObjectARB(0);
// printf("rendercallback is %p\n", renderCallback);
if(renderCallback)
if(renderCallback) {
glGetIntegerv(GL_CURRENT_PROGRAM, (GLint*) &program);
glUseProgramObjectARB(0);
(*renderCallback)(1);
if (program)
glUseProgramObjectARB(program);
}
int i;
LOG("grBufferSwap(%d)\r\n", swap_interval);
//printf("swap\n");
Expand Down

0 comments on commit 1e1d1f9

Please sign in to comment.