Make screen refresh more snappy on macOS
This commit is contained in:
parent
81dc7593da
commit
c1b2811bbf
3 changed files with 23 additions and 6 deletions
|
|
@ -6,6 +6,12 @@ Copyright (c) 2002-2024
|
||||||
Various contributors (see below, and AUTHORS.txt)
|
Various contributors (see below, and AUTHORS.txt)
|
||||||
https://tuxpaint.org/
|
https://tuxpaint.org/
|
||||||
|
|
||||||
|
2024.February.3 (0.9.33)
|
||||||
|
* Other Improvements:
|
||||||
|
-------------------
|
||||||
|
* Make screen refresh more snappy on macOS.
|
||||||
|
Mark Kim <markuskimius@gmail.com>
|
||||||
|
|
||||||
2024.January.29 (0.9.32)
|
2024.January.29 (0.9.32)
|
||||||
* Improvements to Magic tools:
|
* Improvements to Magic tools:
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
|
||||||
11
src/macos.h
11
src/macos.h
|
|
@ -37,4 +37,15 @@ const char *apple_picturesPath(void);
|
||||||
int apple_trash(const char *path);
|
int apple_trash(const char *path);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* It's unclear why we need this on macOS, but the SDL2 library on the Mac
|
||||||
|
* appears to require an extra flip during a delay without which the flip does
|
||||||
|
* occur but not until the next click or after much time passes.
|
||||||
|
*/
|
||||||
|
#define SDL_Delay(n) do { \
|
||||||
|
SDL_Flip(screen); \
|
||||||
|
SDL_Delay(n); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
|
||||||
#endif /* __MACOS_H__ */
|
#endif /* __MACOS_H__ */
|
||||||
|
|
|
||||||
|
|
@ -403,18 +403,18 @@ int iswprint(wchar_t wc)
|
||||||
|
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
|
|
||||||
#if defined(__MACOS__)
|
|
||||||
#include "macos.h"
|
|
||||||
#elif defined(__IOS__)
|
|
||||||
#include "ios.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include "SDL2/SDL.h"
|
#include "SDL2/SDL.h"
|
||||||
#include "SDL2/SDL_thread.h"
|
#include "SDL2/SDL_thread.h"
|
||||||
|
|
||||||
|
#if defined(__MACOS__)
|
||||||
|
#include "macos.h"
|
||||||
|
#elif defined(__IOS__)
|
||||||
|
#include "ios.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(_SDL_H) && !defined(SDL_h_)
|
#if !defined(_SDL_H) && !defined(SDL_h_)
|
||||||
#error "---------------------------------------------------"
|
#error "---------------------------------------------------"
|
||||||
#error "If you installed SDL from a package, be sure to get"
|
#error "If you installed SDL from a package, be sure to get"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue