From 61cac0f1b30a1c05a1a4aadbb30be92638a69bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 18 Aug 2012 10:35:24 +0200 Subject: [PATCH] Renamed EglContext to XEglContext. X11 window and event handling will be used also elsewhere for desktop OpenGL, reflect its presence in the class name. --- CMakeLists.txt | 2 +- modules/FindMagnum.cmake | 4 ++-- src/Contexts/CMakeLists.txt | 12 +++++------ .../{EglContext.cpp => XEglContext.cpp} | 10 +++++----- src/Contexts/{EglContext.h => XEglContext.h} | 20 +++++++++---------- 5 files changed, 24 insertions(+), 24 deletions(-) rename src/Contexts/{EglContext.cpp => XEglContext.cpp} (95%) rename src/Contexts/{EglContext.h => XEglContext.h} (91%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 990245bcc..240f12297 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ option(WITH_PRIMITIVES "Builf Primitives library" OFF) option(WITH_SCENEGRAPH "Build SceneGraph library" OFF) option(WITH_SHADERS "Build Shaders library" OFF) -cmake_dependent_option(WITH_EGLCONTEXT "Build EglContext library" OFF "TARGET_GLES" OFF) +cmake_dependent_option(WITH_XEGLCONTEXT "Build XEglContext library" OFF "TARGET_GLES" OFF) cmake_dependent_option(WITH_GLUTCONTEXT "Build GlutContext library" OFF "NOT TARGET_GLES" OFF) option(WITH_SDL2CONTEXT "Build Sdl2Context library" OFF) diff --git a/modules/FindMagnum.cmake b/modules/FindMagnum.cmake index 778b7b77d..4b1aa91e0 100644 --- a/modules/FindMagnum.cmake +++ b/modules/FindMagnum.cmake @@ -20,7 +20,7 @@ # Primitives - Library with stock geometric primitives (static) # SceneGraph - Scene graph library # Shaders - Library with stock shaders -# EglContext - EGL context (depends on EGL and X11 libraries) +# XEglContext - X/EGL context (depends on EGL and X11 libraries) # GlutContext - GLUT context (depends on GLUT library) # Sdl2Context - SDL2 context (depends on SDL2 library) # Example usage with specifying additional components is: @@ -112,7 +112,7 @@ foreach(component ${Magnum_FIND_COMPONENTS}) endif() # X/EGL context dependencies - if(${component} STREQUAL EglContext) + if(${component} STREQUAL XEglContext) find_package(EGL) find_package(X11) if(EGL_FOUND AND X11_FOUND) diff --git a/src/Contexts/CMakeLists.txt b/src/Contexts/CMakeLists.txt index 9adde18b6..e65a8ecee 100644 --- a/src/Contexts/CMakeLists.txt +++ b/src/Contexts/CMakeLists.txt @@ -26,16 +26,16 @@ if(WITH_SDL2CONTEXT) endif() # X/EGL context -if(WITH_EGLCONTEXT) +if(WITH_XEGLCONTEXT) find_package(EGL) find_package(X11) if(EGL_FOUND AND X11_FOUND) - add_library(MagnumEglContext STATIC EglContext.cpp) + add_library(MagnumXEglContext STATIC XEglContext.cpp) # X11 macros are a mess, disable warnings for C-style casts - set_target_properties(MagnumEglContext PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast") - install(FILES EglContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts) - install(TARGETS MagnumEglContext DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + set_target_properties(MagnumXEglContext PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast") + install(FILES XEglContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts) + install(TARGETS MagnumXEglContext DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) else() - message(FATAL_ERROR "EGL or X11 libraries, required by EglContext, were not found. Set WITH_EGLCONTEXT to OFF to skip building it.") + message(FATAL_ERROR "EGL or X11 libraries, required by XEglContext, were not found. Set WITH_XEGLCONTEXT to OFF to skip building it.") endif() endif() diff --git a/src/Contexts/EglContext.cpp b/src/Contexts/XEglContext.cpp similarity index 95% rename from src/Contexts/EglContext.cpp rename to src/Contexts/XEglContext.cpp index b05890ab8..6486d8588 100644 --- a/src/Contexts/EglContext.cpp +++ b/src/Contexts/XEglContext.cpp @@ -13,7 +13,7 @@ GNU Lesser General Public License version 3 for more details. */ -#include "EglContext.h" +#include "XEglContext.h" #define None 0L // redef Xlib nonsense @@ -24,7 +24,7 @@ using namespace std; namespace Magnum { namespace Contexts { -EglContext::EglContext(int&, char**, const string& title, const Math::Vector2& size): viewportSize(size) { +XEglContext::XEglContext(int&, char**, const string& title, const Math::Vector2& size): viewportSize(size) { /* Get default X display and root window, init EGL */ xDisplay = XOpenDisplay(0); display = eglGetDisplay(xDisplay); @@ -116,13 +116,13 @@ EglContext::EglContext(int&, char**, const string& title, const Math::Vector2 @@ -16,7 +16,7 @@ */ /** @file - * @brief Class Magnum::Contexts::EglContext + * @brief Class Magnum::Contexts::XEglContext */ #include "Magnum.h" @@ -40,7 +40,7 @@ namespace Magnum { namespace Contexts { Supports keyboard and mouse handling. */ -class EglContext: public AbstractContext { +class XEglContext: public AbstractContext { public: /** * @brief Constructor @@ -51,14 +51,14 @@ class EglContext: public AbstractContext { * * Creates window with double-buffered OpenGL ES 2 context. */ - EglContext(int& argc, char** argv, const std::string& title = "Magnum X/EGL context", const Math::Vector2& size = Math::Vector2(800, 600)); + XEglContext(int& argc, char** argv, const std::string& title = "Magnum X/EGL context", const Math::Vector2& size = Math::Vector2(800, 600)); /** * @brief Destructor * * Deletes context and destroys the window. */ - ~EglContext(); + ~XEglContext(); int exec(); @@ -218,10 +218,10 @@ class EglContext: public AbstractContext { Math::Vector2 viewportSize; }; -inline void EglContext::keyPressEvent(EglContext::Key, const Math::Vector2&) {} -inline void EglContext::keyReleaseEvent(EglContext::Key, const Math::Vector2&) {} -inline void EglContext::mousePressEvent(EglContext::MouseButton, const Math::Vector2&) {} -inline void EglContext::mouseReleaseEvent(EglContext::MouseButton, const Math::Vector2&) {} +inline void XEglContext::keyPressEvent(XEglContext::Key, const Math::Vector2&) {} +inline void XEglContext::keyReleaseEvent(XEglContext::Key, const Math::Vector2&) {} +inline void XEglContext::mousePressEvent(XEglContext::MouseButton, const Math::Vector2&) {} +inline void XEglContext::mouseReleaseEvent(XEglContext::MouseButton, const Math::Vector2&) {} }}