From bd9dd9c195405f3f191d7e8e1ad98c6caa460413 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 4 Apr 2011 00:05:52 +0000 Subject: [PATCH] video: implement Video::GetSize() in addition to GetWidth() and GetHeight(). --- src/video.cpp | 19 +++++++++---------- src/video.h | 1 + 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/video.cpp b/src/video.cpp index 4d2e85ce..4679bb25 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -244,26 +244,25 @@ void Video::Capture(uint32_t *buffer) } } -int Video::GetWidth() +vec2i Video::GetSize() { #if defined ANDROID_NDK - return saved_viewport.x; + return saved_viewport; #else GLint v[4]; glGetIntegerv(GL_VIEWPORT, v); - return v[2]; + return vec2i(v[2], v[3]); #endif } +int Video::GetWidth() +{ + return GetSize().x; +} + int Video::GetHeight() { -#if defined ANDROID_NDK - return saved_viewport.y; -#else - GLint v[4]; - glGetIntegerv(GL_VIEWPORT, v); - return v[3]; -#endif + return GetSize().y; } } /* namespace lol */ diff --git a/src/video.h b/src/video.h index 77401edb..11062540 100644 --- a/src/video.h +++ b/src/video.h @@ -31,6 +31,7 @@ public: static void SetDepth(bool set); static void Clear(); static void Capture(uint32_t *buffer); + static vec2i GetSize(); static int GetWidth(); static int GetHeight(); };