Fixes 01 (#26)

Fix #25 
Fix replay mover colors
Update README
Added unit test for CCD move events
Avoid Linux crash when OpenGL 4.5 is not present
This commit is contained in:
Erin Catto 2026-07-01 23:19:23 -07:00 • committed by GitHub
commit 1c5ac42c37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 126 additions and 150 deletions

View file

@ -451,6 +451,25 @@ static void OnCleanup( void )
exit( errors == 0 ? 0 : 1 );
}
static void OnAppLog( const char* tag, uint32_t logLevel, uint32_t logItemId, const char* message, uint32_t lineNumber,
const char* filename, void* userData )
{
(void)tag;
(void)logItemId;
(void)filename;
(void)userData;
(void)lineNumber;
const char* level = ( logLevel == 0 ) ? "panic" : ( logLevel == 1 ) ? "error" : ( logLevel == 2 ) ? "warn" : "info";
fprintf( stderr, "sokol(level %s) %s\n", level, message ? message : "(no message)" );
if ( logLevel == 0 )
{
fprintf( stderr, "Ensure you have OpenGL 4.5 if on Linux" );
exit( 1 );
}
}
sapp_desc sokol_main( int argc, char** argv )
{
for ( int i = 1; i < argc; ++i )
@ -470,6 +489,7 @@ sapp_desc sokol_main( int argc, char** argv )
desc.frame_cb = OnFrame;
desc.event_cb = OnEvent;
desc.cleanup_cb = OnCleanup;
desc.logger.func = OnAppLog;
// GL 4.5 for glClipControl (reverse-Z). Ignored on D3D11 / Metal.
desc.gl.major_version = 4;