Skip to content

Commit

Permalink
Switch fully to SDL3-style SDL_CreateWindow.
Browse files Browse the repository at this point in the history
  • Loading branch information
AliceLR committed Nov 5, 2024
1 parent 1568074 commit 26217b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
5 changes: 5 additions & 0 deletions src/SDLmzx.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ static inline int replace_SDL_GetVersion(void)
#endif
#if !SDL_VERSION_ATLEAST(3,0,0)
#define SDL_GL_DestroyContext(gl) SDL_GL_DeleteContext(gl)

/* SDL3 removed the coordinate arguments to SDL_CreateWindow.
* Windows are created centered by default instead. */
#define SDL_CreateWindow(title, w, h, flags) SDL_CreateWindow((title), \
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, (w), (h), (flags))
#endif

#endif /* CONFIG_SDL */
Expand Down
12 changes: 0 additions & 12 deletions src/render_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,6 @@ boolean sdl_create_window_soft(struct graphics_data *graphics,
#endif

render_data->window = SDL_CreateWindow("MegaZeux",
// FIXME:
#if !SDL_VERSION_ATLEAST(3,0,0)
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
#endif
window->width_px, window->height_px, sdl_flags(window));

if(!render_data->window)
Expand Down Expand Up @@ -1096,10 +1092,6 @@ boolean sdl_create_window_renderer(struct graphics_data *graphics,
}

render_data->window = SDL_CreateWindow("MegaZeux",
// FIXME:
#if !SDL_VERSION_ATLEAST(3,0,0)
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
#endif
window->width_px, window->height_px, sdl_flags(window));

if(!render_data->window)
Expand Down Expand Up @@ -1240,10 +1232,6 @@ boolean gl_create_window(struct graphics_data *graphics,
#endif

render_data->window = SDL_CreateWindow("MegaZeux",
// FIXME:
#if !SDL_VERSION_ATLEAST(3,0,0)
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
#endif
window->width_px, window->height_px, GL_STRIP_FLAGS(sdl_flags(window)));

if(!render_data->window)
Expand Down

0 comments on commit 26217b9

Please sign in to comment.