diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-05-09 19:17:52 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:48 +0100 |
commit | 1d595f048c9e59bbff14217e2fe3821ee3e1aaa1 (patch) | |
tree | fe92fea4e73324bd3645afb52c681d103624b853 /src/utils | |
parent | 3ca6e32a9ecaa8514b9a30711cec20cf80722c23 (diff) | |
download | usdx-1d595f048c9e59bbff14217e2fe3821ee3e1aaa1.tar.gz usdx-1d595f048c9e59bbff14217e2fe3821ee3e1aaa1.tar.xz usdx-1d595f048c9e59bbff14217e2fe3821ee3e1aaa1.zip |
changed from SDL rendering to OpenGL
draw, repaint methods do not have the SDL_Surface* parameter anymore
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/dimension.cpp | 16 | ||||
-rw-r--r-- | src/utils/dimension.hpp | 13 | ||||
-rw-r--r-- | src/utils/rgb_color.cpp | 9 | ||||
-rw-r--r-- | src/utils/rgb_color.hpp | 1 |
4 files changed, 29 insertions, 10 deletions
diff --git a/src/utils/dimension.cpp b/src/utils/dimension.cpp index 11a1feb3..f83636ff 100644 --- a/src/utils/dimension.cpp +++ b/src/utils/dimension.cpp @@ -28,7 +28,7 @@ namespace usdx { - Dimension::Dimension(float width, float height) : + Dimension::Dimension(unsigned int width, unsigned int height) : width(width), height(height) { } @@ -38,13 +38,23 @@ namespace usdx { } - float Dimension::get_width(void) const + unsigned int Dimension::get_width(void) const { return width; } - float Dimension::get_height(void) const + void Dimension::set_width(unsigned int width) + { + this->width = width; + } + + unsigned int Dimension::get_height(void) const { return height; } + + void Dimension::set_height(unsigned int height) + { + this->height = height; + } }; diff --git a/src/utils/dimension.hpp b/src/utils/dimension.hpp index 656efefb..4518fbb8 100644 --- a/src/utils/dimension.hpp +++ b/src/utils/dimension.hpp @@ -32,14 +32,17 @@ namespace usdx class Dimension { private: - float width; - float height; + unsigned int width; + unsigned int height; public: - Dimension(float width, float height); + Dimension(unsigned int width, unsigned int height); Dimension(const Dimension& dimension); - float get_width(void) const; - float get_height(void) const; + unsigned int get_width(void) const; + void set_width(unsigned int width); + + unsigned int get_height(void) const; + void set_height(unsigned int height); }; }; diff --git a/src/utils/rgb_color.cpp b/src/utils/rgb_color.cpp index 04c10ba5..d470d495 100644 --- a/src/utils/rgb_color.cpp +++ b/src/utils/rgb_color.cpp @@ -28,8 +28,13 @@ namespace usdx { - RgbColor::RgbColor(float red, float green, float blue) : - red(red), green(green), blue(blue) + RgbColor::RgbColor(int red, int green, int blue) + : red(red / 255.0f), green(green / 255.0f), blue(blue / 255.0f) + { + } + + RgbColor::RgbColor(float red, float green, float blue) + : red(red), green(green), blue(blue) { } diff --git a/src/utils/rgb_color.hpp b/src/utils/rgb_color.hpp index f5b36e7a..dbc504cd 100644 --- a/src/utils/rgb_color.hpp +++ b/src/utils/rgb_color.hpp @@ -36,6 +36,7 @@ namespace usdx float green; float blue; public: + RgbColor(int red, int green, int blue); RgbColor(float red, float green, float blue); float get_red(void) const; |