Permalink
Browse files

Create and bind a VAO in a core context.

  • Loading branch information...
1 parent 0a964a2 commit eff03d60b3d95f5e9e5cf51f08583e0e6ba72775 @gimhael gimhael committed Mar 8, 2016
Showing with 11 additions and 0 deletions.
  1. +10 −0 daemon/src/engine/renderer/tr_init.cpp
  2. +1 −0 daemon/src/engine/renderer/tr_local.h
@@ -312,6 +312,11 @@ 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 );
@@ -1536,6 +1541,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#if defined( GLSL_COMPILE_STARTUP_ONLY )
GLSL_ShutdownGPUShaders();
#endif
+ if( glConfig2.glCoreProfile ) {
+ glBindVertexArray( 0 );
+ glDeleteVertexArrays( 1, &backEnd.currentVAO );
+ }
+
GLimp_Shutdown();
ri.Tag_Free();
}
@@ -2538,6 +2538,7 @@ static inline void halfToFloat( const f16vec4_t in, vec4_t out )
bool vertexes2D; // shader needs to be finished
trRefEntity_t entity2D; // currentEntity will point at this when doing 2D rendering
int currentMainFBO;
+ GLuint currentVAO;
};
struct visTest_t

0 comments on commit eff03d6

Please sign in to comment.