Browse Source

Platform/Application renaming.

Because with NaCl WindowContext doesn't make sense anymore, the classes
are now renamed:

 * Contexts namespace -> Platform
 * *WindowContext -> Application

Hopefully this is (one of) last crazy renaming runs.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
e1cd13021b
  1. 8
      CMakeLists.txt
  2. 10
      README.md
  3. 22
      doc/building.dox
  4. 4
      doc/mainpage.dox
  5. 10
      doc/namespaces.dox
  6. 36
      modules/FindMagnum.cmake
  7. 2
      src/CMakeLists.txt
  8. 93
      src/Contexts/CMakeLists.txt
  9. 20
      src/Platform/AbstractApplication.h
  10. 8
      src/Platform/AbstractContextHandler.h
  11. 10
      src/Platform/AbstractXApplication.cpp
  12. 40
      src/Platform/AbstractXApplication.h
  13. 93
      src/Platform/CMakeLists.txt
  14. 2
      src/Platform/EglContextHandler.cpp
  15. 12
      src/Platform/EglContextHandler.h
  16. 2
      src/Platform/ExtensionWrangler.cpp
  17. 8
      src/Platform/ExtensionWrangler.h
  18. 10
      src/Platform/GlutApplication.cpp
  19. 28
      src/Platform/GlutApplication.h
  20. 16
      src/Platform/GlxApplication.h
  21. 2
      src/Platform/GlxContextHandler.cpp
  22. 12
      src/Platform/GlxContextHandler.h
  23. 10
      src/Platform/Sdl2Application.cpp
  24. 38
      src/Platform/Sdl2Application.h
  25. 16
      src/Platform/XEglApplication.h
  26. 2
      src/Profiler.h

8
CMakeLists.txt

@ -17,10 +17,10 @@ cmake_dependent_option(WITH_PRIMITIVES "Builf Primitives library" OFF "NOT WITH_
cmake_dependent_option(WITH_SCENEGRAPH "Build SceneGraph library" OFF "NOT WITH_EVERYTHING;NOT WITH_PHYSICS" ON)
cmake_dependent_option(WITH_SHADERS "Build Shaders library" OFF "NOT WITH_EVERYTHING;NOT WITH_PHYSICS" ON)
option(WITH_GLXWINDOWCONTEXT "Build GlxWindowContext library" OFF)
cmake_dependent_option(WITH_XEGLWINDOWCONTEXT "Build XEglWindowContext library" OFF "TARGET_GLES" OFF)
cmake_dependent_option(WITH_GLUTWINDOWCONTEXT "Build GlutWindowContext library" OFF "NOT TARGET_GLES" OFF)
option(WITH_SDL2WINDOWCONTEXT "Build Sdl2WindowContext library" OFF)
option(WITH_GLXAPPLICATION "Build GlxApplication library" OFF)
cmake_dependent_option(WITH_XEGLAPPLICATION "Build XEglApplication library" OFF "TARGET_GLES" OFF)
cmake_dependent_option(WITH_GLUTAPPLICATION "Build GlutApplication library" OFF "NOT TARGET_GLES" OFF)
option(WITH_SDL2APPLICATION "Build Sdl2Application library" OFF)
option(BUILD_TESTS "Build unit tests." OFF)

10
README.md

@ -13,8 +13,8 @@ Features:
* Plugin-based data exchange framework for importing image, mesh, material
and scene data in various formats.
* Collection of pre-made graphic primitives and shaders for testing purposes.
* Classes for easy creation of OpenGL context with various toolkits, methods
for querying supported OpenGL version and available extensions.
* Classes for creating OpenGL-enabled applications with various toolkits,
methods for querying supported OpenGL version and available extensions.
* Comprehensive use of C++11 features for safety, performance and ease of
development. All code which doesn't directly interact with OpenGL is
covered with unit tests.
@ -45,13 +45,13 @@ Minimal dependencies
Compilation, installation
-------------------------
The library (for example with GLUT window context) can be built and installed
using these four commands:
The library (for example with support for GLUT applications) can be built and
installed using these four commands:
mkdir -p build && cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_GLUTWINDOWCONTEXT=ON
-DWITH_GLUTAPPLICATION=ON
make
make install

22
doc/building.dox

@ -37,14 +37,14 @@ subdirectory:
git submodule update
@section building-compilation Compilation, installation
The library (for example with GLUT window context) can be built and installed
using these four commands. See below for more information about optional
features.
The library (for example with support for GLUT applications) can be built and
installed using these four commands. See below for more information about
optional features.
mkdir -p build && cd build
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_GLUTWINDOWCONTEXT=ON
-DWITH_GLUTAPPLICATION=ON
make
make install
@ -57,7 +57,7 @@ OpenGL ES, set `TARGET_GLES` to `ON` or pass `-DTARGET_GLES=ON` to CMake. Note
that some features are available for desktop OpenGL only, see @ref requires-gl.
By default the engine is built with everything except
@ref Contexts "context libraries". Using `WITH_*` CMake parameters you can
@ref Platform "application libraries". Using `WITH_*` CMake parameters you can
specify which parts will be built and which not:
- `WITH_EVERYTHING` - Defaults to `ON`, builds everything except window
@ -68,16 +68,16 @@ specify which parts will be built and which not:
- `WITH_PRIMITIVES` - Primitives library.
- `WITH_SHADERS` - Shaders library.
None of the window context libraries is built by default, regardless to
None of the application libraries is built by default, regardless to
`WITH_EVERYTHING` is enabled or not:
- `WITH_XEGLWINDOWCONTEXT` - X/EGL window context, available only if
targeting OpenGL ES (see above). Requires **X11** and **EGL** libraries.
- `WITH_GLXWINDOWCONTEXT` - GLX window context. Requires **X11** and **GLX**
- `WITH_XEGLAPPLICATION` - X/EGL application, available only if targeting
OpenGL ES (see above). Requires **X11** and **EGL** libraries.
- `WITH_GLXAPPLICATION` - GLX application. Requires **X11** and **GLX**
libraries.
- `WITH_GLUTWINDOWCONTEXT` - GLUT window context, available only if targeting
- `WITH_GLUTAPPLICATION` - GLUT application, available only if targeting
desktop OpenGL. Requires **GLUT** library.
- `WITH_SDL2WINDOWCONTEXT` - SDL2 window context. Requires **SDL2** library.
- `WITH_SDL2APPLICATION` - SDL2 application. Requires **SDL2** library.
@subsection building-tests Building and running unit tests
If you want to build also unit tests (which are not built by default), pass

4
doc/mainpage.dox

@ -21,7 +21,7 @@ Features:
material and scene data in various formats.
- Collection of pre-made @ref Primitives "graphic primitives" and
@ref Shaders "shaders" for testing purposes.
- Classes for easy creation of OpenGL context with @ref Contexts
- Classes for creating OpenGL-enabled applications with @ref Platform
"various toolkits", methods for querying
@ref Context "supported OpenGL version and available extensions".
- Comprehensive use of C++11 features for safety, performance and ease of
@ -41,7 +41,7 @@ Guide @ref building "how to download and build Magnum" on different platforms.
To get up and running, you must first subclass one of the provided window
context classes and implement required functions. %Magnum provides
implementations for the most common toolkits (such as GLUT, Xlib, or SDL2) in
Contexts namespace.
Platform namespace.
Then you can either draw your meshes directly or use SceneGraph which will
help you with object hierarchy, transformations and resource management.

10
doc/namespaces.dox

@ -10,13 +10,13 @@
Contains classes for interacting with OpenGL.
*/
/** @dir Contexts
* @brief Namespace Magnum::Contexts
/** @dir Platform
* @brief Namespace Magnum::Platform
*/
/** @namespace Magnum::Contexts
@brief Context creation
/** @namespace Magnum::Platform
@brief Platform-specific application and context creation
Base classes for creating OpenGL contexts with various toolkits.
Base classes for creating applications with various toolkits.
*/
/** @dir Math

36
modules/FindMagnum.cmake

@ -21,13 +21,13 @@
# Primitives - Library with stock geometric primitives (static)
# SceneGraph - Scene graph library
# Shaders - Library with stock shaders
# GlxContext - GLX context (depends on 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)
# GlxApplication - GLX application (depends on X11 libraries)
# XEglApplication - X/EGL application (depends on EGL and X11 libraries)
# GlutApplication - GLUT application (depends on GLUT library)
# Sdl2Application - SDL2 application (depends on SDL2 library)
# Example usage with specifying additional components is:
# find_package(Magnum [REQUIRED|COMPONENTS]
# MeshTools Primitives GlutContext)
# MeshTools Primitives GlutApplication)
# For each component is then defined:
# MAGNUM_*_FOUND - Whether the component was found
# MAGNUM_*_LIBRARIES - Component library and dependent libraries
@ -92,8 +92,8 @@ else()
find_package(OpenGLES2 REQUIRED)
endif()
# On Windows, *WindowContext libraries need to have ${MAGNUM_LIBRARY} listed
# in dependencies also after *WindowContext.lib static library name to avoid
# On Windows, *Application libraries need to have ${MAGNUM_LIBRARY} listed
# in dependencies also after *Application.lib static library name to avoid
# linker errors
if(WIN32)
set(_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY ${MAGNUM_LIBRARY})
@ -108,13 +108,13 @@ foreach(component ${Magnum_FIND_COMPONENTS})
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX ${component})
# Window contexts
if(${component} MATCHES .+WindowContext)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Contexts)
# Applications
if(${component} MATCHES .+Application)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Platform)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${component}.h)
# GLUT window context dependencies
if(${component} STREQUAL GlutWindowContext)
# GLUT application dependencies
if(${component} STREQUAL GlutApplication)
find_package(GLUT)
if(GLUT_FOUND)
set(_MAGNUM_${_COMPONENT}_LIBRARIES ${GLUT_LIBRARIES} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
@ -123,8 +123,8 @@ foreach(component ${Magnum_FIND_COMPONENTS})
endif()
endif()
# SDL2 window context dependencies
if(${component} STREQUAL Sdl2WindowContext)
# SDL2 application dependencies
if(${component} STREQUAL Sdl2Application)
find_package(SDL2)
if(SDL2_FOUND)
set(_MAGNUM_${_COMPONENT}_LIBRARIES ${SDL2_LIBRARY} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
@ -134,8 +134,8 @@ foreach(component ${Magnum_FIND_COMPONENTS})
endif()
endif()
# GLX window context dependencies
if(${component} STREQUAL GlxWindowContext)
# GLX application dependencies
if(${component} STREQUAL GlxApplication)
find_package(X11)
if(X11_FOUND)
set(_MAGNUM_${_COMPONENT}_LIBRARIES ${X11_LIBRARIES} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
@ -144,8 +144,8 @@ foreach(component ${Magnum_FIND_COMPONENTS})
endif()
endif()
# X/EGL window context dependencies
if(${component} STREQUAL XEglWindowContext)
# X/EGL application dependencies
if(${component} STREQUAL XEglApplication)
find_package(EGL)
find_package(X11)
if(EGL_FOUND AND X11_FOUND)

2
src/CMakeLists.txt

@ -124,7 +124,7 @@ install(FILES ${Magnum_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR})
# Install also configure file
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR})
add_subdirectory(Contexts)
add_subdirectory(Platform)
add_subdirectory(Math)
add_subdirectory(Trade)

93
src/Contexts/CMakeLists.txt

@ -1,93 +0,0 @@
# Extension wrangler
add_library(MagnumContextsExtensionWrangler OBJECT ExtensionWrangler.cpp)
set(MagnumContexts_HEADERS
AbstractContextHandler.h
AbstractWindowContext.h
ExtensionWrangler.h)
install(FILES ${MagnumContexts_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
# GLUT window context
if(WITH_GLUTWINDOWCONTEXT)
find_package(GLUT)
if(GLUT_FOUND)
add_library(MagnumGlutWindowContext STATIC
GlutWindowContext.cpp
$<TARGET_OBJECTS:MagnumContextsExtensionWrangler>)
install(FILES GlutWindowContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
install(TARGETS MagnumGlutWindowContext DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
else()
message(FATAL_ERROR "GLUT library, required by GlutWindowContext, was not found. Set WITH_GLUTWINDOWCONTEXT to OFF to skip building it.")
endif()
endif()
# SDL2 window context
if(WITH_SDL2WINDOWCONTEXT)
find_package(SDL2)
if(SDL2_FOUND)
include_directories(${SDL2_INCLUDE_DIR})
add_library(MagnumSdl2WindowContext STATIC
Sdl2WindowContext.cpp
$<TARGET_OBJECTS:MagnumContextsExtensionWrangler>)
install(FILES Sdl2WindowContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
install(TARGETS MagnumSdl2WindowContext DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
else()
message(FATAL_ERROR "SDL2 library, required by Sdl2WindowContext, was not found. Set WITH_SDL2WINDOWCONTEXT to OFF to skip building it.")
endif()
endif()
# GLX window context
if(WITH_GLXWINDOWCONTEXT)
set(NEED_ABSTRACTXWINDOWCONTEXT 1)
set(NEED_GLXCONTEXT 1)
add_library(MagnumGlxWindowContext STATIC
$<TARGET_OBJECTS:MagnumAbstractXWindowContext>
$<TARGET_OBJECTS:MagnumGlxContextHandler>
$<TARGET_OBJECTS:MagnumContextsExtensionWrangler>)
install(FILES GlxWindowContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
install(TARGETS MagnumGlxWindowContext DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
endif()
# X/EGL window context
if(WITH_XEGLWINDOWCONTEXT)
set(NEED_ABSTRACTXWINDOWCONTEXT 1)
set(NEED_EGLCONTEXT 1)
add_library(MagnumXEglWindowContext STATIC
$<TARGET_OBJECTS:MagnumAbstractXWindowContext>
$<TARGET_OBJECTS:MagnumEglContextHandler>
$<TARGET_OBJECTS:MagnumContextsExtensionWrangler>)
install(FILES XEglWindowContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
install(TARGETS MagnumXEglWindowContext DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
endif()
# Abstract X window context
if(NEED_ABSTRACTXWINDOWCONTEXT)
find_package(X11)
if(NOT X11_FOUND)
message(FATAL_ERROR "X11 library, required by some contexts, was not found. Set WITH_*X*WINDOWCONTEXT to OFF to skip building them.")
endif()
add_library(MagnumAbstractXWindowContext OBJECT AbstractXWindowContext.cpp)
# X11 macros are a mess, disable warnings for C-style casts
set_target_properties(MagnumAbstractXWindowContext PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast")
install(FILES AbstractXWindowContext.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
endif()
# GLX context
if(NEED_GLXCONTEXT)
add_library(MagnumGlxContextHandler OBJECT GlxContextHandler.cpp)
# X11 macros are a mess, disable warnings for C-style casts
set_target_properties(MagnumGlxContextHandler PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast")
install(FILES GlxContextHandler.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
endif()
# EGL context
if(NEED_EGLCONTEXT)
find_package(EGL)
if(NOT EGL_FOUND)
message(FATAL_ERROR "EGL library, required by some window contexts, was not found. Set WITH_*EGL*WINDOWCONTEXT to OFF to skip building them.")
endif()
add_library(MagnumEglContextHandler OBJECT EglContextHandler.cpp)
# X11 macros are a mess, disable warnings for C-style casts
set_target_properties(MagnumEglContextHandler PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast")
install(FILES EglContextHandler.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Contexts)
endif()

20
src/Contexts/AbstractWindowContext.h → src/Platform/AbstractApplication.h

@ -1,5 +1,5 @@
#ifndef Magnum_Contexts_AbstractWindowContext_h
#define Magnum_Contexts_AbstractWindowContext_h
#ifndef Magnum_Platform_AbstractApplication_h
#define Magnum_Platform_AbstractApplication_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
@ -16,18 +16,18 @@
*/
/** @file
* @brief Class Magnum::Contexts::AbstractWindowContext
* @brief Class Magnum::Platform::AbstractApplication
*/
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
/**
@brief Base class for context creation
@brief Base class for applications
See subclasses documentation for more information. Context classes subclasses
are meant to be used directly in `main()`, for example:
See subclasses documentation for more information. Subclasses are meant to be
used directly in `main()`, for example:
@code
class MyContext: public Magnum::Contexts::GlutWindowContext {
class MyContext: public Magnum::Platform::GlutApplication {
// implement required methods...
};
int main(int argc, char** argv) {
@ -36,9 +36,9 @@ int main(int argc, char** argv) {
}
@endcode
*/
class AbstractWindowContext {
class AbstractApplication {
public:
virtual inline ~AbstractWindowContext() {}
virtual inline ~AbstractApplication() {}
/**
* @brief Execute main loop

8
src/Contexts/AbstractContextHandler.h → src/Platform/AbstractContextHandler.h

@ -1,5 +1,5 @@
#ifndef Magnum_Contexts_AbstractContextHandler_h
#define Magnum_Contexts_AbstractContextHandler_h
#ifndef Magnum_Platform_AbstractContextHandler_h
#define Magnum_Platform_AbstractContextHandler_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
@ -16,12 +16,12 @@
*/
/** @file
* @brief Class Magnum::Contexts::AbstractContextHandler
* @brief Class Magnum::Platform::AbstractContextHandler
*/
#include "ExtensionWrangler.h"
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
/** @brief Base for OpenGL context handlers */
template<class Display, class VisualId, class Window> class AbstractContextHandler {

10
src/Contexts/AbstractXWindowContext.cpp → src/Platform/AbstractXApplication.cpp

@ -13,7 +13,7 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "AbstractXWindowContext.h"
#include "AbstractXApplication.h"
#include "Context.h"
#include "ExtensionWrangler.h"
@ -25,9 +25,9 @@
using namespace std;
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
AbstractXWindowContext::AbstractXWindowContext(AbstractContextHandler<Display*, VisualID, Window>* contextHandler, int&, char**, const string& title, const Math::Vector2<GLsizei>& size): contextHandler(contextHandler), viewportSize(size), flags(Flag::Redraw) {
AbstractXApplication::AbstractXApplication(AbstractContextHandler<Display*, VisualID, Window>* contextHandler, int&, char**, const string& title, const Math::Vector2<GLsizei>& size): contextHandler(contextHandler), viewportSize(size), flags(Flag::Redraw) {
/* Get default X display */
display = XOpenDisplay(0);
@ -75,7 +75,7 @@ AbstractXWindowContext::AbstractXWindowContext(AbstractContextHandler<Display*,
c = new Context;
}
AbstractXWindowContext::~AbstractXWindowContext() {
AbstractXApplication::~AbstractXApplication() {
delete c;
/* Shut down context handler */
@ -86,7 +86,7 @@ AbstractXWindowContext::~AbstractXWindowContext() {
XCloseDisplay(display);
}
int AbstractXWindowContext::exec() {
int AbstractXApplication::exec() {
/* Show window */
XMapWindow(display, window);

40
src/Contexts/AbstractXWindowContext.h → src/Platform/AbstractXApplication.h

@ -1,5 +1,5 @@
#ifndef Magnum_Contexts_AbstractXWindowContext_h
#define Magnum_Contexts_AbstractXWindowContext_h
#ifndef Magnum_Platform_AbstractXApplication_h
#define Magnum_Platform_AbstractXApplication_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
@ -16,7 +16,7 @@
*/
/** @file
* @brief Class Magnum::Contexts::AbstractXWindowContext
* @brief Class Magnum::Platform::AbstractXApplication
*/
#include <Containers/EnumSet.h>
@ -30,7 +30,7 @@
#undef Always
#include "Math/Vector2.h"
#include "AbstractWindowContext.h"
#include "AbstractApplication.h"
#include "AbstractContextHandler.h"
#include "magnumCompatibility.h"
@ -39,16 +39,16 @@ namespace Magnum {
class Context;
namespace Contexts {
namespace Platform {
/** @nosubgrouping
@brief Base for X11-based contexts
@brief Base for X11-based applications
Supports keyboard and mouse handling.
@note Not meant to be used directly, see subclasses.
*/
class AbstractXWindowContext: public AbstractWindowContext {
class AbstractXApplication: public AbstractApplication {
public:
/**
* @brief Constructor
@ -60,14 +60,14 @@ class AbstractXWindowContext: public AbstractWindowContext {
*
* Creates window with double-buffered OpenGL ES 2 context.
*/
AbstractXWindowContext(AbstractContextHandler<Display*, VisualID, Window>* contextHandler, int& argc, char** argv, const std::string& title = "Magnum X window context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600));
AbstractXApplication(AbstractContextHandler<Display*, VisualID, Window>* contextHandler, int& argc, char** argv, const std::string& title = "Magnum X application", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600));
/**
* @brief Destructor
*
* Deletes context and destroys the window.
*/
virtual ~AbstractXWindowContext() = 0;
virtual ~AbstractXApplication() = 0;
int exec() override;
@ -77,16 +77,16 @@ class AbstractXWindowContext: public AbstractWindowContext {
/** @{ @name Drawing functions */
protected:
/** @copydoc GlutWindowContext::viewportEvent() */
/** @copydoc GlutApplication::viewportEvent() */
virtual void viewportEvent(const Math::Vector2<GLsizei>& size) = 0;
/** @copydoc GlutWindowContext::drawEvent() */
/** @copydoc GlutApplication::drawEvent() */
virtual void drawEvent() = 0;
/** @copydoc GlutWindowContext::swapBuffers() */
/** @copydoc GlutApplication::swapBuffers() */
inline void swapBuffers() { contextHandler->swapBuffers(); }
/** @copydoc GlutWindowContext::redraw() */
/** @copydoc GlutApplication::redraw() */
inline void redraw() { flags |= Flag::Redraw; }
/*@}*/
@ -293,15 +293,15 @@ class AbstractXWindowContext: public AbstractWindowContext {
Flags flags;
};
CORRADE_ENUMSET_OPERATORS(AbstractXWindowContext::Modifiers)
CORRADE_ENUMSET_OPERATORS(AbstractXWindowContext::Flags)
CORRADE_ENUMSET_OPERATORS(AbstractXApplication::Modifiers)
CORRADE_ENUMSET_OPERATORS(AbstractXApplication::Flags)
/* Implementations for inline functions with unused parameters */
inline void AbstractXWindowContext::keyPressEvent(Key, Modifiers, const Math::Vector2<int>&) {}
inline void AbstractXWindowContext::keyReleaseEvent(Key, Modifiers, const Math::Vector2<int>&) {}
inline void AbstractXWindowContext::mousePressEvent(MouseButton, Modifiers, const Math::Vector2<int>&) {}
inline void AbstractXWindowContext::mouseReleaseEvent(MouseButton, Modifiers, const Math::Vector2<int>&) {}
inline void AbstractXWindowContext::mouseMotionEvent(Modifiers, const Math::Vector2<int>&) {}
inline void AbstractXApplication::keyPressEvent(Key, Modifiers, const Math::Vector2<int>&) {}
inline void AbstractXApplication::keyReleaseEvent(Key, Modifiers, const Math::Vector2<int>&) {}
inline void AbstractXApplication::mousePressEvent(MouseButton, Modifiers, const Math::Vector2<int>&) {}
inline void AbstractXApplication::mouseReleaseEvent(MouseButton, Modifiers, const Math::Vector2<int>&) {}
inline void AbstractXApplication::mouseMotionEvent(Modifiers, const Math::Vector2<int>&) {}
}}

93
src/Platform/CMakeLists.txt

@ -0,0 +1,93 @@
# Extension wrangler
add_library(MagnumPlatformExtensionWrangler OBJECT ExtensionWrangler.cpp)
set(MagnumPlatform_HEADERS
AbstractContextHandler.h
AbstractApplication.h
ExtensionWrangler.h)
install(FILES ${MagnumPlatform_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
# GLUT application
if(WITH_GLUTAPPLICATION)
find_package(GLUT)
if(GLUT_FOUND)
add_library(MagnumGlutApplication STATIC
GlutApplication.cpp
$<TARGET_OBJECTS:MagnumPlatformExtensionWrangler>)
install(FILES GlutApplication.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
install(TARGETS MagnumGlutApplication DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
else()
message(FATAL_ERROR "GLUT library, required by GlutApplication, was not found. Set WITH_GLUTWINDOWCONTEXT to OFF to skip building it.")
endif()
endif()
# SDL2 application
if(WITH_SDL2APPLICATION)
find_package(SDL2)
if(SDL2_FOUND)
include_directories(${SDL2_INCLUDE_DIR})
add_library(MagnumSdl2Application STATIC
Sdl2Application.cpp
$<TARGET_OBJECTS:MagnumPlatformExtensionWrangler>)
install(FILES Sdl2Application.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
install(TARGETS MagnumSdl2Application DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
else()
message(FATAL_ERROR "SDL2 library, required by Sdl2Application, was not found. Set WITH_SDL2WINDOWCONTEXT to OFF to skip building it.")
endif()
endif()
# GLX application
if(WITH_GLXAPPLICATION)
set(NEED_ABSTRACTXAPPLICATION 1)
set(NEED_GLXCONTEXT 1)
add_library(MagnumGlxApplication STATIC
$<TARGET_OBJECTS:MagnumAbstractXApplication>
$<TARGET_OBJECTS:MagnumGlxContextHandler>
$<TARGET_OBJECTS:MagnumPlatformExtensionWrangler>)
install(FILES GlxApplication.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
install(TARGETS MagnumGlxApplication DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
endif()
# X/EGL window context
if(WITH_XEGLWINDOWCONTEXT)
set(NEED_ABSTRACTXAPPLICATION 1)
set(NEED_EGLCONTEXT 1)
add_library(MagnumXEglApplication STATIC
$<TARGET_OBJECTS:MagnumAbstractXApplication>
$<TARGET_OBJECTS:MagnumEglContextHandler>
$<TARGET_OBJECTS:MagnumPlatformExtensionWrangler>)
install(FILES XEglApplication.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
install(TARGETS MagnumXEglApplication DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
endif()
# Abstract X application
if(NEED_ABSTRACTXAPPLICATION)
find_package(X11)
if(NOT X11_FOUND)
message(FATAL_ERROR "X11 library, required by some contexts, was not found. Set WITH_*X*WINDOWCONTEXT to OFF to skip building them.")
endif()
add_library(MagnumAbstractXApplication OBJECT AbstractXApplication.cpp)
# X11 macros are a mess, disable warnings for C-style casts
set_target_properties(MagnumAbstractXApplication PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast")
install(FILES AbstractXApplication.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
endif()
# GLX context
if(NEED_GLXCONTEXT)
add_library(MagnumGlxContextHandler OBJECT GlxContextHandler.cpp)
# X11 macros are a mess, disable warnings for C-style casts
set_target_properties(MagnumGlxContextHandler PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast")
install(FILES GlxContextHandler.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
endif()
# EGL context
if(NEED_EGLCONTEXT)
find_package(EGL)
if(NOT EGL_FOUND)
message(FATAL_ERROR "EGL library, required by some window contexts, was not found. Set WITH_*EGL*WINDOWCONTEXT to OFF to skip building them.")
endif()
add_library(MagnumEglContextHandler OBJECT EglContextHandler.cpp)
# X11 macros are a mess, disable warnings for C-style casts
set_target_properties(MagnumEglContextHandler PROPERTIES COMPILE_FLAGS "-Wno-old-style-cast")
install(FILES EglContextHandler.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Platform)
endif()

2
src/Contexts/EglContextHandler.cpp → src/Platform/EglContextHandler.cpp

@ -19,7 +19,7 @@
#include "Context.h"
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
EglContextHandler::~EglContextHandler() {
eglDestroyContext(display, context);

12
src/Contexts/EglContextHandler.h → src/Platform/EglContextHandler.h

@ -1,5 +1,5 @@
#ifndef Magnum_Contexts_EglContextHandler_h
#define Magnum_Contexts_EglContextHandler_h
#ifndef Magnum_Platform_EglContextHandler_h
#define Magnum_Platform_EglContextHandler_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
@ -16,7 +16,7 @@
*/
/** @file
* @brief Class Magnum::Contexts::EglContextHandler
* @brief Class Magnum::Platform::EglContextHandler
*/
#include "Magnum.h"
@ -33,7 +33,7 @@
#include "magnumCompatibility.h"
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
#ifndef DOXYGEN_GENERATING_OUTPUT
/* EGL returns visual ID as int, but Xorg expects long unsigned int */
@ -45,9 +45,9 @@ typedef EGLInt VisualId;
#endif
/**
@brief EGL interface
@brief EGL context
Used in XEglWindowContext.
Used in XEglApplication.
*/
class EglContextHandler: public AbstractContextHandler<EGLNativeDisplayType, VisualId, EGLNativeWindowType> {
public:

2
src/Contexts/ExtensionWrangler.cpp → src/Platform/ExtensionWrangler.cpp

@ -19,7 +19,7 @@
#include "Magnum.h"
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
void ExtensionWrangler::initialize(ExperimentalFeatures experimentalFeatures) {
#ifndef MAGNUM_TARGET_GLES

8
src/Contexts/ExtensionWrangler.h → src/Platform/ExtensionWrangler.h

@ -1,5 +1,5 @@
#ifndef Magnum_Contexts_ExtensionWrangler_h
#define Magnum_Contexts_ExtensionWrangler_h
#ifndef Magnum_Platform_ExtensionWrangler_h
#define Magnum_Platform_ExtensionWrangler_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
@ -16,10 +16,10 @@
*/
/** @file
* @brief Class Magnum::Contexts::ExtensionWrangler
* @brief Class Magnum::Platform::ExtensionWrangler
*/
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
/** @brief Extension wrangler interface */
class ExtensionWrangler {

10
src/Contexts/GlutWindowContext.cpp → src/Platform/GlutApplication.cpp

@ -13,16 +13,16 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "GlutWindowContext.h"
#include "GlutApplication.h"
#include "Context.h"
#include "ExtensionWrangler.h"
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
GlutWindowContext* GlutWindowContext::instance = nullptr;
GlutApplication* GlutApplication::instance = nullptr;
GlutWindowContext::GlutWindowContext(int& argc, char** argv, const std::string& title, const Math::Vector2<GLsizei>& size) {
GlutApplication::GlutApplication(int& argc, char** argv, const std::string& title, const Math::Vector2<GLsizei>& size) {
/* Save global instance */
instance = this;
@ -43,7 +43,7 @@ GlutWindowContext::GlutWindowContext(int& argc, char** argv, const std::string&
c = new Context;
}
GlutWindowContext::~GlutWindowContext() {
GlutApplication::~GlutApplication() {
delete c;
}

28
src/Contexts/GlutWindowContext.h → src/Platform/GlutApplication.h

@ -1,5 +1,5 @@
#ifndef Magnum_Contexts_GlutWindowContext_h
#define Magnum_Contexts_GlutWindowContext_h
#ifndef Magnum_Platform_GlutApplication_h
#define Magnum_Platform_GlutApplication_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
@ -16,7 +16,7 @@
*/
/** @file
* @brief Class Magnum::Contexts::GlutWindowContext
* @brief Class Magnum::Platform::GlutApplication
*/
#include <string>
@ -26,7 +26,7 @@
#include <GL/freeglut.h>
#include "AbstractWindowContext.h"
#include "AbstractApplication.h"
#include "magnumCompatibility.h"
@ -34,10 +34,10 @@ namespace Magnum {
class Context;
namespace Contexts {
namespace Platform {
/** @nosubgrouping
@brief GLUT context
@brief GLUT application
Supports keyboard handling for limited subset of keys, mouse handling with
support for changing cursor and mouse tracking and warping.
@ -45,7 +45,7 @@ support for changing cursor and mouse tracking and warping.
You need to implement at least drawEvent() and viewportEvent() to be able to
draw on the screen.
*/
class GlutWindowContext: public AbstractWindowContext {
class GlutApplication: public AbstractApplication {
public:
/**
* @brief Constructor
@ -56,9 +56,9 @@ class GlutWindowContext: public AbstractWindowContext {
*
* Creates double-buffered RGBA window with depth and stencil buffers.
*/
GlutWindowContext(int& argc, char** argv, const std::string& title = "Magnum GLUT window context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600));
GlutApplication(int& argc, char** argv, const std::string& title = "Magnum GLUT application", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600));
~GlutWindowContext();
~GlutApplication();
inline int exec() override {
glutMainLoop();
@ -250,16 +250,16 @@ class GlutWindowContext: public AbstractWindowContext {
instance->drawEvent();
}
static GlutWindowContext* instance;
static GlutApplication* instance;
Context* c;
};
/* Implementations for inline functions with unused parameters */
inline void GlutWindowContext::keyPressEvent(Key, const Math::Vector2<int>&) {}
inline void GlutWindowContext::mousePressEvent(MouseButton, const Math::Vector2<int>&) {}
inline void GlutWindowContext::mouseReleaseEvent(MouseButton, const Math::Vector2<int>&) {}
inline void GlutWindowContext::mouseMotionEvent(const Math::Vector2<int>&) {}
inline void GlutApplication::keyPressEvent(Key, const Math::Vector2<int>&) {}
inline void GlutApplication::mousePressEvent(MouseButton, const Math::Vector2<int>&) {}
inline void GlutApplication::mouseReleaseEvent(MouseButton, const Math::Vector2<int>&) {}
inline void GlutApplication::mouseMotionEvent(const Math::Vector2<int>&) {}
}}

16
src/Contexts/GlxWindowContext.h → src/Platform/GlxApplication.h

@ -1,5 +1,5 @@
#ifndef Magnum_Contexts_GlxWindowContext_h
#define Magnum_Contexts_GlxWindowContext_h
#ifndef Magnum_Platform_GlxApplication_h
#define Magnum_Platform_GlxApplication_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
@ -16,20 +16,20 @@
*/
/** @file
* @brief Class Magnum::Contexts::GlxWindowContext
* @brief Class Magnum::Platform::GlxApplication
*/
#include "AbstractXWindowContext.h"
#include "AbstractXApplication.h"
#include "GlxContextHandler.h"
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
/**
@brief GLX context
@brief GLX application
Uses GlxContextHandler.
*/
class GlxWindowContext: public AbstractXWindowContext {
class GlxApplication: public AbstractXApplication {
public:
/**
* @brief Constructor
@ -41,7 +41,7 @@ class GlxWindowContext: public AbstractXWindowContext {
* Creates window with double-buffered OpenGL 3.2 core context or
* OpenGL ES 2.0 context, if targetting OpenGL ES.
*/
inline GlxWindowContext(int& argc, char** argv, const std::string& title = "Magnum GLX window context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600)): AbstractXWindowContext(new GlxContextHandler, argc, argv, title, size) {}
inline GlxApplication(int& argc, char** argv, const std::string& title = "Magnum GLX application", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600)): AbstractXApplication(new GlxContextHandler, argc, argv, title, size) {}
};
}}

2
src/Contexts/GlxContextHandler.cpp → src/Platform/GlxContextHandler.cpp

@ -22,7 +22,7 @@
#define None 0L // redef Xlib nonsense
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
VisualID GlxContextHandler::getVisualId(Display* nativeDisplay) {
display = nativeDisplay;

12
src/Contexts/GlxContextHandler.h → src/Platform/GlxContextHandler.h

@ -1,5 +1,5 @@
#ifndef Magnum_Contexts_GlxContextHandler_h
#define Magnum_Contexts_GlxContextHandler_h
#ifndef Magnum_Platform_GlxContextHandler_h
#define Magnum_Platform_GlxContextHandler_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
@ -16,7 +16,7 @@
*/
/** @file
* @brief Class Magnum::Contexts::GlxContextHandler
* @brief Class Magnum::Platform::GlxContextHandler
*/
#include "Magnum.h"
@ -29,15 +29,15 @@
#include "magnumCompatibility.h"
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
/**
@brief GLX interface
@brief GLX context
Creates OpenGL 3.2 core context or OpenGL ES 2.0 context, if targetting
OpenGL ES.
Used in GlxWindowContext.
Used in GlxApplication.
*/
class GlxContextHandler: public AbstractContextHandler<Display*, VisualID, Window> {
public:

10
src/Contexts/Sdl2WindowContext.cpp → src/Platform/Sdl2Application.cpp

@ -13,14 +13,14 @@
GNU Lesser General Public License version 3 for more details.
*/
#include "Sdl2WindowContext.h"
#include "Sdl2Application.h"
#include "Context.h"
#include "ExtensionWrangler.h"
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
Sdl2WindowContext::Sdl2WindowContext(int, char**, const std::string& name, const Math::Vector2<GLsizei>& size): _redraw(true) {
Sdl2Application::Sdl2Application(int, char**, const std::string& name, const Math::Vector2<GLsizei>& size): _redraw(true) {
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
Error() << "Cannot initialize SDL.";
exit(1);
@ -58,7 +58,7 @@ Sdl2WindowContext::Sdl2WindowContext(int, char**, const std::string& name, const
c = new Context;
}
Sdl2WindowContext::~Sdl2WindowContext() {
Sdl2Application::~Sdl2Application() {
delete c;
SDL_GL_DeleteContext(context);
@ -66,7 +66,7 @@ Sdl2WindowContext::~Sdl2WindowContext() {
SDL_Quit();
}
int Sdl2WindowContext::exec() {
int Sdl2Application::exec() {
for(;;) {
SDL_Event event;

38
src/Contexts/Sdl2WindowContext.h → src/Platform/Sdl2Application.h

@ -1,5 +1,5 @@
#ifndef Magnum_Contexts_Sdl2WindowContext_h
#define Magnum_Contexts_Sdl2WindowContext_h
#ifndef Magnum_Platform_Sdl2Application_h
#define Magnum_Platform_Sdl2Application_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
@ -16,7 +16,7 @@
*/
/** @file
* @brief Class Magnum::Contexts::Sdl2WindowContext
* @brief Class Magnum::Platform::Sdl2Application
*/
#include "Math/Vector2.h"
@ -26,7 +26,7 @@
#include <SDL2/SDL_scancode.h>
#include <Corrade/Containers/EnumSet.h>
#include "AbstractWindowContext.h"
#include "AbstractApplication.h"
#include "magnumCompatibility.h"
@ -34,17 +34,17 @@ namespace Magnum {
class Context;
namespace Contexts {
namespace Platform {
/** @nosubgrouping
@brief SDL2 context
@brief SDL2 application
Supports keyboard and mouse handling.
You need to implement at least drawEvent() and viewportEvent() to be able to
draw on the screen.
*/
class Sdl2WindowContext: public AbstractWindowContext {
class Sdl2Application: public AbstractApplication {
public:
/**
* @brief Constructor
@ -56,30 +56,30 @@ class Sdl2WindowContext: public AbstractWindowContext {
* Creates centered non-resizable window with double-buffered
* OpenGL 3.2 context with 24bit depth buffer.
*/
Sdl2WindowContext(int argc, char** argv, const std::string& title = "Magnum SDL2 window context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600));
Sdl2Application(int argc, char** argv, const std::string& title = "Magnum SDL2 application", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600));
/**
* @brief Destructor
*
* Deletes context and destroys the window.
*/
~Sdl2WindowContext();
~Sdl2Application();
int exec() override;
/** @{ @name Drawing functions */
protected:
/** @copydoc GlutWindowContext::viewportEvent() */
/** @copydoc GlutApplication::viewportEvent() */
virtual void viewportEvent(const Math::Vector2<GLsizei>& size) = 0;
/** @copydoc GlutWindowContext::drawEvent() */
/** @copydoc GlutApplication::drawEvent() */
virtual void drawEvent() = 0;
/** @copydoc GlutWindowContext::swapBuffers() */
/** @copydoc GlutApplication::swapBuffers() */
inline void swapBuffers() { SDL_GL_SwapWindow(window); }
/** @copydoc GlutWindowContext::redraw() */
/** @copydoc GlutApplication::redraw() */
inline void redraw() { _redraw = true; }
/*@}*/
@ -203,14 +203,14 @@ class Sdl2WindowContext: public AbstractWindowContext {
bool _redraw;
};
CORRADE_ENUMSET_OPERATORS(Sdl2WindowContext::Modifiers)
CORRADE_ENUMSET_OPERATORS(Sdl2Application::Modifiers)
/* Implementations for inline functions with unused parameters */
inline void Sdl2WindowContext::keyPressEvent(Key, Modifiers, const Math::Vector2<int>&) {}
inline void Sdl2WindowContext::keyReleaseEvent(Key, Modifiers, const Math::Vector2<int>&) {}
inline void Sdl2WindowContext::mousePressEvent(MouseButton, Modifiers, const Math::Vector2<int>&) {}
inline void Sdl2WindowContext::mouseReleaseEvent(MouseButton, Modifiers, const Math::Vector2<int>&) {}
inline void Sdl2WindowContext::mouseMotionEvent(Modifiers, const Math::Vector2<int>&) {}
inline void Sdl2Application::keyPressEvent(Key, Modifiers, const Math::Vector2<int>&) {}
inline void Sdl2Application::keyReleaseEvent(Key, Modifiers, const Math::Vector2<int>&) {}
inline void Sdl2Application::mousePressEvent(MouseButton, Modifiers, const Math::Vector2<int>&) {}
inline void Sdl2Application::mouseReleaseEvent(MouseButton, Modifiers, const Math::Vector2<int>&) {}
inline void Sdl2Application::mouseMotionEvent(Modifiers, const Math::Vector2<int>&) {}
}}

16
src/Contexts/XEglWindowContext.h → src/Platform/XEglApplication.h

@ -1,5 +1,5 @@
#ifndef Magnum_Contexts_XEglWindowContext_h
#define Magnum_Contexts_XEglWindowContext_h
#ifndef Magnum_Platform_XEglApplication_h
#define Magnum_Platform_XEglApplication_h
/*
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
@ -16,20 +16,20 @@
*/
/** @file
* @brief Class Magnum::Contexts::XEglWindowContext
* @brief Class Magnum::Platform::XEglApplication
*/
#include "AbstractXWindowContext.h"
#include "AbstractXApplication.h"
#include "EglContextHandler.h"
namespace Magnum { namespace Contexts {
namespace Magnum { namespace Platform {
/**
@brief X/EGL context
@brief X/EGL application
Uses EglContextHandler.
*/
class XEglWindowContext: public AbstractXWindowContext {
class XEglApplication: public AbstractXApplication {
public:
/**
* @brief Constructor
@ -40,7 +40,7 @@ class XEglWindowContext: public AbstractXWindowContext {
*
* Creates window with double-buffered OpenGL ES 2 context.
*/
inline XEglWindowContext(int& argc, char** argv, const std::string& title = "Magnum X/EGL window context", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600)): AbstractXWindowContext(new EglContextHandler, argc, argv, title, size) {}
inline XEglApplication(int& argc, char** argv, const std::string& title = "Magnum X/EGL application", const Math::Vector2<GLsizei>& size = Math::Vector2<GLsizei>(800, 600)): AbstractXApplication(new EglContextHandler, argc, argv, title, size) {}
};
}}

2
src/Profiler.h

@ -32,7 +32,7 @@ namespace Magnum {
@brief Measuring elapsed time in each frame
Measures time passed during specified sections of each frame. It's meant to be
used in rendering and event loops (e.g. Contexts::GlutContext::drawEvent()),
used in rendering and event loops (e.g. Platform::GlutApplication::drawEvent()),
but it's possible to use it standalone elsewhere. Example usage:
@code
Profiler p;

Loading…
Cancel
Save