Skip to content

Commit

Permalink
Fix incorrect use of GLEW_ARB_* macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
gimhael committed Mar 10, 2016
1 parent 895d1f6 commit f12493a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions daemon/src/engine/renderer/gl_shader.cpp
Expand Up @@ -705,7 +705,7 @@ void GLShaderManager::InitShader( GLShader *shader )

bool GLShaderManager::LoadShaderBinary( GLShader *shader, size_t programNum )
{
#ifdef GLEW_ARB_get_program_binary
#ifdef GL_ARB_get_program_binary
GLint success;
const byte *binaryptr;
GLShaderHeader shaderHeader;
Expand Down Expand Up @@ -779,7 +779,7 @@ bool GLShaderManager::LoadShaderBinary( GLShader *shader, size_t programNum )
}
void GLShaderManager::SaveShaderBinary( GLShader *shader, size_t programNum )
{
#ifdef GLEW_ARB_get_program_binary
#ifdef GL_ARB_get_program_binary
GLint binaryLength;
GLuint binarySize = 0;
byte *binary;
Expand Down Expand Up @@ -1008,7 +1008,7 @@ void GLShaderManager::LinkProgram( GLuint program ) const
{
GLint linked;

#ifdef GLEW_ARB_get_program_binary
#ifdef GL_ARB_get_program_binary
// Apparently, this is necessary to get the binary program via glGetProgramBinary
if( glConfig2.getProgramBinaryAvailable )
{
Expand Down
4 changes: 2 additions & 2 deletions daemon/src/engine/renderer/tr_local.h
Expand Up @@ -3312,7 +3312,7 @@ static inline void halfToFloat( const f16vec4_t in, vec4_t out )
i16vec4_t texCoords;
};

#ifdef GLEW_ARB_sync
#ifdef GL_ARB_sync
struct glRingbuffer_t {
// the BO is logically split into DYN_BUFFER_SEGMENTS
// segments, the active segment is the one the CPU may write
Expand Down Expand Up @@ -3375,7 +3375,7 @@ static inline void halfToFloat( const f16vec4_t in, vec4_t out )
shaderVertex_t *vertsBuffer;
glIndex_t *indexesBuffer;

#ifdef GLEW_ARB_sync
#ifdef GL_ARB_sync
glRingbuffer_t vertexRB;
glRingbuffer_t indexRB;
#endif
Expand Down
20 changes: 10 additions & 10 deletions daemon/src/engine/renderer/tr_vbo.cpp
Expand Up @@ -438,7 +438,7 @@ static void R_CopyVertexData( VBO_t *vbo, byte *outData, vboData_t inData )

}

#if defined( GLEW_ARB_buffer_storage ) && defined( GLEW_ARB_sync )
#if defined( GL_ARB_buffer_storage ) && defined( GL_ARB_sync )
/*
============
R_InitRingbuffer
Expand Down Expand Up @@ -541,7 +541,7 @@ VBO_t *R_CreateDynamicVBO( const char *name, int numVertexes, uint32_t stateBits

R_BindVBO( vbo );

#if defined( GLEW_ARB_buffer_storage ) && defined( GLEW_ARB_sync )
#if defined( GL_ARB_buffer_storage ) && defined( GL_ARB_sync )
if( glConfig2.bufferStorageAvailable &&
glConfig2.syncAvailable ) {
R_InitRingbuffer( GL_ARRAY_BUFFER, sizeof( shaderVertex_t ),
Expand Down Expand Up @@ -594,7 +594,7 @@ VBO_t *R_CreateStaticVBO( const char *name, vboData_t data, vboLayout_t layout )
glGenBuffers( 1, &vbo->vertexesVBO );
R_BindVBO( vbo );

#ifdef GLEW_ARB_buffer_storage
#ifdef GL_ARB_buffer_storage
if( glConfig2.bufferStorageAvailable ) {
outData = (byte *)ri.Hunk_AllocateTempMemory( vbo->vertexesSize );
R_CopyVertexData( vbo, outData, data );
Expand Down Expand Up @@ -657,7 +657,7 @@ VBO_t *R_CreateStaticVBO2( const char *name, int numVertexes, shaderVertex_t *ve
glGenBuffers( 1, &vbo->vertexesVBO );
R_BindVBO( vbo );

#ifdef GLEW_ARB_buffer_storage
#ifdef GL_ARB_buffer_storage
if( glConfig2.bufferStorageAvailable ) {
glBufferStorage( GL_ARRAY_BUFFER, vbo->vertexesSize,
verts, 0 );
Expand Down Expand Up @@ -703,7 +703,7 @@ IBO_t *R_CreateDynamicIBO( const char *name, int numIndexes )
glGenBuffers( 1, &ibo->indexesVBO );

R_BindIBO( ibo );
#if defined( GLEW_ARB_buffer_storage ) && defined( GLEW_ARB_sync )
#if defined( GL_ARB_buffer_storage ) && defined( GL_ARB_sync )
if( glConfig2.bufferStorageAvailable &&
glConfig2.syncAvailable ) {
R_InitRingbuffer( GL_ELEMENT_ARRAY_BUFFER, sizeof( glIndex_t ),
Expand Down Expand Up @@ -754,7 +754,7 @@ IBO_t *R_CreateStaticIBO( const char *name, glIndex_t *indexes, int numIndexes )

R_BindIBO( ibo );

#ifdef GLEW_ARB_buffer_storage
#ifdef GL_ARB_buffer_storage
if( glConfig2.bufferStorageAvailable ) {
glBufferStorage( GL_ELEMENT_ARRAY_BUFFER, ibo->indexesSize, indexes, 0 );
} else
Expand Down Expand Up @@ -796,7 +796,7 @@ IBO_t *R_CreateStaticIBO2( const char *name, int numTriangles, glIndex_t *indexe
glGenBuffers( 1, &ibo->indexesVBO );
R_BindIBO( ibo );

#ifdef GLEW_ARB_buffer_storage
#ifdef GL_ARB_buffer_storage
if( glConfig2.bufferStorageAvailable ) {
glBufferStorage( GL_ELEMENT_ARRAY_BUFFER, ibo->indexesSize,
indexes, 0 );
Expand Down Expand Up @@ -1049,7 +1049,7 @@ void R_ShutdownVBOs()
if( !glConfig2.mapBufferRangeAvailable ) {
// nothing
}
#if defined( GLEW_ARB_buffer_storage ) && defined( GLEW_ARB_sync )
#if defined( GL_ARB_buffer_storage ) && defined( GL_ARB_sync )
else if( glConfig2.bufferStorageAvailable &&
glConfig2.syncAvailable ) {
R_BindVBO( tess.vbo );
Expand Down Expand Up @@ -1129,7 +1129,7 @@ void Tess_MapVBOs( bool forceCPU ) {
if( tess.verts == nullptr ) {
R_BindVBO( tess.vbo );

#if defined( GLEW_ARB_buffer_storage ) && defined( GL_ARB_sync )
#if defined( GL_ARB_buffer_storage ) && defined( GL_ARB_sync )
if( glConfig2.bufferStorageAvailable &&
glConfig2.syncAvailable ) {
GLsizei segmentEnd = (tess.vertexRB.activeSegment + 1) * tess.vertexRB.segmentElements;
Expand All @@ -1156,7 +1156,7 @@ void Tess_MapVBOs( bool forceCPU ) {
if( tess.indexes == nullptr ) {
R_BindIBO( tess.ibo );

#if defined( GLEW_ARB_buffer_storage ) && defined( GL_ARB_sync )
#if defined( GL_ARB_buffer_storage ) && defined( GL_ARB_sync )
if( glConfig2.bufferStorageAvailable &&
glConfig2.syncAvailable ) {
GLsizei segmentEnd = (tess.indexRB.activeSegment + 1) * tess.indexRB.segmentElements;
Expand Down
4 changes: 2 additions & 2 deletions daemon/src/engine/sys/sdl_glimp.cpp
Expand Up @@ -1105,7 +1105,7 @@ static void GLimp_InitExtensions()
glConfig2.drawBuffersAvailable = true;
}

#ifdef GLEW_ARB_get_program_binary
#ifdef GL_ARB_get_program_binary
if( GLEW_ARB_get_program_binary )
{
int formats = 0;
Expand All @@ -1130,7 +1130,7 @@ static void GLimp_InitExtensions()
glConfig2.getProgramBinaryAvailable = false;
}

#ifdef GLEW_ARB_buffer_storage
#ifdef GL_ARB_buffer_storage
if ( GLEW_ARB_buffer_storage )
{
if ( r_arb_buffer_storage->integer )
Expand Down

0 comments on commit f12493a

Please sign in to comment.