Merge branch 'master' of github.com:AMDmi3/libSDL2pp

This commit is contained in:
Dmitry Marakasov 2013-12-18 06:22:47 +04:00
commit 151f9704ac
10 changed files with 18 additions and 8 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
# Ignore files generated by cmake
CMakeCache.txt
CMakeFiles/
Makefile
cmake_install.cmake
libSDL2pp.so

View File

@ -28,6 +28,9 @@ namespace SDL2pp {
Exception::Exception(const char* what) : what_(what), sdl_error_(SDL_GetError()) { Exception::Exception(const char* what) : what_(what), sdl_error_(SDL_GetError()) {
} }
Exception::~Exception() noexcept {
}
const char* Exception::what() const noexcept { const char* Exception::what() const noexcept {
return what_; return what_;
} }

View File

@ -33,6 +33,7 @@ private:
public: public:
Exception(const char* what = ""); Exception(const char* what = "");
virtual ~Exception() noexcept;
const char* what() const noexcept; const char* what() const noexcept;
const char* GetSDLError() const noexcept; const char* GetSDLError() const noexcept;
}; };

View File

@ -45,7 +45,7 @@ private:
public: public:
Point(int x, int y); Point(int x, int y);
~Point(); virtual ~Point();
static Point Null(); static Point Null();

View File

@ -37,7 +37,7 @@ private:
public: public:
Rect(int x, int y, int w, int h); Rect(int x, int y, int w, int h);
~Rect(); virtual ~Rect();
static Rect Null(); static Rect Null();

View File

@ -170,7 +170,7 @@ void Renderer::DrawRects(const Rect* rects, int count) {
void Renderer::FillRect(int x1, int y1, int x2, int y2) { void Renderer::FillRect(int x1, int y1, int x2, int y2) {
SDL_Rect rect = {x1, y1, x2 - x1 + 1, y2 - y1 + 1}; SDL_Rect rect = {x1, y1, x2 - x1 + 1, y2 - y1 + 1};
if (SDL_RenderDrawRect(renderer_, &rect) != 0) if (SDL_RenderFillRect(renderer_, &rect) != 0)
throw Exception("SDL_RenderFillRect failed"); throw Exception("SDL_RenderFillRect failed");
} }
@ -183,7 +183,7 @@ void Renderer::FillRect(const Point& p1, const Point& p2) {
void Renderer::FillRect(const Rect& r) { void Renderer::FillRect(const Rect& r) {
if (r.IsNull()) if (r.IsNull())
return; return;
if (SDL_RenderDrawRect(renderer_, r.Get()) != 0) if (SDL_RenderFillRect(renderer_, r.Get()) != 0)
throw Exception("SDL_RenderFillRect failed"); throw Exception("SDL_RenderFillRect failed");
} }

View File

@ -42,7 +42,7 @@ private:
public: public:
Renderer(Window& window, int index, Uint32 flags); Renderer(Window& window, int index, Uint32 flags);
~Renderer(); virtual ~Renderer();
Renderer(const Renderer& other) = delete; Renderer(const Renderer& other) = delete;
Renderer(Renderer&& other) = delete; Renderer(Renderer&& other) = delete;

View File

@ -29,7 +29,7 @@ namespace SDL2pp {
class SDL { class SDL {
public: public:
SDL(Uint32 flags); SDL(Uint32 flags);
~SDL(); virtual ~SDL();
SDL(const SDL& other) = delete; SDL(const SDL& other) = delete;
SDL(SDL&& other) = delete; SDL(SDL&& other) = delete;

View File

@ -38,7 +38,7 @@ private:
public: public:
Texture(Renderer& renderer, Uint32 format, int access, int w, int h); Texture(Renderer& renderer, Uint32 format, int access, int w, int h);
~Texture(); virtual ~Texture();
Texture(const Texture& other) = delete; Texture(const Texture& other) = delete;
Texture(Texture&& other) = delete; Texture(Texture&& other) = delete;

View File

@ -34,7 +34,7 @@ private:
public: public:
Window(const char* title, int x, int y, int w, int h, Uint32 flags); Window(const char* title, int x, int y, int w, int h, Uint32 flags);
~Window(); virtual ~Window();
Window(const Window& other) = delete; Window(const Window& other) = delete;
Window(Window&& other) = delete; Window(Window&& other) = delete;