Skip to content

Commit

Permalink
Fix backEnd.currentVAO
Browse files Browse the repository at this point in the history
This was previously getting reset in `R_Init()`, so it was always 0 after a map was loaded. This also meant that the call to `glDeleteVertexArrays()`  in `RE_Shutdown()` was silently erroring out if a map was loaded (or `vid_restart` used).
  • Loading branch information
VReaperV committed Jan 22, 2025
1 parent 05dba78 commit f7abc30
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/engine/renderer/tr_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
return false;
}

if( glConfig2.glCoreProfile ) {
glGenVertexArrays( 1, &backEnd.currentVAO );
glBindVertexArray( backEnd.currentVAO );
}

glState.tileStep[ 0 ] = TILE_SIZE * ( 1.0f / glConfig.vidWidth );
glState.tileStep[ 1 ] = TILE_SIZE * ( 1.0f / glConfig.vidHeight );

Expand Down Expand Up @@ -381,6 +376,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
GLSL_InitGPUShaders();
}

if ( glConfig2.glCoreProfile ) {
glGenVertexArrays( 1, &backEnd.currentVAO );
glBindVertexArray( backEnd.currentVAO );
}

GL_CheckErrors();

// set default state
Expand Down

0 comments on commit f7abc30

Please sign in to comment.