Changeset 78375 in vbox for trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_polygon.c
- Timestamp:
- May 3, 2019 9:51:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_polygon.c
r69392 r78375 14 14 { 15 15 CRPolygonState *p = &ctx->polygon; 16 CRStateBits *sb = GetCurrentBits( );16 CRStateBits *sb = GetCurrentBits(ctx->pStateTracker); 17 17 CRPolygonBits *pb = &(sb->polygon); 18 18 int i; … … 43 43 } 44 44 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,45 void 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, 55 55 "glCullFace called in begin/end"); 56 56 return; … … 61 61 if (mode != GL_FRONT && mode != GL_BACK && mode != GL_FRONT_AND_BACK) 62 62 { 63 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM,63 crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM, 64 64 "glCullFace called with bogus mode: 0x%x", mode); 65 65 return; … … 71 71 } 72 72 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,73 void 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, 83 83 "glFrontFace called in begin/end"); 84 84 return; … … 89 89 if (mode != GL_CW && mode != GL_CCW) 90 90 { 91 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM,91 crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM, 92 92 "glFrontFace called with bogus mode: 0x%x", mode); 93 93 return; … … 99 99 } 100 100 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,101 void 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, 111 111 "glPolygonMode called in begin/end"); 112 112 return; … … 117 117 if (mode != GL_POINT && mode != GL_LINE && mode != GL_FILL) 118 118 { 119 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM,119 crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM, 120 120 "glPolygonMode called with bogus mode: 0x%x", mode); 121 121 return; … … 133 133 break; 134 134 default: 135 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM,135 crStateError(pState, __LINE__, __FILE__, GL_INVALID_ENUM, 136 136 "glPolygonMode called with bogus face: 0x%x", face); 137 137 return; … … 141 141 } 142 142 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,143 void 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, 153 153 "glPolygonOffset called in begin/end"); 154 154 return; … … 164 164 } 165 165 166 void STATE_APIENTRY crStatePolygonStipple ( const GLubyte *p)167 { 168 CRContext *g = GetCurrentContext( );166 void STATE_APIENTRY crStatePolygonStipple (PCRStateTracker pState, const GLubyte *p) 167 { 168 CRContext *g = GetCurrentContext(pState); 169 169 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, 176 176 "glPolygonStipple called in begin/end"); 177 177 return; … … 180 180 FLUSH(); 181 181 182 if (!p && !crStateIsBufferBound( GL_PIXEL_UNPACK_BUFFER_ARB))182 if (!p && !crStateIsBufferBound(pState, GL_PIXEL_UNPACK_BUFFER_ARB)) 183 183 { 184 184 crDebug("Void pointer passed to PolygonStipple"); … … 187 187 188 188 /** @todo track mask if buffer is bound?*/ 189 if (!crStateIsBufferBound( GL_PIXEL_UNPACK_BUFFER_ARB))189 if (!crStateIsBufferBound(pState, GL_PIXEL_UNPACK_BUFFER_ARB)) 190 190 { 191 191 crMemcpy((char*)poly->stipple, (char*)p, 128); … … 196 196 } 197 197 198 void STATE_APIENTRY crStateGetPolygonStipple( GLubyte *b )199 { 200 CRContext *g = GetCurrentContext( );198 void STATE_APIENTRY crStateGetPolygonStipple(PCRStateTracker pState, GLubyte *b ) 199 { 200 CRContext *g = GetCurrentContext(pState); 201 201 CRPolygonState *poly = &(g->polygon); 202 202 203 203 if (g->current.inBeginEnd) 204 204 { 205 crStateError( __LINE__, __FILE__, GL_INVALID_OPERATION,205 crStateError(pState, __LINE__, __FILE__, GL_INVALID_OPERATION, 206 206 "glGetPolygonStipple called in begin/end"); 207 207 return;
Note:
See TracChangeset
for help on using the changeset viewer.