Skip to content

Commit e5230b5

Browse files
committed
upgrade to SDL 2
Still currently in process, there are some issues: Windows version doesn't work, mac version might not work, opengl might not work Icon doesn't work (on Linux at least) Lua will need some changes, there are some sdl 1.2 hacks in there When entering fullscreen, the window loses focus When holding down mouse out of bounds, mouse move events stop being sent When letting go of mouse out of bounds, mouseup event doesn't take into account double scale mode Clicking on startup without moving mouse will draw at 0,0 for a frame Renderer probably won't compile because USE_SDL doesn't entirely work ... and maybe others Some nice things were done though: no more blit2, sdl can do the scaling itself 3d effect removed, no reason to support this joke any longer No need to support copy/paste ourselves, sdl does it now text handling done much better now, separate events for key presses and text input when a new window is shown, all events ignored until next tick (ignore textinput event if window shown from key press event like console)
1 parent 38fac70 commit e5230b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+367
-932
lines changed

SConscript

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,24 +245,24 @@ def findLibs(env, conf):
245245
if not GetOption('renderer'):
246246
#Look for SDL
247247
runSdlConfig = platform == "Linux" or compilePlatform == "Linux" or platform == "FreeBSD"
248-
if platform == "Darwin" and conf.CheckFramework("SDL"):
248+
if False and platform == "Darwin" and conf.CheckFramework("SDL"):
249249
runSdlConfig = False
250-
elif not conf.CheckLib("SDL"):
250+
elif not conf.CheckLib("SDL2"):
251251
FatalError("SDL development library not found or not installed")
252252

253253
if runSdlConfig:
254254
try:
255-
env.ParseConfig('sdl-config --cflags')
255+
env.ParseConfig('sdl2-config --cflags')
256256
if GetOption('static'):
257-
env.ParseConfig('sdl-config --static-libs')
257+
env.ParseConfig('sdl2-config --static-libs')
258258
else:
259-
env.ParseConfig('sdl-config --libs')
259+
env.ParseConfig('sdl2-config --libs')
260260
except:
261261
pass
262262

263263
#look for SDL.h
264-
if not GetOption('renderer') and not conf.CheckCHeader('SDL.h'):
265-
if conf.CheckCHeader('SDL/SDL.h'):
264+
if not GetOption('renderer') and not conf.CheckCHeader('SDL2.h'):
265+
if conf.CheckCHeader('SDL2/SDL.h'):
266266
env.Append(CPPDEFINES=["SDL_INC"])
267267
else:
268268
FatalError("SDL.h not found")
@@ -555,8 +555,8 @@ if platform == "Windows":
555555
envCopy = env.Clone()
556556
envCopy.Append(CCFLAGS='-mstackrealign')
557557
sources += envCopy.Object('src/simulation/Gravity.cpp')
558-
elif platform == "Darwin":
559-
sources += ["src/SDLMain.m"]
558+
#elif platform == "Darwin":
559+
# sources += ["src/SDLMain.m"]
560560

561561

562562
#Program output name

src/PowderToy.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ void ClipboardPush(ByteString text);
55
ByteString ClipboardPull();
66
int GetModifiers();
77
bool LoadWindowPosition(int scale);
8-
void SetCursorEnabled(int enabled);
98
unsigned int GetTicks();

0 commit comments

Comments
 (0)