Ignore:
Timestamp:
Dec 10, 2011, 3:02:12 PM (9 years ago)
Author:
sam
Message:

gl: cache viewport size on all platforms, because we cannot query it from
the game thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/video.cpp

    r1081 r1108  
    3636private:
    3737    static mat4 proj_matrix, view_matrix;
    38 #if defined __ANDROID__ || defined __CELLOS_LV2__ || defined __APPLE__
    3938    static ivec2 saved_viewport;
    40 #endif
    4139};
    4240
     
    4442mat4 VideoData::view_matrix;
    4543
    46 #if defined __ANDROID__ || defined __CELLOS_LV2__ || defined __APPLE__
    4744ivec2 VideoData::saved_viewport(0, 0);
    48 #endif
    4945
    5046/*
     
    6662    /* Initialise OpenGL */
    6763    glViewport(0, 0, size.x, size.y);
    68 
    69 #if defined __ANDROID__ || defined __CELLOS_LV2__ || defined __APPLE__
    7064    VideoData::saved_viewport = size;
    71 #endif
    7265
    7366    glClearColor(0.1f, 0.2f, 0.3f, 1.0f);
     
    179172ivec2 Video::GetSize()
    180173{
    181 #if defined __ANDROID__
     174    /* GetSize() is called too often on the game thread; we cannot rely on
     175     * the GL context at this point */
     176#if 1
    182177    return VideoData::saved_viewport;
    183178#elif defined __CELLOS_LV2__
    184179    // FIXME: use psglCreateDeviceAuto && psglGetDeviceDimensions
    185     return VideoData::saved_viewport;
    186 #elif defined __APPLE__
    187     return VideoData::saved_viewport;
    188180#else
    189181    GLint v[4];
Note: See TracChangeset for help on using the changeset viewer.