Browse Source

Platform: completed documentation review.

Fixed Doxygen errors, updated links to GLUT/SDL2 bootstrap, unified
MAGNUM_*_APPLICATION() macro argument naming.
pull/54/merge
Vladimír Vondruš 12 years ago
parent
commit
5ba4a6b603
  1. 2
      src/Magnum/Platform/AndroidApplication.h
  2. 20
      src/Magnum/Platform/GlutApplication.h
  3. 15
      src/Magnum/Platform/GlxApplication.h
  4. 8
      src/Magnum/Platform/NaClApplication.h
  5. 8
      src/Magnum/Platform/Screen.h
  6. 20
      src/Magnum/Platform/ScreenedApplication.h
  7. 18
      src/Magnum/Platform/Sdl2Application.h
  8. 2
      src/Magnum/Platform/WindowlessGlxApplication.h
  9. 8
      src/Magnum/Platform/WindowlessNaClApplication.h
  10. 2
      src/Magnum/Platform/WindowlessWglApplication.h
  11. 15
      src/Magnum/Platform/XEglApplication.h

2
src/Magnum/Platform/AndroidApplication.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class @ref Magnum::Platform::AndroidApplication
* @brief Class @ref Magnum::Platform::AndroidApplication, macro @ref MAGNUM_ANDROIDAPPLICATION_MAIN()
*/
#include <memory>

20
src/Magnum/Platform/GlutApplication.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class @ref Magnum::Platform::GlutApplication
* @brief Class @ref Magnum::Platform::GlutApplication, macro @ref MAGNUM_GLUTAPPLICATION_MAIN()
*/
#include <string>
@ -58,10 +58,10 @@ enabled in CMake.
## Bootstrap application
Fully contained base application using @ref GlutApplication along with
CMake setup is available in `base` branch of
CMake setup is available in `base-glut` branch of
[Magnum Bootstrap](https://github.com/mosra/magnum-bootstrap) repository,
download it as [tar.gz](https://github.com/mosra/magnum-bootstrap/archive/base.tar.gz)
or [zip](https://github.com/mosra/magnum-bootstrap/archive/base.zip) file.
download it as [tar.gz](https://github.com/mosra/magnum-bootstrap/archive/base-glut.tar.gz)
or [zip](https://github.com/mosra/magnum-bootstrap/archive/base-glut.zip) file.
After extracting the downloaded archive you can build and run the application
with these four commands:
@ -197,7 +197,7 @@ class GlutApplication {
/**
* @brief Mouse cursor
*
* @see setMouseCursor()
* @see @ref setMouseCursor()
*/
enum class MouseCursor: int {
Default = GLUT_CURSOR_INHERIT, /**< Default cursor provided by parent window */
@ -281,16 +281,16 @@ Double-buffered RGBA window with depth and stencil buffers.
class GlutApplication::Configuration {
public:
/**
* @brief Context flag
* @brief %Context flag
*
* @see @ref Flags @ref setFlags()
* @see @ref Flags, @ref setFlags()
*/
enum class Flag: int {
Debug = GLUT_DEBUG /**< Create debug context */
};
/**
* @brief Context flags
* @brief %Context flags
*
* @see @ref setFlags()
*/
@ -331,7 +331,7 @@ class GlutApplication::Configuration {
return *this;
}
/** @brief Context flags */
/** @brief %Context flags */
Flags flags() const { return _flags; }
/**
@ -345,7 +345,7 @@ class GlutApplication::Configuration {
return *this;
}
/** @brief Context version */
/** @brief %Context version */
Version version() const { return _version; }
/**

15
src/Magnum/Platform/GlxApplication.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class @ref Magnum::Platform::GlxApplication
* @brief Class @ref Magnum::Platform::GlxApplication, macro @ref MAGNUM_GLXAPPLICATION_MAIN()
*/
#include "Magnum/Platform/AbstractXApplication.h"
@ -76,7 +76,18 @@ to simplify porting.
*/
class GlxApplication: public AbstractXApplication {
public:
/** @copydoc Sdl2Application::Sdl2Application(const Arguments&, const Configuration&) */
/**
* @brief Default constructor
* @param arguments Application arguments
* @param configuration %Configuration
*
* Creates application with default or user-specified configuration.
* See @ref AbstractXApplication::Configuration "Configuration" for
* more information. The program exits if the context cannot be
* created, see below for an alternative.
* @todoc make this copydoc from Sdl2Application when Doxygen is able
* to find Configuration subclass
*/
explicit GlxApplication(const Arguments& arguments, const Configuration& configuration = Configuration());
/** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */

8
src/Magnum/Platform/NaClApplication.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class @ref Magnum::Platform::NaClApplication
* @brief Class @ref Magnum::Platform::NaClApplication, macro @ref MAGNUM_NACLAPPLICATION_MAIN()
*/
#include <string>
@ -727,7 +727,7 @@ namespace Implementation {
/** @hideinitializer
@brief Entry point for NaCl application
@param application Application class name
@param className Class name
See @ref Magnum::Platform::NaClApplication "Platform::NaClApplication" for
usage information. This macro abstracts out platform-specific entry point code
@ -736,11 +736,11 @@ usage information. This macro abstracts out platform-specific entry point code
header is included this macro is also aliased to `MAGNUM_APPLICATION_MAIN()`.
*/
/* look at that insane placement of __attribute__. WTF. */
#define MAGNUM_NACLAPPLICATION_MAIN(application) \
#define MAGNUM_NACLAPPLICATION_MAIN(className) \
namespace pp { \
Module __attribute__ ((visibility ("default"))) * CreateModule(); \
Module __attribute__ ((visibility ("default"))) * CreateModule() { \
return new Magnum::Platform::Implementation::NaClModule<application>(); \
return new Magnum::Platform::Implementation::NaClModule<className>(); \
} \
}

8
src/Magnum/Platform/Screen.h

@ -82,16 +82,16 @@ template<class Application> class BasicScreen: private Containers::LinkedListIte
/**
* Draw event.
*
* When enabled, drawEvent() is propagated to this screen.
* When enabled, @ref drawEvent() is propagated to this screen.
*/
Draw = 1 << 0,
/**
* Input events.
*
* When enabled, keyPressEvent(), keyReleaseEvent(), mousePressEvent(),
* mouseReleaseEvent() and mouseMoveEvent() are propagated to this
* screen.
* When enabled, @ref keyPressEvent(), @ref keyReleaseEvent(),
* @ref mousePressEvent(), @ref mouseReleaseEvent() and
* @ref mouseMoveEvent() are propagated to this screen.
*/
Input = 1 << 1
};

20
src/Magnum/Platform/ScreenedApplication.h

@ -94,10 +94,26 @@ template<class Application> class BasicScreenedApplication: public Application,
friend class BasicScreen<Application>;
public:
/** @copydoc Sdl2Application::Sdl2Application(const Arguments, const Configuration&) */
/**
* @brief Default constructor
* @param arguments Application arguments
* @param configuration %Configuration
*
* Creates application with default or user-specified configuration.
* See @ref Sdl2Application::Configuration "Configuration" for more
* information. The program exits if the context cannot be created, see
* below for an alternative.
*/
explicit BasicScreenedApplication(const typename Application::Arguments& arguments, const typename Application::Configuration& configuration = Application::Configuration());
/** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */
/**
* @brief Constructor
* @param arguments Application arguments
*
* Unlike above, the context is not created and must be created later
* with @ref Sdl2Application::createContext() "createContext()" or
* @ref Sdl2Application::tryCreateContext() "tryCreateContext()".
*/
explicit BasicScreenedApplication(const typename Application::Arguments& arguments, std::nullptr_t);
/**

18
src/Magnum/Platform/Sdl2Application.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class @ref Magnum::Platform::Sdl2Application
* @brief Class @ref Magnum::Platform::Sdl2Application, macro @ref MAGNUM_SDL2APPLICATION_MAIN()
*/
#include <Corrade/Containers/EnumSet.h>
@ -64,10 +64,10 @@ on **SDL2** library (Emscripten has it built in) and is built if
## Bootstrap application
Fully contained base application using @ref Sdl2Application along with
CMake setup is available in `base-sdl2` branch of
CMake setup is available in `base` branch of
[Magnum Bootstrap](https://github.com/mosra/magnum-bootstrap) repository,
download it as [tar.gz](https://github.com/mosra/magnum-bootstrap/archive/base-sdl2.tar.gz)
or [zip](https://github.com/mosra/magnum-bootstrap/archive/base-sdl2.zip) file.
download it as [tar.gz](https://github.com/mosra/magnum-bootstrap/archive/base.tar.gz)
or [zip](https://github.com/mosra/magnum-bootstrap/archive/base.zip) file.
After extracting the downloaded archive you can build and run the application
with these four commands:
@ -425,10 +425,10 @@ class Sdl2Application::Configuration {
public:
#ifndef CORRADE_TARGET_EMSCRIPTEN
/**
* @brief Context flag
* @brief %Context flag
*
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
* @see @ref Flags @ref setFlags()
* @see @ref Flags, @ref setFlags()
* @todo re-enable when Emscripten has proper SDL2 support
*/
enum class Flag: int {
@ -439,7 +439,7 @@ class Sdl2Application::Configuration {
};
/**
* @brief Context flags
* @brief %Context flags
*
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
* @see @ref setFlags()
@ -539,7 +539,7 @@ class Sdl2Application::Configuration {
#ifndef CORRADE_TARGET_EMSCRIPTEN
/**
* @brief Context flags
* @brief %Context flags
*
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
*/
@ -558,7 +558,7 @@ class Sdl2Application::Configuration {
}
/**
* @brief Context version
* @brief %Context version
*
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
*/

2
src/Magnum/Platform/WindowlessGlxApplication.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class @ref Magnum::Platform::WindowlessGlxApplication
* @brief Class @ref Magnum::Platform::WindowlessGlxApplication, macro @ref MAGNUM_WINDOWLESSGLXAPPLICATION_MAIN()
*/
#include "Magnum/OpenGL.h"

8
src/Magnum/Platform/WindowlessNaClApplication.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class @ref Magnum::Platform::WindowlessNaClApplication
* @brief Class @ref Magnum::Platform::WindowlessNaClApplication, macro @ref MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN()
*/
#include <string>
@ -204,7 +204,7 @@ namespace Implementation {
/** @hideinitializer
@brief Entry point for windowless NaCl application
@param application Application class name
@param className Class name
See @ref Magnum::Platform::WindowlessNaClApplication "Platform::WindowlessNaClApplication"
for usage information. This macro abstracts out platform-specific entry point
@ -214,11 +214,11 @@ application header is included this macro is also aliased to
`MAGNUM_WINDOWLESSAPPLICATION_MAIN()`.
*/
/* look at that insane placement of __attribute__. WTF. */
#define MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN(application) \
#define MAGNUM_WINDOWLESSNACLAPPLICATION_MAIN(className) \
namespace pp { \
Module __attribute__ ((visibility ("default"))) * CreateModule(); \
Module __attribute__ ((visibility ("default"))) * CreateModule() { \
return new Magnum::Platform::Implementation::WindowlessNaClModule<application>(); \
return new Magnum::Platform::Implementation::WindowlessNaClModule<className>(); \
} \
}

2
src/Magnum/Platform/WindowlessWglApplication.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class @ref Magnum::Platform::WindowlessWglApplication
* @brief Class @ref Magnum::Platform::WindowlessWglApplication, macro @ref MAGNUM_WINDOWLESSWGLAPPLICATION_MAIN()
*/
#include "Magnum/OpenGL.h"

15
src/Magnum/Platform/XEglApplication.h

@ -26,7 +26,7 @@
*/
/** @file
* @brief Class @ref Magnum::Platform::XEglApplication
* @brief Class @ref Magnum::Platform::XEglApplication, macro @ref MAGNUM_XEGLAPPLICATION_MAIN()
*/
#include "Magnum/Platform/Platform.h"
@ -76,7 +76,18 @@ to simplify porting.
*/
class XEglApplication: public AbstractXApplication {
public:
/** @copydoc Sdl2Application::Sdl2Application(const Arguments&, const Configuration&) */
/**
* @brief Default constructor
* @param arguments Application arguments
* @param configuration %Configuration
*
* Creates application with default or user-specified configuration.
* See @ref AbstractXApplication::Configuration "Configuration" for
* more information. The program exits if the context cannot be
* created, see below for an alternative.
* @todoc make this copydoc from Sdl2Application when Doxygen is able
* to find Configuration subclass
*/
explicit XEglApplication(const Arguments& arguments, const Configuration& configuration = Configuration());
/** @copydoc Sdl2Application::Sdl2Application(const Arguments&, std::nullptr_t) */

Loading…
Cancel
Save