Ignore:
Timestamp:
Feb 28, 2011, 7:02:21 PM (9 years ago)
Author:
sam
Message:

Work around a bug in the Android emulator that doesn't let us query the
current viewport settings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/video.cpp

    r698 r707  
    2727{
    2828
     29#if defined ANDROID_NDK
     30vec2i saved_viewport;
     31#endif
     32
    2933#if defined HAVE_GL_2X || defined HAVE_GLES_2X
    3034Shader *stdshader;
     
    96100    /* Initialise OpenGL */
    97101    glViewport(0, 0, width, height);
     102
     103#if defined ANDROID_NDK
     104    saved_viewport = vec2i(width, height);
     105#endif
    98106
    99107    glClearColor(0.1f, 0.2f, 0.3f, 0.0f);
     
    224232int Video::GetWidth()
    225233{
     234#if defined ANDROID_NDK
     235    return saved_viewport.x;
     236#else
    226237    GLint v[4];
    227238    glGetIntegerv(GL_VIEWPORT, v);
    228239    return v[2];
     240#endif
    229241}
    230242
    231243int Video::GetHeight()
    232244{
     245#if defined ANDROID_NDK
     246    return saved_viewport.y;
     247#else
    233248    GLint v[4];
    234249    glGetIntegerv(GL_VIEWPORT, v);
    235250    return v[3];
     251#endif
    236252}
    237253
Note: See TracChangeset for help on using the changeset viewer.