mirror of https://github.com/snes9xgit/snes9x.git
win32: do not overwrite glsl output
This commit is contained in:
parent
9bd9133fbc
commit
3b5ca2397b
|
@ -484,39 +484,37 @@ void COpenGL::Render(SSurface Src)
|
||||||
if(pboFunctionsLoaded)
|
if(pboFunctionsLoaded)
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||||
|
|
||||||
if (shader_type != OGL_SHADER_NONE) {
|
RECT windowSize, displayRect;
|
||||||
|
GetClientRect(hWnd, &windowSize);
|
||||||
|
//Get maximum rect respecting AR setting
|
||||||
|
displayRect = CalculateDisplayRect(windowSize.right, windowSize.bottom, windowSize.right, windowSize.bottom);
|
||||||
|
|
||||||
if(shader_type == OGL_SHADER_GLSL) {
|
if (shader_type == OGL_SHADER_GLSL) {
|
||||||
RECT windowSize, displayRect;
|
glslShader->render(drawTexture, afterRenderWidth, afterRenderHeight, displayRect.right - displayRect.left, displayRect.bottom - displayRect.top, displayRect.left, displayRect.top);
|
||||||
GetClientRect(hWnd, &windowSize);
|
}
|
||||||
displayRect = CalculateDisplayRect(windowSize.right, windowSize.bottom, windowSize.right, windowSize.bottom);
|
else {
|
||||||
glslShader->render(drawTexture, afterRenderWidth, afterRenderHeight, displayRect.right - displayRect.left, displayRect.bottom - displayRect.top, displayRect.left, displayRect.top);
|
if(shader_type == OGL_SHADER_CG) {
|
||||||
} else if(shader_type == OGL_SHADER_CG) {
|
|
||||||
xySize inputSize = { (float)afterRenderWidth, (float)afterRenderHeight };
|
xySize inputSize = { (float)afterRenderWidth, (float)afterRenderHeight };
|
||||||
RECT windowSize, displayRect;
|
|
||||||
GetClientRect(hWnd,&windowSize);
|
|
||||||
xySize xywindowSize = { (double)windowSize.right, (double)windowSize.bottom };
|
xySize xywindowSize = { (double)windowSize.right, (double)windowSize.bottom };
|
||||||
//Get maximum rect respecting AR setting
|
|
||||||
displayRect=CalculateDisplayRect(windowSize.right,windowSize.bottom,windowSize.right,windowSize.bottom);
|
|
||||||
xySize viewportSize = { (double)(displayRect.right - displayRect.left),
|
xySize viewportSize = { (double)(displayRect.right - displayRect.left),
|
||||||
(double)(displayRect.bottom - displayRect.top) };
|
(double)(displayRect.bottom - displayRect.top) };
|
||||||
xySize textureSize = { (double)quadTextureSize, (double)quadTextureSize };
|
xySize textureSize = { (double)quadTextureSize, (double)quadTextureSize };
|
||||||
cgShader->Render(drawTexture, textureSize, inputSize, viewportSize, xywindowSize);
|
cgShader->Render(drawTexture, textureSize, inputSize, viewportSize, xywindowSize);
|
||||||
}
|
}
|
||||||
|
if (Settings.BilinearFilter) {
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
}
|
||||||
|
|
||||||
|
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
glDrawArrays(GL_QUADS, 0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Settings.BilinearFilter) {
|
|
||||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
|
||||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
||||||
} else {
|
|
||||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
|
||||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
|
||||||
}
|
|
||||||
|
|
||||||
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
glDrawArrays (GL_QUADS, 0, 4);
|
|
||||||
|
|
||||||
glFlush();
|
glFlush();
|
||||||
SwapBuffers(hDC);
|
SwapBuffers(hDC);
|
||||||
if (GUI.ReduceInputLag)
|
if (GUI.ReduceInputLag)
|
||||||
|
|
Loading…
Reference in New Issue