Fix switching from the different rasterizers
This commit is contained in:
parent
ff9ba67773
commit
621204f3e8
|
@ -75,22 +75,7 @@ void CreateShaders()
|
|||
attr_pos = glGetAttribLocation(program, "pos");
|
||||
attr_tex = glGetAttribLocation(program, "TexCoordIn");
|
||||
|
||||
static const GLfloat verts[4][2] = {
|
||||
{ -1, -1}, // Left top
|
||||
{ -1, 1}, // left bottom
|
||||
{ 1, 1}, // right bottom
|
||||
{ 1, -1} // right top
|
||||
};
|
||||
static const GLfloat texverts[4][2] = {
|
||||
{0, 1},
|
||||
{0, 0},
|
||||
{1, 0},
|
||||
{1, 1}
|
||||
};
|
||||
|
||||
glUniform1i(uni_tex, 0);
|
||||
glVertexAttribPointer(attr_pos, 2, GL_FLOAT, GL_FALSE, 0, verts);
|
||||
glVertexAttribPointer(attr_tex, 2, GL_FLOAT, GL_FALSE, 0, texverts);
|
||||
}
|
||||
|
||||
void SWRenderer::Prepare()
|
||||
|
@ -165,8 +150,25 @@ void SWRenderer::DrawTexture(u8 *texture, int width, int height)
|
|||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
|
||||
glUseProgram(program);
|
||||
static const GLfloat verts[4][2] = {
|
||||
{ -1, -1}, // Left top
|
||||
{ -1, 1}, // left bottom
|
||||
{ 1, 1}, // right bottom
|
||||
{ 1, -1} // right top
|
||||
};
|
||||
static const GLfloat texverts[4][2] = {
|
||||
{0, 1},
|
||||
{0, 0},
|
||||
{1, 0},
|
||||
{1, 1}
|
||||
};
|
||||
|
||||
glVertexAttribPointer(attr_pos, 2, GL_FLOAT, GL_FALSE, 0, verts);
|
||||
glVertexAttribPointer(attr_tex, 2, GL_FLOAT, GL_FALSE, 0, texverts);
|
||||
glEnableVertexAttribArray(attr_pos);
|
||||
glEnableVertexAttribArray(attr_tex);
|
||||
glUniform1i(uni_tex, 0);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||
glDisableVertexAttribArray(attr_pos);
|
||||
|
|
|
@ -86,9 +86,7 @@ bool VideoSoftware::Initialize(void *&window_handle)
|
|||
OpcodeDecoder::Init();
|
||||
Clipper::Init();
|
||||
Rasterizer::Init();
|
||||
if (g_SWVideoConfig.bHwRasterizer)
|
||||
HwRasterizer::Init();
|
||||
else
|
||||
SWRenderer::Init();
|
||||
DebugUtil::Init();
|
||||
|
||||
|
@ -134,9 +132,7 @@ void VideoSoftware::EmuStateChange(EMUSTATE_CHANGE newState)
|
|||
|
||||
void VideoSoftware::Shutdown()
|
||||
{
|
||||
if (g_SWVideoConfig.bHwRasterizer)
|
||||
HwRasterizer::Shutdown();
|
||||
else
|
||||
SWRenderer::Shutdown();
|
||||
GLInterface->Shutdown();
|
||||
}
|
||||
|
@ -168,9 +164,7 @@ void VideoSoftware::Video_Prepare()
|
|||
#endif
|
||||
}
|
||||
|
||||
if (g_SWVideoConfig.bHwRasterizer)
|
||||
HwRasterizer::Prepare();
|
||||
else
|
||||
SWRenderer::Prepare();
|
||||
|
||||
INFO_LOG(VIDEO, "Video backend initialized.");
|
||||
|
|
Loading…
Reference in New Issue