From fe421727d0c406ef3b05be4ea2eee9cf248bbf3c Mon Sep 17 00:00:00 2001 From: shweet Date: Thu, 29 Aug 2024 23:11:52 -0400 Subject: [PATCH] fix clown vomit by fixing opengl version --- CMakeLists.txt | 2 +- include/jsw_rand.c | 4 ++-- src/engine/sdl.c | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a22dfe8..895147f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ file(GLOB src add_executable(${PROJECT_NAME} ${src}) -set (CMAKE_C_FLAGS "-O2 -Wall -Wextra -pedantic -Wno-unused-variable -Wno-unused-parameter -Wno-discarded-qualifiers") +set (CMAKE_C_FLAGS "-O2 -Wall -Wextra -pedantic -Wno-unused-variable -Wno-unused-parameter -Wno-discarded-qualifiers -Wno-parantheses") if (EMSCRIPTEN) set(CMAKE_EXECUTABLE_SUFFIX ".html") diff --git a/include/jsw_rand.c b/include/jsw_rand.c index 19818b1..e36fb30 100644 --- a/include/jsw_rand.c +++ b/include/jsw_rand.c @@ -39,12 +39,12 @@ unsigned long jsw_rand ( void ) next = 0; for ( i = 0; i < N - 1; i++ ) { - y = ( x[i] & U ) | x[i + 1] & L; + y = ( x[i] & U ) | (x[i + 1] & L); a = ( y & 0x1UL ) ? A : 0x0UL; x[i] = x[( i + M ) % N] ^ ( y >> 1 ) ^ a; } - y = ( x[N - 1] & U ) | x[0] & L; + y = ( x[N - 1] & U ) | (x[0] & L); a = ( y & 0x1UL ) ? A : 0x0UL; x[N - 1] = x[M - 1] ^ ( y >> 1 ) ^ a; } diff --git a/src/engine/sdl.c b/src/engine/sdl.c index efcc9b9..e3f9131 100644 --- a/src/engine/sdl.c +++ b/src/engine/sdl.c @@ -44,9 +44,15 @@ sdl_init(void) else printf(STRING_SDL_MIXER_INIT); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); + + /* SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); - + */ + SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);