VirtualBox

Ignore:
Timestamp:
May 3, 2019 9:51:02 PM (6 years ago)
Author:
vboxsync
Message:

Additions/common/crOpengl,GuestHost/OpenGL,HostServices/SharedOpenGL: Eliminate all global variables from the state tracker library (state_tracker) in preparation of the SPU DLL merging, bugref:9435

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_polygon.c

    r69392 r78375  
    1414{
    1515    CRPolygonState *p = &ctx->polygon;
    16         CRStateBits *sb = GetCurrentBits();
     16        CRStateBits *sb = GetCurrentBits(ctx->pStateTracker);
    1717    CRPolygonBits *pb = &(sb->polygon);
    1818    int i;
     
    4343}
    4444
    45 void STATE_APIENTRY crStateCullFace(GLenum mode)
    46 {
    47     CRContext *g = GetCurrentContext();
    48     CRPolygonState *p = &(g->polygon);
    49         CRStateBits *sb = GetCurrentBits();
    50     CRPolygonBits *pb = &(sb->polygon);
    51 
    52     if (g->current.inBeginEnd)
    53     {
    54         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     45void STATE_APIENTRY crStateCullFace(PCRStateTracker pState, GLenum mode)
     46{
     47    CRContext *g = GetCurrentContext(pState);
     48    CRPolygonState *p = &(g->polygon);
     49        CRStateBits *sb = GetCurrentBits(pState);
     50    CRPolygonBits *pb = &(sb->polygon);
     51
     52    if (g->current.inBeginEnd)
     53    {
     54        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION,
    5555                "glCullFace called in begin/end");
    5656        return;
     
    6161    if (mode != GL_FRONT && mode != GL_BACK && mode != GL_FRONT_AND_BACK)
    6262    {
    63         crStateError(__LINE__, __FILE__, GL_INVALID_ENUM,
     63        crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM,
    6464                "glCullFace called with bogus mode: 0x%x", mode);
    6565        return;
     
    7171}
    7272
    73 void STATE_APIENTRY crStateFrontFace (GLenum mode)
    74 {
    75     CRContext *g = GetCurrentContext();
    76     CRPolygonState *p = &(g->polygon);
    77         CRStateBits *sb = GetCurrentBits();
    78     CRPolygonBits *pb = &(sb->polygon);
    79 
    80     if (g->current.inBeginEnd)
    81     {
    82         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     73void STATE_APIENTRY crStateFrontFace (PCRStateTracker pState, GLenum mode)
     74{
     75    CRContext *g = GetCurrentContext(pState);
     76    CRPolygonState *p = &(g->polygon);
     77        CRStateBits *sb = GetCurrentBits(pState);
     78    CRPolygonBits *pb = &(sb->polygon);
     79
     80    if (g->current.inBeginEnd)
     81    {
     82        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION,
    8383                "glFrontFace called in begin/end");
    8484        return;
     
    8989    if (mode != GL_CW && mode != GL_CCW)
    9090    {
    91         crStateError(__LINE__, __FILE__, GL_INVALID_ENUM,
     91        crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM,
    9292                "glFrontFace called with bogus mode: 0x%x", mode);
    9393        return;
     
    9999}
    100100
    101 void  STATE_APIENTRY crStatePolygonMode (GLenum face, GLenum mode)
    102 {
    103     CRContext *g = GetCurrentContext();
    104     CRPolygonState *p = &(g->polygon);
    105         CRStateBits *sb = GetCurrentBits();
    106     CRPolygonBits *pb = &(sb->polygon);
    107 
    108     if (g->current.inBeginEnd)
    109     {
    110         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     101void  STATE_APIENTRY crStatePolygonMode (PCRStateTracker pState, GLenum face, GLenum mode)
     102{
     103    CRContext *g = GetCurrentContext(pState);
     104    CRPolygonState *p = &(g->polygon);
     105        CRStateBits *sb = GetCurrentBits(pState);
     106    CRPolygonBits *pb = &(sb->polygon);
     107
     108    if (g->current.inBeginEnd)
     109    {
     110        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION,
    111111                "glPolygonMode called in begin/end");
    112112        return;
     
    117117    if (mode != GL_POINT && mode != GL_LINE && mode != GL_FILL)
    118118    {
    119         crStateError(__LINE__, __FILE__, GL_INVALID_ENUM,
     119        crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM,
    120120                "glPolygonMode called with bogus mode: 0x%x", mode);
    121121        return;
     
    133133            break;
    134134        default:
    135             crStateError(__LINE__, __FILE__, GL_INVALID_ENUM,
     135            crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM,
    136136                    "glPolygonMode called with bogus face: 0x%x", face);
    137137            return;
     
    141141}
    142142
    143 void STATE_APIENTRY crStatePolygonOffset (GLfloat factor, GLfloat units)
    144 {
    145     CRContext *g = GetCurrentContext();
    146     CRPolygonState *p = &(g->polygon);
    147         CRStateBits *sb = GetCurrentBits();
    148     CRPolygonBits *pb = &(sb->polygon);
    149 
    150     if (g->current.inBeginEnd)
    151     {
    152         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     143void STATE_APIENTRY crStatePolygonOffset (PCRStateTracker pState, GLfloat factor, GLfloat units)
     144{
     145    CRContext *g = GetCurrentContext(pState);
     146    CRPolygonState *p = &(g->polygon);
     147        CRStateBits *sb = GetCurrentBits(pState);
     148    CRPolygonBits *pb = &(sb->polygon);
     149
     150    if (g->current.inBeginEnd)
     151    {
     152        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION,
    153153                "glPolygonOffset called in begin/end");
    154154        return;
     
    164164}
    165165
    166 void STATE_APIENTRY crStatePolygonStipple (const GLubyte *p)
    167 {
    168     CRContext *g = GetCurrentContext();
     166void STATE_APIENTRY crStatePolygonStipple (PCRStateTracker pState, const GLubyte *p)
     167{
     168    CRContext *g = GetCurrentContext(pState);
    169169    CRPolygonState *poly = &(g->polygon);
    170         CRStateBits *sb = GetCurrentBits();
    171     CRPolygonBits *pb = &(sb->polygon);
    172 
    173     if (g->current.inBeginEnd)
    174     {
    175         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     170        CRStateBits *sb = GetCurrentBits(pState);
     171    CRPolygonBits *pb = &(sb->polygon);
     172
     173    if (g->current.inBeginEnd)
     174    {
     175        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION,
    176176                "glPolygonStipple called in begin/end");
    177177        return;
     
    180180    FLUSH();
    181181
    182     if (!p && !crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
     182    if (!p && !crStateIsBufferBound(pState, GL_PIXEL_UNPACK_BUFFER_ARB))
    183183    {
    184184        crDebug("Void pointer passed to PolygonStipple");
     
    187187
    188188    /** @todo track mask if buffer is bound?*/
    189     if (!crStateIsBufferBound(GL_PIXEL_UNPACK_BUFFER_ARB))
     189    if (!crStateIsBufferBound(pState, GL_PIXEL_UNPACK_BUFFER_ARB))
    190190    {
    191191        crMemcpy((char*)poly->stipple, (char*)p, 128);
     
    196196}
    197197
    198 void STATE_APIENTRY crStateGetPolygonStipple( GLubyte *b )
    199 {
    200     CRContext *g = GetCurrentContext();
     198void STATE_APIENTRY crStateGetPolygonStipple(PCRStateTracker pState, GLubyte *b )
     199{
     200    CRContext *g = GetCurrentContext(pState);
    201201    CRPolygonState *poly = &(g->polygon);
    202202
    203203    if (g->current.inBeginEnd)
    204204    {
    205         crStateError(__LINE__, __FILE__, GL_INVALID_OPERATION,
     205        crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION,
    206206                "glGetPolygonStipple called in begin/end");
    207207        return;
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