Merge branch 'master' into doxygen

Conflicts:
	SDL2pp/Texture.hh
This commit is contained in:
Dmitry Marakasov 2014-12-26 21:45:34 +03:00
commit e67394628c
5 changed files with 51 additions and 4 deletions

View File

@ -116,7 +116,7 @@ IF(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# library
ADD_LIBRARY(SDL2pp SHARED ${LIBRARY_SOURCES} ${LIBRARY_HEADERS})
TARGET_LINK_LIBRARIES(SDL2pp ${SDL2_ALL_LIBRARIES})
SET_TARGET_PROPERTIES(SDL2pp PROPERTIES VERSION 1.0.0 SOVERSION 1)
SET_TARGET_PROPERTIES(SDL2pp PROPERTIES VERSION 2.0.0 SOVERSION 2)
# examples and tests
OPTION(SDL2PP_WITH_EXAMPLES "Build examples" ON)

View File

@ -36,7 +36,6 @@ namespace SDL2pp {
class Window;
class Texture;
class Rect;
class Point;
////////////////////////////////////////////////////////////

View File

@ -28,6 +28,7 @@
#include <SDL2/SDL_blendmode.h>
#include <SDL2pp/Optional.hh>
#include <SDL2pp/Rect.hh>
#include <SDL2pp/Config.hh>
struct SDL_Texture;
@ -35,7 +36,6 @@ struct SDL_Texture;
namespace SDL2pp {
class Renderer;
class Rect;
class RWops;
////////////////////////////////////////////////////////////
@ -286,7 +286,7 @@ public:
/// \return Lock handle used to access pixel data and to control lock lifetime
///
////////////////////////////////////////////////////////////
LockHandle Lock(const Optional<Rect>& rect);
LockHandle Lock(const Optional<Rect>& rect = NullOpt);
////////////////////////////////////////////////////////////
/// \brief Get texture format

View File

@ -76,4 +76,41 @@ SDL_Window* Window::Get() const {
return window_;
}
void Window::Maximize() {
SDL_MaximizeWindow(window_);
}
void Window::Minimize() {
SDL_MinimizeWindow(window_);
}
void Window::Hide() {
SDL_HideWindow(window_);
}
void Window::Restore() {
SDL_RestoreWindow(window_);
}
void Window::Raise() {
SDL_RaiseWindow(window_);
}
void Window::Show() {
SDL_ShowWindow(window_);
}
void Window::SetFullscreen(int flags) {
if (SDL_SetWindowFullscreen(window_, flags) != 0)
throw Exception("SDL_SetWindowFullscreen failed");
}
void Window::SetSize(int w, int h) {
SDL_SetWindowSize(window_, w, h);
}
void Window::SetSize(const Point& size) {
SDL_SetWindowSize(window_, size.x, size.y);
}
}

View File

@ -145,6 +145,17 @@ public:
///
////////////////////////////////////////////////////////////
SDL_Window* Get() const;
void Maximize();
void Minimize();
void Hide();
void Restore();
void Raise();
void Show();
void SetFullscreen(int flags);
void SetSize(int w, int h);
void SetSize(const Point& size);
};
}