Do clearscreen and swap, probably won't do debug text nonsense since it looks like trash anyway. maybe later.

This commit is contained in:
Ryan Houdek 2011-08-25 05:20:41 -05:00
parent 31fd25bf61
commit 5a6a2b2bec

View File

@ -888,16 +888,39 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE
glViewport(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight()); glViewport(targetRc.left, targetRc.bottom, targetRc.GetWidth(), targetRc.GetHeight());
glDepthRange(0.0, (float)(z & 0xFFFFFF) / float(0xFFFFFF)); glDepthRange(0.0, (float)(z & 0xFFFFFF) / float(0xFFFFFF));
glColor4f((float)((color >> 16) & 0xFF) / 255.0f, GLfloat vtx1[] = {
(float)((color >> 8) & 0xFF) / 255.0f, -1, -1, 1,
(float)(color & 0xFF) / 255.0f, -1, 1, 1,
(float)((color >> 24) & 0xFF) / 255.0f); 1, 1, 1,
glBegin(GL_QUADS); 1, -1, 1
glVertex3f(-1.f, -1.f, 1.f); };
glVertex3f(-1.f, 1.f, 1.f); GLfloat col1[] = { // This looks terrible
glVertex3f( 1.f, 1.f, 1.f); (float)((color >> 16) & 0xFF) / 255.0f,
glVertex3f( 1.f, -1.f, 1.f); (float)((color >> 8) & 0xFF) / 255.0f,
glEnd(); (float)(color & 0xFF) / 255.0f,
(float)((color >> 24) & 0xFF) / 255.0f,
(float)((color >> 16) & 0xFF) / 255.0f,
(float)((color >> 8) & 0xFF) / 255.0f,
(float)(color & 0xFF) / 255.0f,
(float)((color >> 24) & 0xFF) / 255.0f,
(float)((color >> 16) & 0xFF) / 255.0f,
(float)((color >> 8) & 0xFF) / 255.0f,
(float)(color & 0xFF) / 255.0f,
(float)((color >> 24) & 0xFF) / 255.0f,
(float)((color >> 16) & 0xFF) / 255.0f,
(float)((color >> 8) & 0xFF) / 255.0f,
(float)(color & 0xFF) / 255.0f,
(float)((color >> 24) & 0xFF) / 255.0f
};
glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS); // Only need this to not overwrite the GL_COLOR_ARRAY state
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_FLOAT, 0 ,col1);
glVertexPointer(3, GL_FLOAT, 0, vtx1);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glPopClientAttrib();
RestoreAPIState(); RestoreAPIState();
} }
@ -1115,43 +1138,35 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons
// Render to the real buffer now. // Render to the real buffer now.
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); // switch to the window backbuffer glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); // switch to the window backbuffer
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, read_texture); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, read_texture);
GLfloat vtx1[] = {
-1, -1, 1,
-1, 1, 1,
1, 1, 1,
1, -1, 1
};
GLfloat tex1[] = { // For TEXTURE0
targetRc.left, targetRc.bottom,
targetRc.left, targetRc.top,
targetRc.right, targetRc.top,
targetRc.right, targetRc.bottom
};
glClientActiveTexture(GL_TEXTURE0);
glTexCoordPointer(2, GL_FLOAT, 0, tex1);
if (applyShader) if (applyShader)
{ {
glBegin(GL_QUADS);
glTexCoord2f(targetRc.left, targetRc.bottom);
glMultiTexCoord2fARB(GL_TEXTURE1, 0, 0); glMultiTexCoord2fARB(GL_TEXTURE1, 0, 0);
glVertex2f(-1, -1);
glTexCoord2f(targetRc.left, targetRc.top);
glMultiTexCoord2fARB(GL_TEXTURE1, 0, 1); glMultiTexCoord2fARB(GL_TEXTURE1, 0, 1);
glVertex2f(-1, 1);
glTexCoord2f(targetRc.right, targetRc.top);
glMultiTexCoord2fARB(GL_TEXTURE1, 1, 1); glMultiTexCoord2fARB(GL_TEXTURE1, 1, 1);
glVertex2f( 1, 1);
glTexCoord2f(targetRc.right, targetRc.bottom);
glMultiTexCoord2fARB(GL_TEXTURE1, 1, 0); glMultiTexCoord2fARB(GL_TEXTURE1, 1, 0);
glVertex2f( 1, -1); }
glEnd();
glVertexPointer(3, GL_FLOAT, 0, vtx1);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
if(applyShader)
PixelShaderCache::DisableShader(); PixelShaderCache::DisableShader();
}
else
{
glBegin(GL_QUADS);
glTexCoord2f(targetRc.left, targetRc.bottom);
glVertex2f(-1, -1);
glTexCoord2f(targetRc.left, targetRc.top);
glVertex2f(-1, 1);
glTexCoord2f(targetRc.right, targetRc.top);
glVertex2f( 1, 1);
glTexCoord2f(targetRc.right, targetRc.bottom);
glVertex2f( 1, -1);
glEnd();
}
} }
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 0);