Skip to content

Commit

Permalink
Fix OpenGL 3 Core Profile vertex buffers on macOS (fixes ecode consol…
Browse files Browse the repository at this point in the history
…e rendering when using 3 CP). Disable OpenGL 3 renderer on macOS.
  • Loading branch information
SpartanJ committed Mar 6, 2025
1 parent 5923fd5 commit 48dbeda
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/eepp/graphics/renderer/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ std::vector<GraphicsLibraryVersion> Renderer::getAvailableGraphicsLibraryVersion
vers.emplace_back( GLv_2 );
#endif
#ifdef EE_GL3_ENABLED
#if EE_PLATFORM != EE_PLATFORM_MACOS
vers.emplace_back( GLv_3 );
#endif
vers.emplace_back( GLv_3CP );
vers.emplace_back( GLv_ES2 );
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/eepp/graphics/renderer/renderergl3cp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void RendererGL3CP::texCoordPointer( int size, unsigned int type, int stride, co
}

int RendererGL3CP::getStateIndex( const Uint32& State ) {
eeASSERT( State < EEGL_ARRAY_STATES_COUNT );
eeASSERT( State < EEGL_ARRAY_STATES_COUNT || State == EEGL_TEXTURE_COORD_ARRAY );

if ( EEGL_TEXTURE_COORD_ARRAY == State )
return mTextureUnits[mCurActiveTex];
Expand Down
2 changes: 1 addition & 1 deletion src/eepp/graphics/vertexbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace EE { namespace Graphics {
VertexBuffer* VertexBuffer::New( const Uint32& vertexFlags, PrimitiveType drawType,
const Int32& reserveVertexSize, const Int32& reserveIndexSize,
VertexBufferUsageType usageType ) {
if ( GLi->isExtension( EEGL_ARB_vertex_buffer_object ) )
if ( GLi->isExtension( EEGL_ARB_vertex_buffer_object ) || GLi->version() == GLv_3CP )
return eeNew( VertexBufferVBO,
( vertexFlags, drawType, reserveVertexSize, reserveIndexSize, usageType ) );

Expand Down

0 comments on commit 48dbeda

Please sign in to comment.