Browse Source

Merge branch 'master' into compatibility

Vladimír Vondruš 13 years ago
parent
commit
d696500933
  1. 35
      doc/platform.dox
  2. 2
      src/Platform/AbstractXApplication.cpp
  3. 4
      src/Platform/AbstractXApplication.h
  4. 2
      src/Platform/GlutApplication.cpp
  5. 2
      src/Platform/GlutApplication.h
  6. 2
      src/Platform/NaClApplication.cpp
  7. 2
      src/Platform/NaClApplication.h
  8. 2
      src/Platform/Sdl2Application.cpp
  9. 2
      src/Platform/Sdl2Application.h
  10. 2
      src/Platform/WindowlessGlxApplication.cpp
  11. 2
      src/Platform/WindowlessGlxApplication.h
  12. 2
      src/Platform/WindowlessNaClApplication.cpp

35
doc/platform.dox

@ -147,8 +147,10 @@ window size 800x600 pixels). If you want something else, you can pass
constructor. Using method chaining it can be done conveniently like this: constructor. Using method chaining it can be done conveniently like this:
@code @code
MyApplication::MyApplication(int& argc, char** argv): MyApplication::MyApplication(int& argc, char** argv):
Platform::GlutApplication(argc, argv, (new Configuration) Platform::GlutApplication(argc, argv, Configuration()
->setTitle("My Application")->setSize({800, 600}) { .setTitle("My Application")
.setSize({800, 600})
{
// ... // ...
} }
@endcode @endcode
@ -161,33 +163,30 @@ instead of Configuration instance and then specify it later with
MyApplication::MyApplication(int& argc, char** argv): Platform::GlutApplication(argc, argv, nullptr) { MyApplication::MyApplication(int& argc, char** argv): Platform::GlutApplication(argc, argv, nullptr) {
// ... // ...
createContext((new Configuration) createContext(Configuration()
->setTitle("My Application") .setTitle("My Application")
->setSize(size)); .setSize(size));
// ... // ...
} }
@endcode @endcode
The configuration passed to constructor and @ref GlutApplication::createContext() "createContext()" If the context creation in constructor or @ref GlutApplication::createContext() "createContext()"
is automaticall deleted afterwards and if the context creation fails, the fails, the application exits. However, it is also possible to negotiate the
application exits. However, it is also possible to negotiate the context using context using @ref GlutApplication::tryCreateContext() "tryCreateContext()". The
@ref GlutApplication::tryCreateContext() "tryCreateContext()". The major only difference is that this function returns `false` instead of exiting. You
difference is that this function returns `false` instead of exiting and it can for example try enabling MSAA and if the context creation fails, fall back
doesn't delete the configuration afterwards so you can reuse it. You can for to no-AA rendering:
example try enabling MSAA and if the context creation fails, fall back to
no-AA rendering:
@code @code
MyApplication::MyApplication(int& argc, char** argv): Platform::GlutApplication(argc, argv, nullptr) { MyApplication::MyApplication(int& argc, char** argv): Platform::GlutApplication(argc, argv, nullptr) {
// ... // ...
auto conf = new Configuration; Configuration conf;
conf->setTitle("My Application") conf.setTitle("My Application")
->setSampleCount(16); .setSampleCount(16);
if(!tryCreateContext(conf)) if(!tryCreateContext(conf))
createContext(conf->setSampleCount(0)); createContext(conf.setSampleCount(0));
else delete conf;
// ... // ...
} }

2
src/Platform/AbstractXApplication.cpp

@ -42,9 +42,11 @@ AbstractXApplication::AbstractXApplication(AbstractContextHandler<Display*, Visu
createContext(configuration); createContext(configuration);
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
AbstractXApplication::AbstractXApplication(AbstractContextHandler<Display*, VisualID, Window>* contextHandler, const Arguments&): contextHandler(contextHandler), c(nullptr), flags(Flag::Redraw) { AbstractXApplication::AbstractXApplication(AbstractContextHandler<Display*, VisualID, Window>* contextHandler, const Arguments&): contextHandler(contextHandler), c(nullptr), flags(Flag::Redraw) {
createContext({}); createContext({});
} }
#endif
#ifndef CORRADE_GCC45_COMPATIBILITY #ifndef CORRADE_GCC45_COMPATIBILITY
AbstractXApplication::AbstractXApplication(AbstractContextHandler<Display*, VisualID, Window>* contextHandler, const Arguments&, std::nullptr_t) AbstractXApplication::AbstractXApplication(AbstractContextHandler<Display*, VisualID, Window>* contextHandler, const Arguments&, std::nullptr_t)

4
src/Platform/AbstractXApplication.h

@ -72,6 +72,7 @@ class AbstractXApplication {
* @brief Default constructor * @brief Default constructor
* @param contextHandler OpenGL context handler * @param contextHandler OpenGL context handler
* @param arguments Application arguments * @param arguments Application arguments
* @param configuration %Configuration
* *
* Creates application with default or user-specified configuration. * Creates application with default or user-specified configuration.
* See Configuration for more information. The program exits if the * See Configuration for more information. The program exits if the
@ -89,7 +90,6 @@ class AbstractXApplication {
* @brief Constructor * @brief Constructor
* @param contextHandler OpenGL context handler * @param contextHandler OpenGL context handler
* @param arguments Application arguments * @param arguments Application arguments
* @param configuration Configuration
* *
* Unlike above, the context is not created and must be created later * Unlike above, the context is not created and must be created later
* with createContext() or tryCreateContext(). * with createContext() or tryCreateContext().
@ -200,7 +200,7 @@ class AbstractXApplication::Configuration {
Configuration& operator=(Configuration&&) = delete; Configuration& operator=(Configuration&&) = delete;
public: public:
explicit Configuration(); /*implicit*/ Configuration();
~Configuration(); ~Configuration();
/** @brief Window title */ /** @brief Window title */

2
src/Platform/GlutApplication.cpp

@ -38,10 +38,12 @@ GlutApplication::GlutApplication(const Arguments& arguments, const Configuration
createContext(configuration); createContext(configuration);
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
GlutApplication::GlutApplication(const Arguments& arguments): c(nullptr) { GlutApplication::GlutApplication(const Arguments& arguments): c(nullptr) {
initialize(arguments.argc, arguments.argv); initialize(arguments.argc, arguments.argv);
createContext({}); createContext({});
} }
#endif
#ifndef CORRADE_GCC45_COMPATIBILITY #ifndef CORRADE_GCC45_COMPATIBILITY
GlutApplication::GlutApplication(const Arguments& arguments, std::nullptr_t) GlutApplication::GlutApplication(const Arguments& arguments, std::nullptr_t)

2
src/Platform/GlutApplication.h

@ -286,7 +286,7 @@ class GlutApplication::Configuration {
Configuration& operator=(Configuration&&) = delete; Configuration& operator=(Configuration&&) = delete;
public: public:
explicit Configuration(); /*implicit*/ Configuration();
~Configuration(); ~Configuration();
/** @brief Window title */ /** @brief Window title */

2
src/Platform/NaClApplication.cpp

@ -56,10 +56,12 @@ NaClApplication::NaClApplication(const Arguments& arguments, const Configuration
createContext(configuration); createContext(configuration);
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
NaClApplication::NaClApplication(const Arguments& arguments): Instance(arguments), Graphics3DClient(this), MouseLock(this), c(nullptr) { NaClApplication::NaClApplication(const Arguments& arguments): Instance(arguments), Graphics3DClient(this), MouseLock(this), c(nullptr) {
debugOutput = new ConsoleDebugOutput(this); debugOutput = new ConsoleDebugOutput(this);
createContext({}); createContext({});
} }
#endif
#ifndef CORRADE_GCC45_COMPATIBILITY #ifndef CORRADE_GCC45_COMPATIBILITY
NaClApplication::NaClApplication(const Arguments& arguments, std::nullptr_t) NaClApplication::NaClApplication(const Arguments& arguments, std::nullptr_t)

2
src/Platform/NaClApplication.h

@ -312,7 +312,7 @@ class NaClApplication::Configuration {
Configuration& operator=(Configuration&&) = delete; Configuration& operator=(Configuration&&) = delete;
public: public:
constexpr explicit Configuration(): _size(640, 480), _sampleCount(0) {} constexpr /*implicit*/ Configuration(): _size(640, 480), _sampleCount(0) {}
/** @brief Window size */ /** @brief Window size */
Vector2i size() const { return _size; } Vector2i size() const { return _size; }

2
src/Platform/Sdl2Application.cpp

@ -54,10 +54,12 @@ Sdl2Application::Sdl2Application(const Arguments&, const Configuration& configur
createContext(configuration); createContext(configuration);
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
Sdl2Application::Sdl2Application(const Arguments&): context(nullptr), flags(Flag::Redraw) { Sdl2Application::Sdl2Application(const Arguments&): context(nullptr), flags(Flag::Redraw) {
initialize(); initialize();
createContext({}); createContext({});
} }
#endif
#ifndef CORRADE_GCC45_COMPATIBILITY #ifndef CORRADE_GCC45_COMPATIBILITY
Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t)

2
src/Platform/Sdl2Application.h

@ -233,7 +233,7 @@ class Sdl2Application::Configuration {
SDL_WINDOW_FULLSCREEN|SDL_WINDOW_HIDDEN|SDL_WINDOW_MAXIMIZED| SDL_WINDOW_FULLSCREEN|SDL_WINDOW_HIDDEN|SDL_WINDOW_MAXIMIZED|
SDL_WINDOW_MINIMIZED|SDL_WINDOW_INPUT_GRABBED> Flags; SDL_WINDOW_MINIMIZED|SDL_WINDOW_INPUT_GRABBED> Flags;
explicit Configuration(); /*implicit*/ Configuration();
~Configuration(); ~Configuration();
/** @brief Window title */ /** @brief Window title */

2
src/Platform/WindowlessGlxApplication.cpp

@ -39,10 +39,12 @@ WindowlessGlxApplication::WindowlessGlxApplication(const Arguments&, const Confi
createContext(configuration); createContext(configuration);
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
WindowlessGlxApplication::WindowlessGlxApplication(const Arguments&): c(nullptr) { WindowlessGlxApplication::WindowlessGlxApplication(const Arguments&): c(nullptr) {
/* GCC 4.5 can't handle {} here (wtf) */ /* GCC 4.5 can't handle {} here (wtf) */
createContext(Configuration()); createContext(Configuration());
} }
#endif
#ifndef CORRADE_GCC45_COMPATIBILITY #ifndef CORRADE_GCC45_COMPATIBILITY
WindowlessGlxApplication::WindowlessGlxApplication(const Arguments&, std::nullptr_t) WindowlessGlxApplication::WindowlessGlxApplication(const Arguments&, std::nullptr_t)

2
src/Platform/WindowlessGlxApplication.h

@ -123,7 +123,7 @@ class WindowlessGlxApplication::Configuration {
Configuration& operator=(Configuration&&) = delete; Configuration& operator=(Configuration&&) = delete;
public: public:
explicit Configuration(); /*implicit*/ Configuration();
~Configuration(); ~Configuration();
}; };

2
src/Platform/WindowlessNaClApplication.cpp

@ -55,10 +55,12 @@ WindowlessNaClApplication::WindowlessNaClApplication(const Arguments& arguments,
createContext(configuration); createContext(configuration);
} }
#ifndef DOXYGEN_GENERATING_OUTPUT
WindowlessNaClApplication::WindowlessNaClApplication(const Arguments& arguments): Instance(arguments), Graphics3DClient(this), c(nullptr) { WindowlessNaClApplication::WindowlessNaClApplication(const Arguments& arguments): Instance(arguments), Graphics3DClient(this), c(nullptr) {
debugOutput = new ConsoleDebugOutput(this); debugOutput = new ConsoleDebugOutput(this);
createContext({}); createContext({});
} }
#endif
#ifndef CORRADE_GCC45_COMPATIBILITY #ifndef CORRADE_GCC45_COMPATIBILITY
WindowlessNaClApplication::WindowlessNaClApplication(const Arguments& arguments, std::nullptr_t) WindowlessNaClApplication::WindowlessNaClApplication(const Arguments& arguments, std::nullptr_t)

Loading…
Cancel
Save