Browse Source

Platform: more intuitive argc/argv Arguments structure.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
f0958647c1
  1. 5
      src/Platform/AbstractXApplication.h
  2. 4
      src/Platform/GlutApplication.cpp
  3. 5
      src/Platform/GlutApplication.h
  4. 5
      src/Platform/Sdl2Application.h
  5. 5
      src/Platform/WindowlessGlxApplication.h

5
src/Platform/AbstractXApplication.h

@ -56,7 +56,10 @@ Supports keyboard and mouse handling. See @ref platform for brief introduction.
class AbstractXApplication {
public:
/** @brief Application arguments */
typedef std::pair<int&, char**> Arguments;
struct Arguments {
int& argc; /**< @brief Argument count */
char** argv; /**< @brief Argument values */
};
class Configuration;
class InputEvent;

4
src/Platform/GlutApplication.cpp

@ -32,12 +32,12 @@ namespace Magnum { namespace Platform {
GlutApplication* GlutApplication::instance = nullptr;
GlutApplication::GlutApplication(const Arguments& arguments): c(nullptr) {
initialize(arguments.first, arguments.second);
initialize(arguments.argc, arguments.argv);
createContext(new Configuration);
}
GlutApplication::GlutApplication(const Arguments& arguments, Configuration* configuration): c(nullptr) {
initialize(arguments.first, arguments.second);
initialize(arguments.argc, arguments.argv);
if(configuration) createContext(configuration);
}

5
src/Platform/GlutApplication.h

@ -68,7 +68,10 @@ to simplify porting.
class GlutApplication {
public:
/** @brief Application arguments */
typedef std::pair<int&, char**> Arguments;
struct Arguments {
int& argc; /**< @brief Argument count */
char** argv; /**< @brief Argument values */
};
class Configuration;
class InputEvent;

5
src/Platform/Sdl2Application.h

@ -69,7 +69,10 @@ to simplify porting.
class Sdl2Application {
public:
/** @brief Application arguments */
typedef std::pair<int&, char**> Arguments;
struct Arguments {
int& argc; /**< @brief Argument count */
char** argv; /**< @brief Argument values */
};
class Configuration;
class InputEvent;

5
src/Platform/WindowlessGlxApplication.h

@ -66,7 +66,10 @@ If no other application header is included this class is also aliased to
class WindowlessGlxApplication {
public:
/** @brief Application arguments */
typedef std::pair<int&, char**> Arguments;
struct Arguments {
int& argc; /**< @brief Argument count */
char** argv; /**< @brief Argument values */
};
class Configuration;

Loading…
Cancel
Save