win32: do not overwrite glsl output

This commit is contained in:
OV2 2018-05-21 20:39:11 +02:00
parent 9bd9133fbc
commit 3b5ca2397b
1 changed files with 21 additions and 23 deletions

View File

@ -484,39 +484,37 @@ void COpenGL::Render(SSurface Src)
if(pboFunctionsLoaded)
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) {
RECT windowSize, displayRect;
GetClientRect(hWnd, &windowSize);
displayRect = CalculateDisplayRect(windowSize.right, windowSize.bottom, windowSize.right, windowSize.bottom);
glslShader->render(drawTexture, afterRenderWidth, afterRenderHeight, displayRect.right - displayRect.left, displayRect.bottom - displayRect.top, displayRect.left, displayRect.top);
} else if(shader_type == OGL_SHADER_CG) {
if (shader_type == OGL_SHADER_GLSL) {
glslShader->render(drawTexture, afterRenderWidth, afterRenderHeight, displayRect.right - displayRect.left, displayRect.bottom - displayRect.top, displayRect.left, displayRect.top);
}
else {
if(shader_type == OGL_SHADER_CG) {
xySize inputSize = { (float)afterRenderWidth, (float)afterRenderHeight };
RECT windowSize, displayRect;
GetClientRect(hWnd,&windowSize);
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),
(double)(displayRect.bottom - displayRect.top) };
xySize textureSize = { (double)quadTextureSize, (double)quadTextureSize };
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();
SwapBuffers(hDC);
if (GUI.ReduceInputLag)