diff --git a/cmake/MetalHelper.cmake b/cmake/MetalHelper.cmake index c29c2d2..83ad6d3 100644 --- a/cmake/MetalHelper.cmake +++ b/cmake/MetalHelper.cmake @@ -1,4 +1,4 @@ -include(CMakeParseArguments) # 3.4 and lower compatibility +include(CMakeParseArguments) # 3.4 and lower compatibility function (_xrun_find_program OUTPUT NAME) find_program(XCRUN_EXECUTABLE xcrun REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7850f27..14c9644 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,7 +21,7 @@ function (common_setup _TARGET) if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") get_property(SDL3_IMPORTED_LOCATION TARGET SDL3::SDL3 PROPERTY IMPORTED_LOCATION) if (SDL3_IMPORTED_LOCATION MATCHES "^/Library/Frameworks/") - target_link_options(${_TARGET} PRIVATE -Wl,-rpath,/Library/Frameworks) + set_property(TARGET ${_TARGET} PROPERTY BUILD_RPATH "/Library/Frameworks") endif() endif() endfunction() diff --git a/src/analogue.c b/src/analogue.c index 2272576..7361af1 100644 --- a/src/analogue.c +++ b/src/analogue.c @@ -144,7 +144,7 @@ int SDL_AppEvent(const SDL_Event* event) return 0; case (SDL_EVENT_MOUSE_BUTTON_DOWN): - if (SDL_BUTTON(event->button.button) & (SDL_BUTTON_LMASK | SDL_BUTTON_RMASK)) + if (SDL_BUTTON_MASK(event->button.button) & (SDL_BUTTON_LMASK | SDL_BUTTON_RMASK)) side = (event->button.x > winw / 2) ? 1 : 0; return 0; diff --git a/src/draw.c b/src/draw.c index f30074c..f35a9cb 100644 --- a/src/draw.c +++ b/src/draw.c @@ -1,6 +1,6 @@ #include "draw.h" #include "maths.h" -#include +#include #include @@ -10,8 +10,8 @@ void DrawWindowHints(void) {} int InitDraw(SDL_Window* window) { - const int rendflags = SDL_RENDERER_PRESENTVSYNC; - rend = SDL_CreateRenderer(window, NULL, rendflags); + rend = SDL_CreateRenderer(window, NULL); + SDL_SetRenderVSync(rend, 1); return (rend == NULL) ? -1 : 0; } diff --git a/src/gl/draw_opengl.c b/src/gl/draw_opengl.c index 3845f13..0d5a3ef 100644 --- a/src/gl/draw_opengl.c +++ b/src/gl/draw_opengl.c @@ -1,12 +1,12 @@ #include "draw.h" #include "maths.h" -#include -#include +#include +#include #include #include -static SDL_GLContext* ctx = NULL; +static SDL_GLContext ctx = NULL; static SDL_Window* window = NULL; static uint32_t colour = 0x00000000; static uint32_t clrColour = 0x00000000; @@ -62,7 +62,7 @@ int InitDraw(SDL_Window* w) void QuitDraw(void) { - SDL_GL_DeleteContext(ctx); + SDL_GL_DestroyContext(ctx); ctx = NULL; window = NULL; } diff --git a/src/glcore/draw_opengl_core.c b/src/glcore/draw_opengl_core.c index 4eeb095..25ce18b 100644 --- a/src/glcore/draw_opengl_core.c +++ b/src/glcore/draw_opengl_core.c @@ -2,7 +2,7 @@ #include "glslShaders.h" #include "maths.h" #include -#include +#include #include #include #include @@ -20,7 +20,7 @@ static const char* const attribNames[] = #define OPENGL_VERSION_MAJOR 3 #define OPENGL_VERSION_MINOR 3 -static SDL_GLContext* ctx = NULL; +static SDL_GLContext ctx = NULL; static SDL_Window* window = NULL; static uint32_t colour = 0x00000000, @@ -133,7 +133,7 @@ int InitDraw(SDL_Window* _window) { window = _window; ctx = SDL_GL_CreateContext(window); - if (ctx == NULL || window == NULL || SDL_GL_MakeCurrent(window, ctx)) + if (ctx == NULL || window == NULL || !SDL_GL_MakeCurrent(window, ctx)) { fprintf(stderr, "%s\n", SDL_GetError()); return -1; @@ -259,7 +259,7 @@ void QuitDraw(void) } SDL_GL_MakeCurrent(window, NULL); - SDL_GL_DeleteContext(ctx); + SDL_GL_DestroyContext(ctx); ctx = NULL; window = NULL; }