Skip to content

Commit

Permalink
ref_gl: init r_temppool before InitExtensions, fix extension string a…
Browse files Browse the repository at this point in the history
…llocation
  • Loading branch information
mittorn committed Oct 12, 2023
1 parent d933d19 commit b59f00d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ref/gl/gl_opengl.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ void GL_InitExtensions( void )
char *str;
for(i = 0; i < n; i++)
len += Q_strlen((const char*)pglGetStringi(GL_EXTENSIONS, i)) + 1;
str = (char*)Mem_Calloc( 1, len );
str = (char*)Mem_Calloc( r_temppool, len );
glConfig.extensions_string = str;
for(i = 0; i < n; i++)
{
Expand Down Expand Up @@ -1163,18 +1163,19 @@ qboolean R_Init( void )

GL_SetDefaultState();

r_temppool = Mem_AllocPool( "Render Zone" );

// create the window and set up the context
if( !gEngfuncs.R_Init_Video( REF_GL )) // request GL context
{
GL_RemoveCommands();
gEngfuncs.R_Free_Video();
// Why? Host_Error again???
// gEngfuncs.Host_Error( "Can't initialize video subsystem\nProbably driver was not installed" );
Mem_FreePool( &r_temppool );
return false;
}

r_temppool = Mem_AllocPool( "Render Zone" );

GL_SetDefaults();
R_CheckVBO();
R_InitImages();
Expand Down

0 comments on commit b59f00d

Please sign in to comment.