From d2e5bba88efc9b2739114466c80b16ab0fc386a4 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 19 Aug 2010 00:58:29 +0000 Subject: [PATCH] Implement Video::GetWidth() and Video::GetHeight(). --- src/video.cpp | 15 +++++++++++++++ src/video.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/src/video.cpp b/src/video.cpp index 0814a5e3..7b366d2d 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -54,3 +54,18 @@ void Video::Clear() glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } + +int Video::GetWidth() +{ + GLint v[4]; + glGetIntegerv(GL_VIEWPORT, v); + return v[2]; +} + +int Video::GetHeight() +{ + GLint v[4]; + glGetIntegerv(GL_VIEWPORT, v); + return v[3]; +} + diff --git a/src/video.h b/src/video.h index 4b978b15..5131fc39 100644 --- a/src/video.h +++ b/src/video.h @@ -17,6 +17,8 @@ class Video public: static void Setup(int width, int height); static void Clear(); + static int GetWidth(); + static int GetHeight(); }; #endif // __DH_VIDEO_H__