Browse Source

video: implement Video::GetSize() in addition to GetWidth() and GetHeight().

legacy
Sam Hocevar sam 13 years ago
parent
commit
bd9dd9c195
2 changed files with 10 additions and 10 deletions
  1. +9
    -10
      src/video.cpp
  2. +1
    -0
      src/video.h

+ 9
- 10
src/video.cpp View File

@@ -244,26 +244,25 @@ void Video::Capture(uint32_t *buffer)
} }
} }


int Video::GetWidth()
vec2i Video::GetSize()
{ {
#if defined ANDROID_NDK #if defined ANDROID_NDK
return saved_viewport.x;
return saved_viewport;
#else #else
GLint v[4]; GLint v[4];
glGetIntegerv(GL_VIEWPORT, v); glGetIntegerv(GL_VIEWPORT, v);
return v[2];
return vec2i(v[2], v[3]);
#endif #endif
} }


int Video::GetWidth()
{
return GetSize().x;
}

int Video::GetHeight() 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 */ } /* namespace lol */


+ 1
- 0
src/video.h View File

@@ -31,6 +31,7 @@ public:
static void SetDepth(bool set); static void SetDepth(bool set);
static void Clear(); static void Clear();
static void Capture(uint32_t *buffer); static void Capture(uint32_t *buffer);
static vec2i GetSize();
static int GetWidth(); static int GetWidth();
static int GetHeight(); static int GetHeight();
}; };


Loading…
Cancel
Save