diff options
author | Jelle Raaijmakers <jelle@gmta.nl> | 2022-05-09 01:01:01 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-05-09 21:18:21 +0200 |
commit | fa77e6b289e52714011dde32c671922183975871 (patch) | |
tree | edf28c764b0739b487d45a0eff2ccf21fe5518ec | |
parent | 37bbfc1b3811e2c547a768bc8b17282786aac234 (diff) | |
download | serenity-fa77e6b289e52714011dde32c671922183975871.zip |
Ports: Convert GLTron patches to new format
-rwxr-xr-x | Meta/lint-ports.py | 1 | ||||
-rw-r--r-- | Ports/gltron/patches/0001-Build-Allow-CFLAGS-env-var-to-be-set.patch | 25 | ||||
-rw-r--r-- | Ports/gltron/patches/0002-Build-Replace-lGL-with-lgl-to-reference-our-LibGL.patch | 34 | ||||
-rw-r--r-- | Ports/gltron/patches/0003-Build-Remove-ansi-build-argument.patch | 39 | ||||
-rw-r--r-- | Ports/gltron/patches/0004-Build-Fix-char-vs.-const-char-arguments.patch | 31 | ||||
-rw-r--r-- | Ports/gltron/patches/0005-Scripting-Fix-default-keybindings.patch (renamed from Ports/gltron/patches/scripts_config_lua.patch) | 21 | ||||
-rw-r--r-- | Ports/gltron/patches/0006-SDL-Convert-SDL1-to-SDL2.patch | 113 | ||||
-rw-r--r-- | Ports/gltron/patches/ReadMe.md | 35 | ||||
-rw-r--r-- | Ports/gltron/patches/configure.patch | 29 | ||||
-rw-r--r-- | Ports/gltron/patches/game_init_sdl_c.patch | 10 | ||||
-rw-r--r-- | Ports/gltron/patches/lua_makefile_in.patch | 22 | ||||
-rw-r--r-- | Ports/gltron/patches/nebu_input_system_c.patch | 25 | ||||
-rw-r--r-- | Ports/gltron/patches/nebu_scripting_h.patch | 15 | ||||
-rw-r--r-- | Ports/gltron/patches/nebu_video_system_c.patch | 63 |
14 files changed, 295 insertions, 168 deletions
diff --git a/Meta/lint-ports.py b/Meta/lint-ports.py index 6921cd467f..cb1ee5836d 100755 --- a/Meta/lint-ports.py +++ b/Meta/lint-ports.py @@ -52,7 +52,6 @@ PORTS_MISSING_DESCRIPTIONS = { 'genemu', 'gettext', 'git', - 'gltron', 'gmp', 'gnucobol', 'gnupg', diff --git a/Ports/gltron/patches/0001-Build-Allow-CFLAGS-env-var-to-be-set.patch b/Ports/gltron/patches/0001-Build-Allow-CFLAGS-env-var-to-be-set.patch new file mode 100644 index 0000000000..58fd06e0b8 --- /dev/null +++ b/Ports/gltron/patches/0001-Build-Allow-CFLAGS-env-var-to-be-set.patch @@ -0,0 +1,25 @@ +From 94e90c97566a73cb03c4837d53a4cddf452e42bf Mon Sep 17 00:00:00 2001 +From: Jelle Raaijmakers <jelle@gmta.nl> +Date: Mon, 9 May 2022 00:29:43 +0200 +Subject: [PATCH 1/6] Build: Allow `CFLAGS` env var to be set + +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index 226d00e..05ebf5d 100755 +--- a/configure ++++ b/configure +@@ -2805,7 +2805,7 @@ else + RANLIB="$ac_cv_prog_RANLIB" + fi + +-CFLAGS="-DSEPARATOR=\"'/'\"" ++CFLAGS="$CFLAGS -DSEPARATOR=\"'/'\"" + + # Check whether --enable-warn or --disable-warn was given. + if test "${enable_warn+set}" = set; then +-- +2.34.1 + diff --git a/Ports/gltron/patches/0002-Build-Replace-lGL-with-lgl-to-reference-our-LibGL.patch b/Ports/gltron/patches/0002-Build-Replace-lGL-with-lgl-to-reference-our-LibGL.patch new file mode 100644 index 0000000000..888d29e9f5 --- /dev/null +++ b/Ports/gltron/patches/0002-Build-Replace-lGL-with-lgl-to-reference-our-LibGL.patch @@ -0,0 +1,34 @@ +From dd42cfe84e75619676a06b05f8ebe1c1c2e658c9 Mon Sep 17 00:00:00 2001 +From: Jelle Raaijmakers <jelle@gmta.nl> +Date: Mon, 9 May 2022 00:30:04 +0200 +Subject: [PATCH 2/6] Build: Replace `-lGL` with `-lgl` to reference our LibGL + +--- + configure | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 05ebf5d..10f771f 100755 +--- a/configure ++++ b/configure +@@ -3130,7 +3130,7 @@ if test "${ac_cv_lib_GL_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lGL $LIBS" ++LIBS="-lgl $LIBS" + cat >conftest.$ac_ext <<_ACEOF + #line 3135 "configure" + #include "confdefs.h" +@@ -3171,7 +3171,7 @@ if test $ac_cv_lib_GL_main = yes; then + #define HAVE_LIBGL 1 + EOF + +- LIBS="-lGL $LIBS" ++ LIBS="-lgl $LIBS" + + else + { { echo "$as_me:3177: error: OpenGL is not installed" >&5 +-- +2.34.1 + diff --git a/Ports/gltron/patches/0003-Build-Remove-ansi-build-argument.patch b/Ports/gltron/patches/0003-Build-Remove-ansi-build-argument.patch new file mode 100644 index 0000000000..971b01844b --- /dev/null +++ b/Ports/gltron/patches/0003-Build-Remove-ansi-build-argument.patch @@ -0,0 +1,39 @@ +From b01d5c00dd0dbe9512857e32ffd0822bdfb8a9e3 Mon Sep 17 00:00:00 2001 +From: Jelle Raaijmakers <jelle@gmta.nl> +Date: Mon, 9 May 2022 00:30:54 +0200 +Subject: [PATCH 3/6] Build: Remove `-ansi` build argument + +--- + lua/src/Makefile.in | 2 +- + lua/src/lib/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lua/src/Makefile.in b/lua/src/Makefile.in +index 22ee463..fa110ef 100644 +--- a/lua/src/Makefile.in ++++ b/lua/src/Makefile.in +@@ -84,7 +84,7 @@ noinst_LIBRARIES = liblua.a + + DEFS = + AM_CPPFLAGS = +-AM_CFLAGS = -ansi -pedantic -Wall -I$(srcdir) -I$(top_srcdir)/lua/include ++AM_CFLAGS = -pedantic -Wall -I$(srcdir) -I$(top_srcdir)/lua/include + LDFLAGS = + LIBS = -lm + +diff --git a/lua/src/lib/Makefile.in b/lua/src/lib/Makefile.in +index e2f256f..d2f4040 100644 +--- a/lua/src/lib/Makefile.in ++++ b/lua/src/lib/Makefile.in +@@ -82,7 +82,7 @@ noinst_LIBRARIES = liblualib.a + + DEFS = + CPPFLAGS = +-CFLAGS = -ansi -pedantic -Wall -I$(srcdir)/.. -I$(top_srcdir)/lua/include ++CFLAGS = -pedantic -Wall -I$(srcdir)/.. -I$(top_srcdir)/lua/include + LDFLAGS = + LIBS = -lm + +-- +2.34.1 + diff --git a/Ports/gltron/patches/0004-Build-Fix-char-vs.-const-char-arguments.patch b/Ports/gltron/patches/0004-Build-Fix-char-vs.-const-char-arguments.patch new file mode 100644 index 0000000000..ed65402f79 --- /dev/null +++ b/Ports/gltron/patches/0004-Build-Fix-char-vs.-const-char-arguments.patch @@ -0,0 +1,31 @@ +From 0ec20dfd57ae517d18f06c4c580d346fddd2f926 Mon Sep 17 00:00:00 2001 +From: Jelle Raaijmakers <jelle@gmta.nl> +Date: Mon, 9 May 2022 00:32:04 +0200 +Subject: [PATCH 4/6] Build: Fix `char*` vs. `const char*` arguments + +These arguments are of the wrong constness, which will trip our +compiler. +--- + nebu/include/scripting/nebu_scripting.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/nebu/include/scripting/nebu_scripting.h b/nebu/include/scripting/nebu_scripting.h +index 867eada..f5d8084 100644 +--- a/nebu/include/scripting/nebu_scripting.h ++++ b/nebu/include/scripting/nebu_scripting.h +@@ -18,9 +18,9 @@ extern int scripting_GetStringResult(char **s); + extern int scripting_CopyStringResult(char *s, int len); + + +-extern void scripting_RunFile(const char *name); +-extern void scripting_Run(const char *command); +-extern void scripting_RunFormat(const char *format, ...); ++extern void scripting_RunFile(char *name); ++extern void scripting_Run(char *command); ++extern void scripting_RunFormat(char *format, ...); + extern void scripting_RunGC(); + extern void scripting_Register(const char *name, int(*func) (lua_State *L)); + +-- +2.34.1 + diff --git a/Ports/gltron/patches/scripts_config_lua.patch b/Ports/gltron/patches/0005-Scripting-Fix-default-keybindings.patch index 93dac2d217..949abdae6b 100644 --- a/Ports/gltron/patches/scripts_config_lua.patch +++ b/Ports/gltron/patches/0005-Scripting-Fix-default-keybindings.patch @@ -1,6 +1,18 @@ ---- gltron-0.70/scripts/config.lua 2003-12-12 09:01:14.000000000 +0000 -+++ gltron-0.70-patched/scripts/config.lua 2022-01-11 01:05:39.007703324 +0000 -@@ -90,18 +90,18 @@ +From d2a56ba682814f2d2451fc0729ada79290de2939 Mon Sep 17 00:00:00 2001 +From: Jelle Raaijmakers <jelle@gmta.nl> +Date: Mon, 9 May 2022 00:36:08 +0200 +Subject: [PATCH 5/6] Scripting: Fix default keybindings + +These constants referred to the wrong keys. +--- + scripts/config.lua | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/scripts/config.lua b/scripts/config.lua +index 3c9e6d2..4755678 100644 +--- a/scripts/config.lua ++++ b/scripts/config.lua +@@ -90,18 +90,18 @@ settings.musicVolume = 0.5 settings.keys = { { -- player 1 @@ -29,3 +41,6 @@ }, { -- player 3 left = 276, -- cursor left +-- +2.34.1 + diff --git a/Ports/gltron/patches/0006-SDL-Convert-SDL1-to-SDL2.patch b/Ports/gltron/patches/0006-SDL-Convert-SDL1-to-SDL2.patch new file mode 100644 index 0000000000..0c2a045c15 --- /dev/null +++ b/Ports/gltron/patches/0006-SDL-Convert-SDL1-to-SDL2.patch @@ -0,0 +1,113 @@ +From bcaa941ae5b682862aacff18e44a8a33294ba716 Mon Sep 17 00:00:00 2001 +From: Jelle Raaijmakers <jelle@gmta.nl> +Date: Mon, 9 May 2022 00:53:48 +0200 +Subject: [PATCH 6/6] SDL: Convert SDL1 to SDL2 + +--- + nebu/input/input_system.c | 7 ++++--- + nebu/video/video_system.c | 20 +++++++++++--------- + src/game/init_sdl.c | 1 - + 3 files changed, 15 insertions(+), 13 deletions(-) + +diff --git a/nebu/input/input_system.c b/nebu/input/input_system.c +index 5b934e2..802540a 100644 +--- a/nebu/input/input_system.c ++++ b/nebu/input/input_system.c +@@ -6,18 +6,19 @@ + #include "SDL.h" + #include <stdlib.h> + ++extern SDL_Window* window; + static float joystick_threshold = 0; + + void SystemGrabInput() { +- SDL_WM_GrabInput(SDL_GRAB_ON); ++ SDL_SetWindowGrab(window, SDL_TRUE); + } + + void SystemUngrabInput() { +- SDL_WM_GrabInput(SDL_GRAB_OFF); ++ SDL_SetWindowGrab(window, SDL_FALSE); + } + + void SystemWarpPointer(int x, int y) { +- SDL_WarpMouse(x, y); ++ SDL_WarpMouseInWindow(window, x, y); + } + + void SystemHidePointer() { +diff --git a/nebu/video/video_system.c b/nebu/video/video_system.c +index fdfcc56..9c985f8 100644 +--- a/nebu/video/video_system.c ++++ b/nebu/video/video_system.c +@@ -3,14 +3,15 @@ + #include "SDL.h"
+ #include "SDL_opengl.h" + +-static SDL_Surface *screen; ++SDL_Window* window; ++static SDL_GLContext glcontext; + static int width, height; + static int flags; + static int fullscreen; + extern int video_initialized; + + void SystemSwapBuffers() { +- SDL_GL_SwapBuffers(); ++ SDL_GL_SwapWindow(window); + } + + void SystemInitWindow(int x, int y, int w, int h) { +@@ -50,21 +51,22 @@ void SystemInitDisplayMode(int f, unsigned char full) { + } + + void SystemSetGamma(float red, float green, float blue) { +- SDL_SetGamma(red, green, blue); ++ SDL_SetWindowBrightness(window, (red + green + blue) / 3); + } + + int SystemCreateWindow(char *name) { +- int f = SDL_OPENGL; ++ int f = SDL_WINDOW_OPENGL; + if(fullscreen & SYSTEM_FULLSCREEN) +- f |= SDL_FULLSCREEN; +- if( (screen = SDL_SetVideoMode( width, height, 0, f )) == NULL ) { ++ f |= SDL_WINDOW_FULLSCREEN; ++ if( (window = SDL_CreateWindow("GLTron", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, f )) == NULL ) { + fprintf(stderr, "[system] Couldn't set GL mode: %s\n", SDL_GetError()); + exit(1); /* OK: critical, no visual */ + } +- SDL_WM_SetCaption("GLtron", "");
++ glcontext = SDL_GL_CreateContext(window); ++ SDL_SetWindowTitle(window, "GLtron"); + glClearColor(0,0,0,0);
+ glClear(GL_COLOR_BUFFER_BIT);
+- SDL_GL_SwapBuffers(); ++ SDL_GL_SwapWindow(window); + return 1; + } + +@@ -76,7 +78,7 @@ void SystemDestroyWindow(int id) { + /* there used to be some problems (memory leaks, unprober driver unloading) + * caused by this, but I can't remember what they where + */ +- ++ SDL_GL_DeleteContext(glcontext); + SDL_QuitSubSystem(SDL_INIT_VIDEO); + video_initialized = 0; + } +diff --git a/src/game/init_sdl.c b/src/game/init_sdl.c +index bb787e5..c35eeca 100644 +--- a/src/game/init_sdl.c ++++ b/src/game/init_sdl.c +@@ -22,7 +22,6 @@ void videoInit(void) { + + void inputInit(void) { + /* keyboard */ +- SDL_EnableKeyRepeat(0, 0); /* turn keyrepeat off */ + + /* joystick */ + if(SDL_Init(SDL_INIT_JOYSTICK) >= 0) { +-- +2.34.1 + diff --git a/Ports/gltron/patches/ReadMe.md b/Ports/gltron/patches/ReadMe.md new file mode 100644 index 0000000000..42c6d4b44d --- /dev/null +++ b/Ports/gltron/patches/ReadMe.md @@ -0,0 +1,35 @@ +# Patches for gltron on SerenityOS + +## `0001-Build-Allow-CFLAGS-env-var-to-be-set.patch` + +Build: Allow `CFLAGS` env var to be set + + +## `0002-Build-Replace-lGL-with-lgl-to-reference-our-LibGL.patch` + +Build: Replace `-lGL` with `-lgl` to reference our LibGL + + +## `0003-Build-Remove-ansi-build-argument.patch` + +Build: Remove `-ansi` build argument + + +## `0004-Build-Fix-char-vs.-const-char-arguments.patch` + +Build: Fix `char*` vs. `const char*` arguments + +These arguments are of the wrong constness, which will trip our +compiler. + +## `0005-Scripting-Fix-default-keybindings.patch` + +Scripting: Fix default keybindings + +These constants referred to the wrong keys. + +## `0006-SDL-Convert-SDL1-to-SDL2.patch` + +SDL: Convert SDL1 to SDL2 + + diff --git a/Ports/gltron/patches/configure.patch b/Ports/gltron/patches/configure.patch deleted file mode 100644 index 90a47c5616..0000000000 --- a/Ports/gltron/patches/configure.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- gltron-0.70/configure 2003-12-14 09:00:19.000000000 +0000 -+++ gltron-0.70-patched/configure 2022-01-10 00:11:14.467260522 +0000 -@@ -2805,7 +2805,7 @@ - RANLIB="$ac_cv_prog_RANLIB" - fi - --CFLAGS="-DSEPARATOR=\"'/'\"" -+CFLAGS="$CFLAGS -DSEPARATOR=\"'/'\"" - - # Check whether --enable-warn or --disable-warn was given. - if test "${enable_warn+set}" = set; then -@@ -3130,7 +3130,7 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lGL $LIBS" -+LIBS="-lgl $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line 3135 "configure" - #include "confdefs.h" -@@ -3171,7 +3171,7 @@ - #define HAVE_LIBGL 1 - EOF - -- LIBS="-lGL $LIBS" -+ LIBS="-lgl $LIBS" - - else - { { echo "$as_me:3177: error: OpenGL is not installed" >&5 diff --git a/Ports/gltron/patches/game_init_sdl_c.patch b/Ports/gltron/patches/game_init_sdl_c.patch deleted file mode 100644 index 10d416a1f0..0000000000 --- a/Ports/gltron/patches/game_init_sdl_c.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- gltron-0.70/src/game/init_sdl.c 2003-07-13 13:47:58.000000000 +0000 -+++ gltron-0.70-patched/src/game/init_sdl.c 2022-01-10 00:57:00.255732917 +0000 -@@ -22,7 +22,6 @@ - - void inputInit(void) { - /* keyboard */ -- SDL_EnableKeyRepeat(0, 0); /* turn keyrepeat off */ - - /* joystick */ - if(SDL_Init(SDL_INIT_JOYSTICK) >= 0) { diff --git a/Ports/gltron/patches/lua_makefile_in.patch b/Ports/gltron/patches/lua_makefile_in.patch deleted file mode 100644 index a2e1a1fdd4..0000000000 --- a/Ports/gltron/patches/lua_makefile_in.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- gltron-0.70/lua/src/lib/Makefile.in 2003-12-14 09:00:20.000000000 +0000 -+++ gltron-0.70-patched/lua/src/lib/Makefile.in 2022-01-10 00:05:42.499282291 +0000 -@@ -82,7 +82,7 @@ - - DEFS = - CPPFLAGS = --CFLAGS = -ansi -pedantic -Wall -I$(srcdir)/.. -I$(top_srcdir)/lua/include -+CFLAGS = -pedantic -Wall -I$(srcdir)/.. -I$(top_srcdir)/lua/include - LDFLAGS = - LIBS = -lm - ---- gltron-0.70/lua/src/Makefile.in 2003-12-14 09:00:20.000000000 +0000 -+++ gltron-0.70-patched/lua/src/Makefile.in 2022-01-10 00:05:33.643271402 +0000 -@@ -84,7 +84,7 @@ - - DEFS = - AM_CPPFLAGS = --AM_CFLAGS = -ansi -pedantic -Wall -I$(srcdir) -I$(top_srcdir)/lua/include -+AM_CFLAGS = -pedantic -Wall -I$(srcdir) -I$(top_srcdir)/lua/include - LDFLAGS = - LIBS = -lm - diff --git a/Ports/gltron/patches/nebu_input_system_c.patch b/Ports/gltron/patches/nebu_input_system_c.patch deleted file mode 100644 index f7d38ead18..0000000000 --- a/Ports/gltron/patches/nebu_input_system_c.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- gltron-0.70/nebu/input/input_system.c 2003-07-16 20:23:38.000000000 +0000 -+++ gltron-0.70-patched/nebu/input/input_system.c 2022-01-10 00:40:05.362550537 +0000 -@@ -6,18 +6,19 @@ - #include "SDL.h" - #include <stdlib.h> - -+extern SDL_Window* window; - static float joystick_threshold = 0; - - void SystemGrabInput() { -- SDL_WM_GrabInput(SDL_GRAB_ON); -+ SDL_SetWindowGrab(window, SDL_TRUE); - } - - void SystemUngrabInput() { -- SDL_WM_GrabInput(SDL_GRAB_OFF); -+ SDL_SetWindowGrab(window, SDL_FALSE); - } - - void SystemWarpPointer(int x, int y) { -- SDL_WarpMouse(x, y); -+ SDL_WarpMouseInWindow(window, x, y); - } - - void SystemHidePointer() { diff --git a/Ports/gltron/patches/nebu_scripting_h.patch b/Ports/gltron/patches/nebu_scripting_h.patch deleted file mode 100644 index 7a631f2e07..0000000000 --- a/Ports/gltron/patches/nebu_scripting_h.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- gltron-0.70/nebu/include/scripting/nebu_scripting.h 2003-12-12 09:01:13.000000000 +0000 -+++ gltron-0.70-patched/nebu/include/scripting/nebu_scripting.h 2022-01-10 00:21:06.346024766 +0000 -@@ -18,9 +18,9 @@ - extern int scripting_CopyStringResult(char *s, int len); - - --extern void scripting_RunFile(const char *name); --extern void scripting_Run(const char *command); --extern void scripting_RunFormat(const char *format, ...); -+extern void scripting_RunFile(char *name); -+extern void scripting_Run(char *command); -+extern void scripting_RunFormat(char *format, ...); - extern void scripting_RunGC(); - extern void scripting_Register(const char *name, int(*func) (lua_State *L)); - diff --git a/Ports/gltron/patches/nebu_video_system_c.patch b/Ports/gltron/patches/nebu_video_system_c.patch deleted file mode 100644 index fc6e54a026..0000000000 --- a/Ports/gltron/patches/nebu_video_system_c.patch +++ /dev/null @@ -1,63 +0,0 @@ ---- gltron-0.70/nebu/video/video_system.c 2003-07-21 08:18:57.000000000 +0000 -+++ gltron-0.70-patched/nebu/video/video_system.c 2022-01-11 23:08:04.316789459 +0000 -@@ -1,16 +1,17 @@ - #include "Nebu_video.h" - --#include "SDL.h"
-+#include "SDL.h" - #include "SDL_opengl.h" - --static SDL_Surface *screen; -+SDL_Window* window; -+static SDL_GLContext glcontext; - static int width, height; - static int flags; - static int fullscreen; - extern int video_initialized; - - void SystemSwapBuffers() { -- SDL_GL_SwapBuffers(); -+ SDL_GL_SwapWindow(window); - } - - void SystemInitWindow(int x, int y, int w, int h) { -@@ -50,21 +51,22 @@ - } - - void SystemSetGamma(float red, float green, float blue) { -- SDL_SetGamma(red, green, blue); -+ SDL_SetWindowBrightness(window, (red + green + blue) / 3); - } - - int SystemCreateWindow(char *name) { -- int f = SDL_OPENGL; -+ int f = SDL_WINDOW_OPENGL; - if(fullscreen & SYSTEM_FULLSCREEN) -- f |= SDL_FULLSCREEN; -- if( (screen = SDL_SetVideoMode( width, height, 0, f )) == NULL ) { -+ f |= SDL_WINDOW_FULLSCREEN; -+ if( (window = SDL_CreateWindow("GLTron", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, f )) == NULL ) { - fprintf(stderr, "[system] Couldn't set GL mode: %s\n", SDL_GetError()); - exit(1); /* OK: critical, no visual */ - } -- SDL_WM_SetCaption("GLtron", "");
-- glClearColor(0,0,0,0);
-- glClear(GL_COLOR_BUFFER_BIT);
-- SDL_GL_SwapBuffers(); -+ glcontext = SDL_GL_CreateContext(window); -+ SDL_SetWindowTitle(window, "GLtron"); -+ glClearColor(0,0,0,0); -+ glClear(GL_COLOR_BUFFER_BIT); -+ SDL_GL_SwapWindow(window); - return 1; - } - -@@ -76,7 +78,7 @@ - /* there used to be some problems (memory leaks, unprober driver unloading) - * caused by this, but I can't remember what they where - */ -- -+ SDL_GL_DeleteContext(glcontext); - SDL_QuitSubSystem(SDL_INIT_VIDEO); - video_initialized = 0; - } |