VirtualBox

Changeset 26121 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Feb 1, 2010 2:12:38 PM (15 years ago)
Author:
vboxsync
Message:

crOpenGL: workaround for buggy apps using glEnable with GL_LIGHT_MODEL_TWO_SIDE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_client.c

    r22284 r26121  
    407407void PACKSPU_APIENTRY packspu_Enable( GLenum cap )
    408408{
    409     crStateEnable(cap);
    410 
    411     if (pack_spu.swap)
    412         crPackEnableSWAP(cap);
     409    if (cap!=GL_LIGHT_MODEL_TWO_SIDE)
     410    {
     411        crStateEnable(cap);
     412
     413        if (pack_spu.swap)
     414            crPackEnableSWAP(cap);
     415        else
     416            crPackEnable(cap);
     417    }
    413418    else
    414         crPackEnable(cap);
     419    {
     420        static int g_glmts1_warn=0;
     421        if (!g_glmts1_warn)
     422        {
     423            crWarning("glEnable(GL_LIGHT_MODEL_TWO_SIDE) converted to valid glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,1)");
     424            g_glmts1_warn=1;
     425        }
     426        crStateLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1);
     427        crPackLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1);
     428    }
    415429}
    416430
     
    418432void PACKSPU_APIENTRY packspu_Disable( GLenum cap )
    419433{
    420     crStateDisable(cap);
    421 
    422     if (pack_spu.swap)
    423         crPackDisableSWAP(cap);
     434    if (cap!=GL_LIGHT_MODEL_TWO_SIDE)
     435    {
     436        crStateDisable(cap);
     437
     438        if (pack_spu.swap)
     439            crPackDisableSWAP(cap);
     440        else
     441            crPackDisable(cap);
     442    }
    424443    else
    425         crPackDisable(cap);
     444    {
     445        static int g_glmts0_warn=0;
     446        if (!g_glmts0_warn)
     447        {
     448            crWarning("glDisable(GL_LIGHT_MODEL_TWO_SIDE) converted to valid glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,0)");
     449            g_glmts0_warn=1;
     450        }
     451        crStateLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
     452        crPackLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
     453    }
    426454}
    427455
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette