summaryrefslogtreecommitdiffstats
path: root/video.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'video.cpp')
-rw-r--r--video.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/video.cpp b/video.cpp
index db153c7..2425b10 100644
--- a/video.cpp
+++ b/video.cpp
@@ -4,12 +4,15 @@
#include <exception>
#include <cstdint>
+#include <vector>
+
extern "C" {
#include <SDL2/SDL.h>
}
using namespace wsdl2;
+
/* class window */
window::window(const std::string& title, std::size_t width, std::size_t height) {
@@ -64,6 +67,18 @@ void window::update() {
m_renderer.present();
}
+SDL_Window * window::sdl() {
+#ifndef DEBUG
+ if (m_window == NULL) {
+ throw std::runtime_error(
+ "attempted to call window::sdl() when m_window is NULL"
+ );
+ }
+#endif
+
+ return m_window;
+}
+
/* class renderer */
@@ -71,10 +86,12 @@ renderer::renderer() {
npdebug("warning: created uninitialized renderer object");
}
-SDL_Renderer * renderer::safe() {
-#ifndef WRAPSDL2_UNSAFE
+SDL_Renderer * renderer::sdl() {
+#ifndef DEBUG
if (m_renderer == NULL) {
- throw std::runtime_error("attempted to call safe() when m_renderer is NULL");
+ throw std::runtime_error(
+ "attempted to call renderer::sdl() when m_renderer is NULL"
+ );
}
#endif