mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-19 06:31:26 +02:00
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)
This commit is contained in:
18
SConscript
18
SConscript
@@ -245,24 +245,24 @@ def findLibs(env, conf):
|
||||
if not GetOption('renderer'):
|
||||
#Look for SDL
|
||||
runSdlConfig = platform == "Linux" or compilePlatform == "Linux" or platform == "FreeBSD"
|
||||
if platform == "Darwin" and conf.CheckFramework("SDL"):
|
||||
if False and platform == "Darwin" and conf.CheckFramework("SDL"):
|
||||
runSdlConfig = False
|
||||
elif not conf.CheckLib("SDL"):
|
||||
elif not conf.CheckLib("SDL2"):
|
||||
FatalError("SDL development library not found or not installed")
|
||||
|
||||
if runSdlConfig:
|
||||
try:
|
||||
env.ParseConfig('sdl-config --cflags')
|
||||
env.ParseConfig('sdl2-config --cflags')
|
||||
if GetOption('static'):
|
||||
env.ParseConfig('sdl-config --static-libs')
|
||||
env.ParseConfig('sdl2-config --static-libs')
|
||||
else:
|
||||
env.ParseConfig('sdl-config --libs')
|
||||
env.ParseConfig('sdl2-config --libs')
|
||||
except:
|
||||
pass
|
||||
|
||||
#look for SDL.h
|
||||
if not GetOption('renderer') and not conf.CheckCHeader('SDL.h'):
|
||||
if conf.CheckCHeader('SDL/SDL.h'):
|
||||
if not GetOption('renderer') and not conf.CheckCHeader('SDL2.h'):
|
||||
if conf.CheckCHeader('SDL2/SDL.h'):
|
||||
env.Append(CPPDEFINES=["SDL_INC"])
|
||||
else:
|
||||
FatalError("SDL.h not found")
|
||||
@@ -555,8 +555,8 @@ if platform == "Windows":
|
||||
envCopy = env.Clone()
|
||||
envCopy.Append(CCFLAGS='-mstackrealign')
|
||||
sources += envCopy.Object('src/simulation/Gravity.cpp')
|
||||
elif platform == "Darwin":
|
||||
sources += ["src/SDLMain.m"]
|
||||
#elif platform == "Darwin":
|
||||
# sources += ["src/SDLMain.m"]
|
||||
|
||||
|
||||
#Program output name
|
||||
|
Reference in New Issue
Block a user