aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/application.cpp
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-03-22 16:59:41 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:51 +0100
commite64584cbdf9749b9f2ac78edfe1c65a576a29495 (patch)
tree80e25abc48af9b8525300a62e34cd490a862c64a /src/menu/application.cpp
parentd11ead2f05a8e52b36e3961d2f583757b99464bc (diff)
downloadusdx-e64584cbdf9749b9f2ac78edfe1c65a576a29495.tar.gz
usdx-e64584cbdf9749b9f2ac78edfe1c65a576a29495.tar.xz
usdx-e64584cbdf9749b9f2ac78edfe1c65a576a29495.zip
menu/application: removed display width/height, use DrawableControl::size
Diffstat (limited to 'src/menu/application.cpp')
-rw-r--r--src/menu/application.cpp36
1 files changed, 13 insertions, 23 deletions
diff --git a/src/menu/application.cpp b/src/menu/application.cpp
index 9f3b6b2d..28862a8c 100644
--- a/src/menu/application.cpp
+++ b/src/menu/application.cpp
@@ -40,11 +40,11 @@ namespace usdx
Application* Application::instance = NULL;
Application::Application(Container* parent)
- : Container(parent), display(NULL), frame(NULL),
- fps_manager(NULL), running(false), display_width(800),
- display_height(600), frames_per_second(50)
+ : Container(parent), display(NULL), fps_manager(NULL),
+ running(false), frames_per_second(50)
{
- log4cpp::PropertyConfigurator::configure("log4cpp.property");
+ set_size(800, 600);
+ log4cpp::PropertyConfigurator::configure("log4cpp.property");
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);
}
@@ -155,18 +155,18 @@ namespace usdx
SDL_putenv(test);
// create screen
- display = SDL_SetVideoMode(display_width,
- display_height,
- 24,
- SDL_OPENGL);
+ display = SDL_SetVideoMode(get_width(),
+ get_height(),
+ 24,
+ SDL_OPENGL);
- glEnable( GL_TEXTURE_2D );
+ glEnable(GL_TEXTURE_2D);
- glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
+ glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- glViewport( 0, 0, display_width, display_height );
+ glViewport(0, 0, get_width(), get_height());
- glClear( GL_COLOR_BUFFER_BIT );
+ glClear(GL_COLOR_BUFFER_BIT);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -175,7 +175,7 @@ namespace usdx
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
- glOrtho(0.0f, display_width, display_height, 0.0f, -1.0f, 1.0f);
+ glOrtho(0.0f, get_width(), get_height(), 0.0f, -1.0f, 1.0f);
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
@@ -197,16 +197,6 @@ namespace usdx
SDL_ShowCursor(SDL_ENABLE);
}
- const int Application::get_display_width(void) const
- {
- return display_width;
- }
-
- const int Application::get_display_height(void) const
- {
- return display_height;
- }
-
const int Application::get_frames_per_second(void) const
{
return frames_per_second;