1 This is a concatenation of the following two patches:
3 https://github.com/jcowgill/M.A.R.S./commit/33d5affabf8ff84f2c028b9303c6a9e83cc824ad.patch
4 https://patch-diff.githubusercontent.com/raw/thelaui/M.A.R.S./pull/2.patch
6 Their purpose is to allow Mars to be built against the latest version of SFML.
8 From 33d5affabf8ff84f2c028b9303c6a9e83cc824ad Mon Sep 17 00:00:00 2001
9 From: James Cowgill <james410@cowgill.org.uk>
10 Date: Sat, 9 May 2015 01:54:14 +0100
11 Subject: [PATCH] Remove dependency on GLU - fixes build with SFML 2.3
14 premake4.lua | 8 ++++----
15 src/Shaders/postFX.cpp | 2 +-
16 src/System/window.cpp | 12 ++++++------
17 3 files changed, 11 insertions(+), 11 deletions(-)
19 diff --git a/premake4.lua b/premake4.lua
20 index 023dddd..5af4495 100755
23 @@ -11,11 +11,11 @@ project "mars"
26 if os.get() == "windows" then
27 - links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "glu32", "opengl32", "fribidi-0", "tag" }
28 + links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "opengl32", "fribidi-0", "tag" }
29 elseif os.get() == "macosx" then
30 links { "sfml-graphics.framework", "sfml-audio.framework", "sfml-system.framework", "sfml-window.framework", "opengl.framework", "fribidi", "tag" }
32 - links { "GLU", "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
33 + links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
34 libdirs { "/usr/lib", "/usr/local/lib" }
37 @@ -23,10 +23,10 @@ project "mars"
38 defines { "_DEBUG", "DEBUG" }
40 if os.get() == "windows" then
41 - links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "glu32", "opengl32", "fribidi-0", "tag" }
42 + links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "opengl32", "fribidi-0", "tag" }
43 elseif os.get() == "macosx" then
44 links { "sfml-graphics.framework", "sfml-audio.framework", "sfml-system.framework", "sfml-window.framework", "opengl.framework", "fribidi", "tag" }
46 - links { "GLU", "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
47 + links { "sfml-graphics", "sfml-audio", "sfml-system", "sfml-window", "fribidi", "tag" }
48 libdirs { "/usr/lib", "/usr/local/lib" }
50 diff --git a/src/Shaders/postFX.cpp b/src/Shaders/postFX.cpp
51 index 987f411..f767a47 100644
52 --- a/src/Shaders/postFX.cpp
53 +++ b/src/Shaders/postFX.cpp
54 @@ -78,7 +78,7 @@ namespace postFX {
55 postFX_.loadFromFile(settings::C_dataPath + "shaders/bump.frag", sf::Shader::Fragment);
56 bumpMap_.create(SPACE_X_RESOLUTION*0.5f, SPACE_Y_RESOLUTION*0.5f);
57 glViewport(0,0,SPACE_X_RESOLUTION*0.5f,SPACE_Y_RESOLUTION*0.5f);
58 - gluOrtho2D(0, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0);
59 + glOrtho(0, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0, -1, 1);
61 glMatrixMode(GL_MODELVIEW);
62 postFX_.setParameter("BumpMap", bumpMap_.getTexture());
63 diff --git a/src/System/window.cpp b/src/System/window.cpp
64 index e9a099a..8e12dcc 100644
65 --- a/src/System/window.cpp
66 +++ b/src/System/window.cpp
67 @@ -222,7 +222,7 @@ namespace window {
70 // Setup translation (according to left-upper corner)
71 - gluOrtho2D(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f);
72 + glOrtho(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f, -1, 1);
74 // probably improves performance...
75 glDisable(GL_LIGHTING);
76 @@ -247,7 +247,7 @@ namespace window {
78 glMatrixMode(GL_PROJECTION);
80 - gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
81 + glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);
82 glMatrixMode(GL_MODELVIEW);
85 @@ -255,7 +255,7 @@ namespace window {
87 glMatrixMode(GL_PROJECTION);
89 - gluOrtho2D(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f);
90 + glOrtho(0.f, SPACE_X_RESOLUTION, SPACE_Y_RESOLUTION, 0.f, -1, 1);
91 glMatrixMode(GL_MODELVIEW);
94 @@ -270,7 +270,7 @@ namespace window {
98 - gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
99 + glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);
101 glMatrixMode(GL_MODELVIEW);
103 @@ -284,7 +284,7 @@ namespace window {
107 - gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
108 + glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);
110 glMatrixMode(GL_MODELVIEW);
112 @@ -294,7 +294,7 @@ namespace window {
114 glMatrixMode(GL_PROJECTION);
116 - gluOrtho2D(0.f, viewPort_.x_, viewPort_.y_, 0.f);
117 + glOrtho(0.f, viewPort_.x_, viewPort_.y_, 0.f, -1, 1);
118 glMatrixMode(GL_MODELVIEW);
122 From a97d0d6a19b5b43e3c53081e36f1f1747b6674e6 Mon Sep 17 00:00:00 2001
123 From: Sylvain BOILARD <boilard@crans.org>
124 Date: Wed, 23 Jan 2013 02:02:47 +0100
125 Subject: [PATCH] Use sf::Shader::Bind() correctly after latest update of the
129 src/System/window.cpp | 6 ++----
130 1 file changed, 2 insertions(+), 4 deletions(-)
132 diff --git a/src/System/window.cpp b/src/System/window.cpp
133 index e9a099a..3ffcf65 100644
134 --- a/src/System/window.cpp
135 +++ b/src/System/window.cpp
136 @@ -307,13 +307,11 @@ namespace window {
137 window_.setActive(true);
138 glEnable(GL_TEXTURE_2D);
142 + sf::Shader::bind(shader);
144 window_.draw(toBeDrawn, states);
148 + sf::Shader::bind(NULL);
150 window_.popGLStates();