Skip to content

Commit

Permalink
Fix broken rendering resolution on window resizing. #398
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Feb 6, 2024
1 parent bbcaeac commit b39b137
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Plugins/Renderer/gl_rmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ void GL_BeginRendering(int *x, int *y, int *width, int *height)
gPrivateFuncs.GL_BeginRendering(x, y, width, height);

//Window resized?
#if 0
#if 1
if ((*width) != glwidth || (*height) != glheight)
{
glx = (*x);
Expand All @@ -1843,6 +1843,7 @@ void GL_BeginRendering(int *x, int *y, int *width, int *height)
glheight = (*height);
}
#endif

//No V_RenderView calls when level changes so don't GL_FlushFinalBuffer, this replicates vanilla engine's behavior
if (SCR_IsLoadingVisible())
{
Expand Down Expand Up @@ -2213,13 +2214,7 @@ void GL_EndRendering(void)
*gl_backbuffer_fbo = 0;
}

int srcW = 0, srcH = 0;

//void (*VideoMode_GetCurrentVideoMode)(int* wide, int* tall, int* bpp);
//VideoMode_GetCurrentVideoMode = (decltype(VideoMode_GetCurrentVideoMode))((PUCHAR)g_dwEngineBase + 0xAEDB0);
//VideoMode_GetCurrentVideoMode(&srcW, &srcH, NULL);

g_pMetaHookAPI->GetVideoMode(&srcW, &srcH, NULL, NULL);
int srcW = s_FinalBufferFBO.iWidth, srcH = s_FinalBufferFBO.iHeight;

int dstX1 = 0;
int dstY1 = 0;
Expand Down

0 comments on commit b39b137

Please sign in to comment.