Lines Matching refs:ctx
32 ctx->setError(err); \
39 ctx->setError(err); \
123 GL2Encoder *ctx = (GL2Encoder *)self;
124 GLenum err = ctx->getError();
126 ctx->setError(GL_NO_ERROR);
130 return ctx->m_glGetError_enc(self);
136 GL2Encoder *ctx = (GL2Encoder *) self;
137 ctx->m_glFlush_enc(self);
138 ctx->m_stream->flush();
163 GL2Encoder *ctx = (GL2Encoder *)self;
164 ctx->m_glPixelStorei_enc(ctx, param, value);
165 assert(ctx->m_state != NULL);
166 ctx->m_state->setPixelStore(param, value);
172 GL2Encoder *ctx = (GL2Encoder *) self;
173 assert(ctx->m_state != NULL);
174 ctx->m_state->bindBuffer(target, id);
176 ctx->m_glBindBuffer_enc(self, target, id);
181 GL2Encoder *ctx = (GL2Encoder *) self;
182 GLuint bufferId = ctx->m_state->getBuffer(target);
186 ctx->m_shared->updateBufferData(bufferId, size, (void*)data);
187 ctx->m_glBufferData_enc(self, target, size, data, usage);
192 GL2Encoder *ctx = (GL2Encoder *) self;
193 GLuint bufferId = ctx->m_state->getBuffer(target);
196 GLenum res = ctx->m_shared->subUpdateBufferData(bufferId, offset, size, (void*)data);
199 ctx->m_glBufferSubData_enc(self, target, offset, size, data);
204 GL2Encoder *ctx = (GL2Encoder *) self;
207 ctx->m_shared->deleteBufferData(buffers[i]);
208 ctx->m_glDeleteBuffers_enc(self,1,&buffers[i]);
214 GL2Encoder *ctx = (GL2Encoder *)self;
215 assert(ctx->m_state != NULL);
216 ctx->m_state->setState(indx, size, type, normalized, stride, ptr);
221 GL2Encoder *ctx = (GL2Encoder *) self;
222 assert(ctx->m_state != NULL);
223 GLClientState* state = ctx->m_state;
234 GLint *compressedTextureFormats = ctx->getCompressedTextureFormats();
235 if (ctx->m_num_compressedTextureFormats > 0 &&
238 ctx->m_num_compressedTextureFormats * sizeof(GLint));
246 ctx->m_glGetIntegerv_enc(self, param, ptr);
258 if (!ctx->m_state->getClientStateParameter<GLint>(param, ptr)) {
259 ctx->m_glGetIntegerv_enc(self, param, ptr);
268 GL2Encoder *ctx = (GL2Encoder *)self;
269 assert(ctx->m_state != NULL);
270 GLClientState* state = ctx->m_state;
281 GLint *compressedTextureFormats = ctx->getCompressedTextureFormats();
282 if (ctx->m_num_compressedTextureFormats > 0 &&
284 for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
294 ctx->m_glGetFloatv_enc(self, param, ptr);
306 if (!ctx->m_state->getClientStateParameter<GLfloat>(param, ptr)) {
307 ctx->m_glGetFloatv_enc(self, param, ptr);
316 GL2Encoder *ctx = (GL2Encoder *)self;
317 assert(ctx->m_state != NULL);
318 GLClientState* state = ctx->m_state;
329 GLint *compressedTextureFormats = ctx->getCompressedTextureFormats();
330 if (ctx->m_num_compressedTextureFormats > 0 &&
332 for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) {
348 if (!ctx->m_state->getClientStateParameter<GLboolean>(param, ptr)) {
349 ctx->m_glGetBooleanv_enc(self, param, ptr);
358 GL2Encoder *ctx = (GL2Encoder *)self;
359 assert(ctx->m_state);
360 ctx->m_state->enable(index, 1);
365 GL2Encoder *ctx = (GL2Encoder *)self;
366 assert(ctx->m_state);
367 ctx->m_state->enable(index, 0);
373 GL2Encoder *ctx = (GL2Encoder *)self;
374 assert(ctx->m_state);
376 if (!ctx->m_state->getVertexAttribParameter<GLint>(index, pname, params)) {
377 ctx->m_glGetVertexAttribiv_enc(self, index, pname, params);
383 GL2Encoder *ctx = (GL2Encoder *)self;
384 assert(ctx->m_state);
386 if (!ctx->m_state->getVertexAttribParameter<GLfloat>(index, pname, params)) {
387 ctx->m_glGetVertexAttribfv_enc(self, index, pname, params);
393 GL2Encoder *ctx = (GL2Encoder *)self;
394 if (ctx->m_state == NULL) return;
396 const GLClientState::VertexAttribState *va_state = ctx->m_state->getState(index);
444 GL2Encoder *ctx = (GL2Encoder *)self;
445 ctx->sendVertexAttributes(first, count);
446 ctx->m_glDrawArrays_enc(ctx, mode, 0, count);
453 GL2Encoder *ctx = (GL2Encoder *)self;
454 assert(ctx->m_state != NULL);
459 int nLocations = ctx->m_state->nLocations();
462 const GLClientState::VertexAttribState *state = ctx->m_state->getState(i);
478 if (ctx->m_state->currentIndexVbo() != 0) {
480 ctx->sendVertexAttributes(0, count);
481 ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo());
482 ctx->glDrawElementsOffset(ctx, mode, count, type, (GLuint)indices);
485 BufferData * buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo());
486 ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, 0);
499 adjustedIndices = ctx->m_fixedBuffer.alloc(glSizeof(type) * count);
509 adjustedIndices = ctx->m_fixedBuffer.alloc(glSizeof(type) * count);
519 ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1);
520 ctx->glDrawElementsData(ctx, mode, count, type, adjustedIndices,
638 GL2Encoder* ctx = (GL2Encoder*)self;
639 ShaderData* shaderData = ctx->m_shared->getShaderData(shader);
651 ctx->setError(GL_OUT_OF_MEMORY);
655 ctx->glShaderString(ctx, shader, str, len + 1);
661 GL2Encoder *ctx = (GL2Encoder *)self;
662 ctx->glFinishRoundTrip(self);
667 GL2Encoder *ctx = (GL2Encoder *)self;
668 ctx->m_glLinkProgram_enc(self, program);
671 ctx->glGetProgramiv(self,program,GL_LINK_STATUS,&linkStatus);
677 ctx->glGetProgramiv(self, program, GL_ACTIVE_UNIFORMS, &numUniforms);
678 ctx->m_shared->initProgramData(program,numUniforms);
682 ctx->glGetProgramiv(self, program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxLength);
691 ctx->glGetActiveUniform(self, program, i, maxLength, NULL, &size, &type, name);
692 location = ctx->m_glGetUniformLocation_enc(self, program, name);
693 ctx->m_shared->setProgramIndexInfo(program, i, location, size, type, name);
695 ctx->m_shared->setupLocationShiftWAR(program);
702 GL2Encoder *ctx = (GL2Encoder*)self;
703 ctx->m_glDeleteProgram_enc(self, program);
705 ctx->m_shared->deleteProgramData(program);
710 GL2Encoder *ctx = (GL2Encoder*)self;
711 SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_VALUE);
712 SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION);
713 GLint hostLoc = ctx->m_shared->locationWARAppToHost(program, location);
714 SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,hostLoc)==0, GL_INVALID_OPERATION);
715 ctx->m_glGetUniformiv_enc(self, program, hostLoc, params);
719 GL2Encoder *ctx = (GL2Encoder*)self;
720 SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_VALUE);
721 SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION);
722 GLint hostLoc = ctx->m_shared->locationWARAppToHost(program,location);
723 SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,hostLoc)==0, GL_INVALID_OPERATION);
724 ctx->m_glGetUniformfv_enc(self, program, hostLoc, params);
729 GL2Encoder *ctx = (GL2Encoder*)self;
730 GLuint program = ctx->m_glCreateProgram_enc(self);
732 ctx->m_shared->addProgramData(program);
738 GL2Encoder *ctx = (GL2Encoder*)self;
739 GLuint shader = ctx->m_glCreateShader_enc(self, shaderType);
741 if (!ctx->m_shared->addShaderData(shader)) {
742 ctx->m_glDeleteShader_enc(self, shader);
751 GL2Encoder *ctx = (GL2Encoder*)self;
752 ctx->m_glDeleteShader_enc(self,shader);
753 ctx->m_shared->unrefShaderData(shader);
758 GL2Encoder *ctx = (GL2Encoder*)self;
759 ctx->m_glAttachShader_enc(self, program, shader);
760 ctx->m_shared->attachShader(program, shader);
765 GL2Encoder *ctx = (GL2Encoder*)self;
766 ctx->m_glDetachShader_enc(self, program, shader);
767 ctx->m_shared->detachShader(program, shader);
774 GL2Encoder *ctx = (GL2Encoder*)self;
779 bool needLocationWAR = ctx->m_shared->needUniformLocationWAR(program);
791 int hostLoc = ctx->m_glGetUniformLocation_enc(self, program, name);
793 return ctx->m_shared->locationWARHostToApp(program, hostLoc, arrIndex);
825 GL2Encoder *ctx = (GL2Encoder*)self;
826 GLClientState* state = ctx->m_state;
827 GLSharedGroupPtr shared = ctx->m_shared;
829 ctx->m_glUseProgram_enc(self, program);
830 ctx->m_state->setCurrentProgram(program);
840 if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + samplerVal,
848 ctx->m_glActiveTexture_enc(self, origActiveTexture);
854 GL2Encoder *ctx = (GL2Encoder*)self;
855 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
856 ctx->m_glUniform1f_enc(self, hostLoc, x);
861 GL2Encoder *ctx = (GL2Encoder*)self;
862 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
863 ctx->m_glUniform1fv_enc(self, hostLoc, count, v);
868 GL2Encoder *ctx = (GL2Encoder*)self;
869 GLClientState* state = ctx->m_state;
870 GLSharedGroupPtr shared = ctx->m_shared;
872 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
873 ctx->m_glUniform1i_enc(self, hostLoc, x);
878 if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + x, target)) {
879 ctx->m_glActiveTexture_enc(self, origActiveTexture);
887 GL2Encoder *ctx = (GL2Encoder*)self;
888 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
889 ctx->m_glUniform1iv_enc(self, hostLoc, count, v);
894 GL2Encoder *ctx = (GL2Encoder*)self;
895 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
896 ctx->m_glUniform2f_enc(self, hostLoc, x, y);
901 GL2Encoder *ctx = (GL2Encoder*)self;
902 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
903 ctx->m_glUniform2fv_enc(self, hostLoc, count, v);
908 GL2Encoder *ctx = (GL2Encoder*)self;
909 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx
910 ctx->m_glUniform2i_enc(self, hostLoc, x, y);
915 GL2Encoder *ctx = (GL2Encoder*)self;
916 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
917 ctx->m_glUniform2iv_enc(self, hostLoc, count, v);
922 GL2Encoder *ctx = (GL2Encoder*)self;
923 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
924 ctx->m_glUniform3f_enc(self, hostLoc, x, y, z);
929 GL2Encoder *ctx = (GL2Encoder*)self;
930 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
931 ctx->m_glUniform3fv_enc(self, hostLoc, count, v);
936 GL2Encoder *ctx = (GL2Encoder*)self;
937 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
938 ctx->m_glUniform3i_enc(self, hostLoc, x, y, z);
943 GL2Encoder *ctx = (GL2Encoder*)self;
944 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
945 ctx->m_glUniform3iv_enc(self, hostLoc, count, v);
950 GL2Encoder *ctx = (GL2Encoder*)self;
951 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
952 ctx->m_glUniform4f_enc(self, hostLoc, x, y, z, w);
957 GL2Encoder *ctx = (GL2Encoder*)self;
958 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
959 ctx->m_glUniform4fv_enc(self, hostLoc, count, v);
964 GL2Encoder *ctx = (GL2Encoder*)self;
965 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
966 ctx->m_glUniform4i_enc(self, hostLoc, x, y, z, w);
971 GL2Encoder *ctx = (GL2Encoder*)self;
972 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
973 ctx->m_glUniform4iv_enc(self, hostLoc, count, v);
978 GL2Encoder *ctx = (GL2Encoder*)self;
979 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
980 ctx->m_glUniformMatrix2fv_enc(self, hostLoc, count, transpose, value);
985 GL2Encoder *ctx = (GL2Encoder*)self;
986 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
987 ctx->m_glUniformMatrix3fv_enc(self, hostLoc, count, transpose, value);
992 GL2Encoder *ctx = (GL2Encoder*)self;
993 GLint hostLoc = ctx->m_shared->locationWARAppToHost(ctx->m_state->currentProgram(),location);
994 ctx->m_glUniformMatrix4fv_enc(self, hostLoc, count, transpose, value);
999 GL2Encoder* ctx = (GL2Encoder*)self;
1000 GLClientState* state = ctx->m_state;
1005 ctx->m_glActiveTexture_enc(ctx, texture);
1010 GL2Encoder* ctx = (GL2Encoder*)self;
1011 GLClientState* state = ctx->m_state;
1018 ctx->m_glBindTexture_enc(ctx, target, texture);
1025 ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
1026 ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
1028 ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
1030 ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D,
1034 ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D,
1040 ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture);
1046 GL2Encoder* ctx = (GL2Encoder*)self;
1047 GLClientState* state = ctx->m_state;
1050 ctx->m_glDeleteTextures_enc(ctx, n, textures);
1056 GL2Encoder* ctx = (GL2Encoder*)self;
1057 const GLClientState* state = ctx->m_state;
1060 ctx->override2DTextureTarget(target);
1061 ctx->m_glGetTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
1062 ctx->restore2DTextureTarget();
1064 ctx->m_glGetTexParameterfv_enc(ctx, target, pname, params);
1071 GL2Encoder* ctx = (GL2Encoder*)self;
1072 const GLClientState* state = ctx->m_state;
1081 ctx->override2DTextureTarget(target);
1082 ctx->m_glGetTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
1083 ctx->restore2DTextureTarget();
1085 ctx->m_glGetTexParameteriv_enc(ctx, target, pname, params);
1110 GL2Encoder* ctx = (GL2Encoder*)self;
1111 const GLClientState* state = ctx->m_state;
1118 ctx->override2DTextureTarget(target);
1119 ctx->m_glTexParameterf_enc(ctx, GL_TEXTURE_2D, pname, param);
1120 ctx->restore2DTextureTarget();
1122 ctx->m_glTexParameterf_enc(ctx, target, pname, param);
1129 GL2Encoder* ctx = (GL2Encoder*)self;
1130 const GLClientState* state = ctx->m_state;
1137 ctx->override2DTextureTarget(target);
1138 ctx->m_glTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params);
1139 ctx->restore2DTextureTarget();
1141 ctx->m_glTexParameterfv_enc(ctx, target, pname, params);
1148 GL2Encoder* ctx = (GL2Encoder*)self;
1149 const GLClientState* state = ctx->m_state;
1156 ctx->override2DTextureTarget(target);
1157 ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D, pname, param);
1158 ctx->restore2DTextureTarget();
1160 ctx->m_glTexParameteri_enc(ctx, target, pname, param);
1167 GL2Encoder* ctx = (GL2Encoder*)self;
1168 const GLClientState* state = ctx->m_state;
1175 ctx->override2DTextureTarget(target);
1176 ctx->m_glTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params);
1177 ctx->restore2DTextureTarget();
1179 ctx->m_glTexParameteriv_enc(ctx, target, pname, params);