diff --git a/examples/X11/CMakeLists.txt b/examples/X11/CMakeLists.txt index 75f3cc3e1..cc62f48b6 100644 --- a/examples/X11/CMakeLists.txt +++ b/examples/X11/CMakeLists.txt @@ -4,7 +4,7 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/X11) # all source files set(SRC ${SRCROOT}/X11.cpp) -# find OpenGL, GLU and X11 +# find OpenGL and X11 find_package(OpenGL REQUIRED) include_directories(${OPENGL_INCLUDE_DIR}) find_package(X11 REQUIRED) diff --git a/examples/X11/X11.cpp b/examples/X11/X11.cpp index b8263a051..2c2b3f986 100644 --- a/examples/X11/X11.cpp +++ b/examples/X11/X11.cpp @@ -4,10 +4,10 @@ //////////////////////////////////////////////////////////// #include #include +#include #include -#include -#include #include +#include //////////////////////////////////////////////////////////// @@ -33,7 +33,9 @@ void initialize(sf::Window& window) // Setup a perspective projection glMatrixMode(GL_PROJECTION); glLoadIdentity(); - gluPerspective(90.f, 1.f, 1.f, 500.f); + static const double pi = 3.141592654; + GLdouble extent = std::tan(90.0 * pi / 360.0); + glFrustum(-extent, extent, -extent, extent, 1.0, 500.0); } //////////////////////////////////////////////////////////// diff --git a/examples/opengl/CMakeLists.txt b/examples/opengl/CMakeLists.txt index 5e1571fc2..3bac2b907 100644 --- a/examples/opengl/CMakeLists.txt +++ b/examples/opengl/CMakeLists.txt @@ -4,7 +4,7 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/opengl) # all source files set(SRC ${SRCROOT}/OpenGL.cpp) -# find OpenGL and GLU +# find OpenGL find_package(OpenGL REQUIRED) include_directories(${OPENGL_INCLUDE_DIR}) set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES}) diff --git a/examples/opengl/OpenGL.cpp b/examples/opengl/OpenGL.cpp index c02b9c2c4..2df59386c 100644 --- a/examples/opengl/OpenGL.cpp +++ b/examples/opengl/OpenGL.cpp @@ -53,9 +53,9 @@ int main() return EXIT_FAILURE; glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); - gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, image.getSize().x, image.getSize().y, GL_RGBA, GL_UNSIGNED_BYTE, image.getPixelsPtr()); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.getSize().x, image.getSize().y, 0, GL_RGBA, GL_UNSIGNED_BYTE, image.getPixelsPtr()); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); } // Enable Z-buffer read and write diff --git a/examples/window/CMakeLists.txt b/examples/window/CMakeLists.txt index e49340cce..2ce61a077 100644 --- a/examples/window/CMakeLists.txt +++ b/examples/window/CMakeLists.txt @@ -4,7 +4,7 @@ set(SRCROOT ${PROJECT_SOURCE_DIR}/examples/window) # all source files set(SRC ${SRCROOT}/Window.cpp) -# find OpenGL and GLU +# find OpenGL find_package(OpenGL REQUIRED) include_directories(${OPENGL_INCLUDE_DIR}) set(ADDITIONAL_LIBRARIES ${OPENGL_LIBRARIES}) diff --git a/include/SFML/OpenGL.hpp b/include/SFML/OpenGL.hpp index 96d4bff89..a5d964f10 100644 --- a/include/SFML/OpenGL.hpp +++ b/include/SFML/OpenGL.hpp @@ -33,7 +33,7 @@ //////////////////////////////////////////////////////////// -/// This file just includes the OpenGL (GL and GLU) headers, +/// This file just includes the OpenGL headers, /// which have actually different paths on each system //////////////////////////////////////////////////////////// #if defined(SFML_SYSTEM_WINDOWS) @@ -44,7 +44,6 @@ #endif #include - #include #elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD) @@ -53,13 +52,11 @@ #include #else #include - #include #endif #elif defined(SFML_SYSTEM_MACOS) #include - #include #elif defined (SFML_SYSTEM_IOS)