Ticket #1612: max_text.diff

File max_text.diff, 1.3 KB (added by ivor@…, 18 years ago)

max texture patch

  • libs/libmythui/mythpainter_ogl.h

     
    4848    list<QString> m_StringExpireList;
    4949
    5050    int q_gl_texture;
     51    int m_maxTexDim;
    5152    bool texture_rects;
    5253};
    5354
  • libs/libmythui/mythpainter_ogl.cpp

     
    6262    glOrtho(0, parent->width(), parent->height(), 0, -999999, 999999);
    6363    glMatrixMode(GL_MODELVIEW);
    6464    glLoadIdentity();
     65
     66    GLint param;
     67    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &param);
     68    m_maxTexDim = param;
     69
    6570    //glTranslatef(0.2, 0.2, 0.0);
    6671}
    6772
     
    8287int MythOpenGLPainter::NearestGLTextureSize(int v)
    8388{
    8489    int n = 0, last = 0;
     90    int s;
    8591
    8692    for (int s = 0; s < 32; ++s)
    8793    {
     
    9399    }
    94100
    95101    if (n > 1)
    96         return 1 << (last + 1);
     102        s = 1 << (last + 1);
     103    else
     104        s = 1 << last;
     105   
     106    if (s > m_maxTexDim)
     107        s = m_maxTexDim;
    97108
    98     return 1 << last;
     109    return s;
    99110}
    100111
    101112void MythOpenGLPainter::RemoveImageFromCache(MythImage *im)