mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-09-01 01:49:17 -04:00
Merge branch 'master' of github.com:AMDmi3/libSDL2pp
This commit is contained in:
commit
151f9704ac
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
# Ignore files generated by cmake
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles/
|
||||||
|
Makefile
|
||||||
|
cmake_install.cmake
|
||||||
|
libSDL2pp.so
|
@ -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_;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
};
|
};
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user