Skip to content

Commit 45f43df

Browse files
committed
OpenGL2: Allow fast resize if not using FBOs
Implement ResizeWindow for cl_flexibleDisplay. It allows immediate resizing if using r_ext_framebuffer_object 0. Otherwise it falls back to vid_restart.
1 parent eadd5ba commit 45f43df

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

code/renderergl2/tr_init.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,24 @@ void RE_EndRegistration( void ) {
16521652
}
16531653

16541654

1655+
#ifdef USE_FLEXIBLE_DISPLAY
1656+
/*
1657+
=============
1658+
RE_ResizeWindow
1659+
=============
1660+
*/
1661+
qboolean RE_ResizeWindow( int width, int height ) {
1662+
if ( glRefConfig.framebufferObject ) {
1663+
// TODO: Resize all screen-sized FBOs and attached images
1664+
// instead of returning qfalse which runs vid_restart.
1665+
return qfalse;
1666+
}
1667+
1668+
return GLimp_ResizeWindow( width, height );
1669+
}
1670+
#endif
1671+
1672+
16551673
/*
16561674
@@@@@@@@@@@@@@@@@@@@@
16571675
GetRefAPI
@@ -1717,8 +1735,7 @@ refexport_t *GetRefAPI ( int apiVersion, refimport_t *rimp ) {
17171735
re.TakeVideoFrame = RE_TakeVideoFrame;
17181736

17191737
#ifdef USE_FLEXIBLE_DISPLAY
1720-
// TODO: This needs to resize all screen-sized FBOs and attached images.
1721-
re.ResizeWindow = NULL; //GLimp_ResizeWindow;#endif
1738+
re.ResizeWindow = RE_ResizeWindow;
17221739
#endif
17231740

17241741
return &re;

0 commit comments

Comments
 (0)