From e64584cbdf9749b9f2ac78edfe1c65a576a29495 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 22 Mar 2012 16:59:41 +0100 Subject: menu/application: removed display width/height, use DrawableControl::size --- src/menu/application.cpp | 36 +++++++++++++----------------------- src/menu/application.hpp | 6 ------ 2 files changed, 13 insertions(+), 29 deletions(-) (limited to 'src') 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; diff --git a/src/menu/application.hpp b/src/menu/application.hpp index efd99533..72e5f3a3 100644 --- a/src/menu/application.hpp +++ b/src/menu/application.hpp @@ -49,9 +49,6 @@ namespace usdx bool running; - int display_width; - int display_height; - int frames_per_second; /** @@ -76,9 +73,6 @@ namespace usdx const Frame* get_current_frame(void) const; void set_current_frame(Frame* new_frame); - const int get_display_width(void) const; - const int get_display_height(void) const; - const int get_frames_per_second(void) const; void set_frames_per_second(int fps); }; -- cgit v1.2.3