Changeset 753


Ignore:
Timestamp:
Apr 4, 2011, 2:05:52 AM (10 years ago)
Author:
sam
Message:

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

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/video.cpp

    r747 r753  
    245245}
    246246
    247 int Video::GetWidth()
    248 {
    249 #if defined ANDROID_NDK
    250     return saved_viewport.x;
     247vec2i Video::GetSize()
     248{
     249#if defined ANDROID_NDK
     250    return saved_viewport;
    251251#else
    252252    GLint v[4];
    253253    glGetIntegerv(GL_VIEWPORT, v);
    254     return v[2];
    255 #endif
     254    return vec2i(v[2], v[3]);
     255#endif
     256}
     257
     258int Video::GetWidth()
     259{
     260    return GetSize().x;
    256261}
    257262
    258263int Video::GetHeight()
    259264{
    260 #if defined ANDROID_NDK
    261     return saved_viewport.y;
    262 #else
    263     GLint v[4];
    264     glGetIntegerv(GL_VIEWPORT, v);
    265     return v[3];
    266 #endif
     265    return GetSize().y;
    267266}
    268267
  • trunk/src/video.h

    r748 r753  
    3232    static void Clear();
    3333    static void Capture(uint32_t *buffer);
     34    static vec2i GetSize();
    3435    static int GetWidth();
    3536    static int GetHeight();
Note: See TracChangeset for help on using the changeset viewer.