holdingarea/serialization/Graphics/KhronosAPIWrapper/src/opengles11apiwrapper.cpp
branchbug235_bringup_0
changeset 20 d2d6724aef32
child 24 a3f46bb01be2
equal deleted inserted replaced
19:da7c1a80df0d 20:d2d6724aef32
       
     1 // Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // 
       
    15 
       
    16 #ifdef WIN32
       
    17 #define WIN32_LEAN_AND_MEAN                       // Exclude rarely-used stuff from Windows headers
       
    18 #include <windows.h>
       
    19 #endif
       
    20 
       
    21 #include <stdio.h>
       
    22 #include <stdlib.h>
       
    23 #include <GLES/gl.h>
       
    24 #include "opengles11apiwrapper.h"
       
    25 #include "serializedfunctioncall.h"
       
    26 #include "remotefunctioncall.h"
       
    27 #include "khronosapiwrapperdefs.h"
       
    28 
       
    29 #include "openvgrfc.h"
       
    30 
       
    31 
       
    32 OGLES11Wrapper::OGLES11Wrapper(RemoteFunctionCallData& currentFunctionCallData,
       
    33             APIWrapperStack* stack,
       
    34             void* result,
       
    35             MGraphicsVHWCallback* serviceIf):
       
    36 APIWrapper(currentFunctionCallData, stack, result, serviceIf),
       
    37 m_currentFunctionCall(m_currentFunctionCallData)
       
    38 {
       
    39 }
       
    40 
       
    41 int OGLES11Wrapper::DispatchRequest(unsigned long aCode)
       
    42 {
       
    43     int ret(0);
       
    44     TRACE("OpenGLES11APIWrapper: OpenGL ES Op command received: %u\n", aCode);
       
    45 
       
    46     switch ( aCode )
       
    47     {
       
    48     case OpenGlES11RFC::EglActiveTexture:
       
    49         ret = glActiveTexture();
       
    50         break;
       
    51     case OpenGlES11RFC::EglAlphaFunc:
       
    52         ret = glAlphaFunc();
       
    53         break;
       
    54     case OpenGlES11RFC::EglAlphaFuncx:
       
    55         ret = glAlphaFuncx();
       
    56         break;
       
    57     case OpenGlES11RFC::EglBindBuffer:
       
    58         ret = glBindBuffer();
       
    59         break;
       
    60     case OpenGlES11RFC::EglBindTexture:
       
    61         ret = glBindTexture();
       
    62         break;
       
    63     case OpenGlES11RFC::EglBlendFunc:
       
    64         ret = glBlendFunc();
       
    65         break;
       
    66     case OpenGlES11RFC::EglBufferData:
       
    67         ret = glBufferData();
       
    68         break;
       
    69     case OpenGlES11RFC::EglBufferSubData:
       
    70         ret = glBufferSubData();
       
    71         break;
       
    72     case OpenGlES11RFC::EglClear:
       
    73         ret = glClear();
       
    74         break;
       
    75     case OpenGlES11RFC::EglClearColor:
       
    76         ret = glClearColor();
       
    77         break;
       
    78     case OpenGlES11RFC::EglClearColorx:
       
    79         ret = glClearColorx();
       
    80         break;
       
    81     case OpenGlES11RFC::EglClearDepthf:
       
    82         ret = glClearDepthf();
       
    83         break;
       
    84     case OpenGlES11RFC::EglClearDepthx:
       
    85         ret = glClearDepthx();
       
    86         break;
       
    87     case OpenGlES11RFC::EglClearStencil:
       
    88         ret = glClearStencil();
       
    89         break;
       
    90     case OpenGlES11RFC::EglClientActiveTexture:
       
    91         ret = glClientActiveTexture();
       
    92         break;
       
    93     case OpenGlES11RFC::EglClipPlanef:
       
    94         ret = glClipPlanef();
       
    95         break;
       
    96     case OpenGlES11RFC::EglClipPlanex:
       
    97         ret = glClipPlanex();
       
    98         break;
       
    99     case OpenGlES11RFC::EglColor4f:
       
   100         ret = glColor4f();
       
   101         break;
       
   102     case OpenGlES11RFC::EglColor4ub:
       
   103         ret = glColor4ub();
       
   104         break;
       
   105     case OpenGlES11RFC::EglColor4x:
       
   106         ret = glColor4x();
       
   107         break;
       
   108     case OpenGlES11RFC::EglColorMask:
       
   109         ret = glColorMask();
       
   110         break;
       
   111     case OpenGlES11RFC::EglCompressedTexImage2D:
       
   112         ret = glCompressedTexImage2D();
       
   113         break;
       
   114     case OpenGlES11RFC::EglCompressedTexSubImage2D:
       
   115         ret = glCompressedTexSubImage2D();
       
   116         break;
       
   117     case OpenGlES11RFC::EglCopyTexImage2D:
       
   118         ret = glCopyTexImage2D();
       
   119         break;
       
   120     case OpenGlES11RFC::EglCopyTexSubImage2D:
       
   121         ret = glCopyTexSubImage2D();
       
   122         break;
       
   123     case OpenGlES11RFC::EglCullFace:
       
   124         ret = glCullFace();
       
   125         break;
       
   126     case OpenGlES11RFC::EglDeleteBuffers:
       
   127         ret = glDeleteBuffers();
       
   128         break;
       
   129     case OpenGlES11RFC::EglDeleteTextures:
       
   130         ret = glDeleteTextures();
       
   131         break;
       
   132     case OpenGlES11RFC::EglDepthFunc:
       
   133         ret = glDepthFunc();
       
   134         break;
       
   135     case OpenGlES11RFC::EglDepthMask:
       
   136         ret = glDepthMask();
       
   137         break;
       
   138     case OpenGlES11RFC::EglDepthRangef:
       
   139         ret = glDepthRangef();
       
   140         break;
       
   141     case OpenGlES11RFC::EglDepthRangex:
       
   142         ret = glDepthRangex();
       
   143         break;
       
   144     case OpenGlES11RFC::EglDisable:
       
   145         ret = glDisable();
       
   146         break;
       
   147     case OpenGlES11RFC::EglDisableClientState:
       
   148         ret = glDisableClientState();
       
   149         break;
       
   150     case OpenGlES11RFC::EglDrawArrays:
       
   151         ret = glDrawArrays();
       
   152         break;
       
   153     case OpenGlES11RFC::EglDrawElements:
       
   154         ret = glDrawElements();
       
   155         break;
       
   156     case OpenGlES11RFC::EglEnable:
       
   157         ret = glEnable();
       
   158         break;
       
   159     case OpenGlES11RFC::EglEnableClientState:
       
   160         ret = glEnableClientState();
       
   161         break;
       
   162     case OpenGlES11RFC::EglFinish:
       
   163         ret = glFinish();
       
   164         break;
       
   165     case OpenGlES11RFC::EglFlush:
       
   166         ret = glFlush();
       
   167         break;
       
   168     case OpenGlES11RFC::EglFogf:
       
   169         ret = glFogf();
       
   170         break;
       
   171     case OpenGlES11RFC::EglFogfv:
       
   172         ret = glFogfv();
       
   173         break;
       
   174     case OpenGlES11RFC::EglFogx:
       
   175         ret = glFogx();
       
   176         break;
       
   177     case OpenGlES11RFC::EglFogxv:
       
   178         ret = glFogxv();
       
   179         break;
       
   180     case OpenGlES11RFC::EglFrontFace:
       
   181         ret = glFrontFace();
       
   182         break;
       
   183     case OpenGlES11RFC::EglFrustumf:
       
   184         ret = glFrustumf();
       
   185         break;
       
   186     case OpenGlES11RFC::EglFrustumx:
       
   187         ret = glFrustumx();
       
   188         break;
       
   189     case OpenGlES11RFC::EglGenBuffers:
       
   190         ret = glGenBuffers();
       
   191         break;
       
   192     case OpenGlES11RFC::EglGenTextures:
       
   193         ret = glGenTextures();
       
   194         break;
       
   195     case OpenGlES11RFC::EglGetBooleanv:
       
   196         ret = glGetBooleanv();
       
   197         break;
       
   198     case OpenGlES11RFC::EglGetBufferParameteriv:
       
   199         ret = glGetBufferParameteriv();
       
   200         break;
       
   201     case OpenGlES11RFC::EglGetClipPlanef:
       
   202         ret = glGetClipPlanef();
       
   203         break;
       
   204     case OpenGlES11RFC::EglGetClipPlanex:
       
   205         ret = glGetClipPlanex();
       
   206         break;
       
   207     case OpenGlES11RFC::EglGetError:
       
   208         ret = glGetError();
       
   209         break;
       
   210     case OpenGlES11RFC::EglGetFixedv:
       
   211         ret = glGetFixedv();
       
   212         break;
       
   213     case OpenGlES11RFC::EglGetFloatv:
       
   214         ret = glGetFloatv();
       
   215         break;
       
   216     case OpenGlES11RFC::EglGetIntegerv:
       
   217         ret = glGetIntegerv();
       
   218         break;
       
   219     case OpenGlES11RFC::EglGetLightfv:
       
   220         ret = glGetLightfv();
       
   221         break;
       
   222     case OpenGlES11RFC::EglGetLightxv:
       
   223         ret = glGetLightxv();
       
   224         break;
       
   225     case OpenGlES11RFC::EglGetMaterialfv:
       
   226         ret = glGetMaterialfv();
       
   227         break;
       
   228     case OpenGlES11RFC::EglGetMaterialxv:
       
   229         ret = glGetMaterialxv();
       
   230         break;
       
   231     case OpenGlES11RFC::EglGetPointerv:
       
   232         ret = glGetPointerv();
       
   233         break;
       
   234 //  case OpenGlES11RFC::EglGetString:
       
   235 //      ret = glGetString();
       
   236 //      break;
       
   237     case OpenGlES11RFC::EglGetTexEnvfv:
       
   238         ret = glGetTexEnvfv();
       
   239         break;
       
   240     case OpenGlES11RFC::EglGetTexEnviv:
       
   241         ret = glGetTexEnviv();
       
   242         break;
       
   243     case OpenGlES11RFC::EglGetTexEnvxv:
       
   244         ret = glGetTexEnvxv();
       
   245         break;
       
   246     case OpenGlES11RFC::EglGetTexParameterfv:
       
   247         ret = glGetTexParameterfv();
       
   248         break;
       
   249     case OpenGlES11RFC::EglGetTexParameteriv:
       
   250         ret = glGetTexParameteriv();
       
   251         break;
       
   252     case OpenGlES11RFC::EglGetTexParameterxv:
       
   253         ret = glGetTexParameterxv();
       
   254         break;
       
   255     case OpenGlES11RFC::EglHint:
       
   256         ret = glHint();
       
   257         break;
       
   258     case OpenGlES11RFC::EglIsBuffer:
       
   259         ret = glIsBuffer();
       
   260         break;
       
   261     case OpenGlES11RFC::EglIsEnabled:
       
   262         ret = glIsEnabled();
       
   263         break;
       
   264     case OpenGlES11RFC::EglIsTexture:
       
   265         ret = glIsTexture();
       
   266         break;
       
   267     case OpenGlES11RFC::EglLightModelf:
       
   268         ret = glLightModelf();
       
   269         break;
       
   270     case OpenGlES11RFC::EglLightModelfv:
       
   271         ret = glLightModelfv();
       
   272         break;
       
   273     case OpenGlES11RFC::EglLightModelx:
       
   274         ret = glLightModelx();
       
   275         break;
       
   276     case OpenGlES11RFC::EglLightModelxv:
       
   277         ret = glLightModelxv();
       
   278         break;
       
   279     case OpenGlES11RFC::EglLightf:
       
   280         ret = glLightf();
       
   281         break;
       
   282     case OpenGlES11RFC::EglLightfv:
       
   283         ret = glLightfv();
       
   284         break;
       
   285     case OpenGlES11RFC::EglLightx:
       
   286         ret = glLightx();
       
   287         break;
       
   288     case OpenGlES11RFC::EglLightxv:
       
   289         ret = glLightxv();
       
   290         break;
       
   291     case OpenGlES11RFC::EglLineWidth:
       
   292         ret = glLineWidth();
       
   293         break;
       
   294     case OpenGlES11RFC::EglLineWidthx:
       
   295         ret = glLineWidthx();
       
   296         break;
       
   297     case OpenGlES11RFC::EglLoadIdentity:
       
   298         ret = glLoadIdentity();
       
   299         break;
       
   300     case OpenGlES11RFC::EglLoadMatrixf:
       
   301         ret = glLoadMatrixf();
       
   302         break;
       
   303     case OpenGlES11RFC::EglLoadMatrixx:
       
   304         ret = glLoadMatrixx();
       
   305         break;
       
   306     case OpenGlES11RFC::EglLogicOp:
       
   307         ret = glLogicOp();
       
   308         break;
       
   309     case OpenGlES11RFC::EglMaterialf:
       
   310         ret = glMaterialf();
       
   311         break;
       
   312     case OpenGlES11RFC::EglMaterialfv:
       
   313         ret = glMaterialfv();
       
   314         break;
       
   315     case OpenGlES11RFC::EglMaterialx:
       
   316         ret = glMaterialx();
       
   317         break;
       
   318     case OpenGlES11RFC::EglMaterialxv:
       
   319         ret = glMaterialxv();
       
   320         break;
       
   321     case OpenGlES11RFC::EglMatrixMode:
       
   322         ret = glMatrixMode();
       
   323         break;
       
   324     case OpenGlES11RFC::EglMultMatrixf:
       
   325         ret = glMultMatrixf();
       
   326         break;
       
   327     case OpenGlES11RFC::EglMultMatrixx:
       
   328         ret = glMultMatrixx();
       
   329         break;
       
   330     case OpenGlES11RFC::EglMultiTexCoord4f:
       
   331         ret = glMultiTexCoord4f();
       
   332         break;
       
   333     case OpenGlES11RFC::EglMultiTexCoord4x:
       
   334         ret = glMultiTexCoord4x();
       
   335         break;
       
   336     case OpenGlES11RFC::EglNormal3f:
       
   337         ret = glNormal3f();
       
   338         break;
       
   339     case OpenGlES11RFC::EglNormal3x:
       
   340         ret = glNormal3x();
       
   341         break;
       
   342     case OpenGlES11RFC::EglOrthof:
       
   343         ret = glOrthof();
       
   344         break;
       
   345     case OpenGlES11RFC::EglOrthox:
       
   346         ret = glOrthox();
       
   347         break;
       
   348     case OpenGlES11RFC::EglPixelStorei:
       
   349         ret = glPixelStorei();
       
   350         break;
       
   351     case OpenGlES11RFC::EglPointParameterf:
       
   352         ret = glPointParameterf();
       
   353         break;
       
   354     case OpenGlES11RFC::EglPointParameterfv:
       
   355         ret = glPointParameterfv();
       
   356         break;
       
   357     case OpenGlES11RFC::EglPointParameterx:
       
   358         ret = glPointParameterx();
       
   359         break;
       
   360     case OpenGlES11RFC::EglPointParameterxv:
       
   361         ret = glPointParameterxv();
       
   362         break;
       
   363     case OpenGlES11RFC::EglPointSize:
       
   364         ret = glPointSize();
       
   365         break;
       
   366     case OpenGlES11RFC::EglPointSizex:
       
   367         ret = glPointSizex();
       
   368         break;
       
   369     case OpenGlES11RFC::EglPolygonOffset:
       
   370         ret = glPolygonOffset();
       
   371         break;
       
   372     case OpenGlES11RFC::EglPolygonOffsetx:
       
   373         ret = glPolygonOffsetx();
       
   374         break;
       
   375     case OpenGlES11RFC::EglPopMatrix:
       
   376         ret = glPopMatrix();
       
   377         break;
       
   378     case OpenGlES11RFC::EglPushMatrix:
       
   379         ret = glPushMatrix();
       
   380         break;
       
   381     case OpenGlES11RFC::EglReadPixels:
       
   382         ret = glReadPixels();
       
   383         break;
       
   384     case OpenGlES11RFC::EglRotatef:
       
   385         ret = glRotatef();
       
   386         break;
       
   387     case OpenGlES11RFC::EglRotatex:
       
   388         ret = glRotatex();
       
   389         break;
       
   390     case OpenGlES11RFC::EglSampleCoverage:
       
   391         ret = glSampleCoverage();
       
   392         break;
       
   393     case OpenGlES11RFC::EglSampleCoveragex:
       
   394         ret = glSampleCoveragex();
       
   395         break;
       
   396     case OpenGlES11RFC::EglScalef:
       
   397         ret = glScalef();
       
   398         break;
       
   399     case OpenGlES11RFC::EglScalex:
       
   400         ret = glScalex();
       
   401         break;
       
   402     case OpenGlES11RFC::EglScissor:
       
   403         ret = glScissor();
       
   404         break;
       
   405     case OpenGlES11RFC::EglShadeModel:
       
   406         ret = glShadeModel();
       
   407         break;
       
   408     case OpenGlES11RFC::EglStencilFunc:
       
   409         ret = glStencilFunc();
       
   410         break;
       
   411     case OpenGlES11RFC::EglStencilMask:
       
   412         ret = glStencilMask();
       
   413         break;
       
   414     case OpenGlES11RFC::EglStencilOp:
       
   415         ret = glStencilOp();
       
   416         break;
       
   417     case OpenGlES11RFC::EglTexEnvf:
       
   418         ret = glTexEnvf();
       
   419         break;
       
   420     case OpenGlES11RFC::EglTexEnvfv:
       
   421         ret = glTexEnvfv();
       
   422         break;
       
   423     case OpenGlES11RFC::EglTexEnvi:
       
   424         ret = glTexEnvi();
       
   425         break;
       
   426     case OpenGlES11RFC::EglTexEnviv:
       
   427         ret = glTexEnviv();
       
   428         break;
       
   429     case OpenGlES11RFC::EglTexEnvx:
       
   430         ret = glTexEnvx();
       
   431         break;
       
   432     case OpenGlES11RFC::EglTexEnvxv:
       
   433         ret = glTexEnvxv();
       
   434         break;
       
   435     case OpenGlES11RFC::EglTexImage2D:
       
   436         ret = glTexImage2D();
       
   437         break;
       
   438     case OpenGlES11RFC::EglTexParameterf:
       
   439         ret = glTexParameterf();
       
   440         break;
       
   441     case OpenGlES11RFC::EglTexParameterfv:
       
   442         ret = glTexParameterfv();
       
   443         break;
       
   444     case OpenGlES11RFC::EglTexParameteri:
       
   445         ret = glTexParameteri();
       
   446         break;
       
   447     case OpenGlES11RFC::EglTexParameteriv:
       
   448         ret = glTexParameteriv();
       
   449         break;
       
   450     case OpenGlES11RFC::EglTexParameterx:
       
   451         ret = glTexParameterx();
       
   452         break;
       
   453     case OpenGlES11RFC::EglTexParameterxv:
       
   454         ret = glTexParameterxv();
       
   455         break;
       
   456     case OpenGlES11RFC::EglTexSubImage2D:
       
   457         ret = glTexSubImage2D();
       
   458         break;
       
   459     case OpenGlES11RFC::EglTranslatef:
       
   460         ret = glTranslatef();
       
   461         break;
       
   462     case OpenGlES11RFC::EglTranslatex:
       
   463         ret = glTranslatex();
       
   464         break;
       
   465     case OpenGlES11RFC::EglViewport:
       
   466         ret = glViewport();
       
   467         break;
       
   468 
       
   469     // from Eglextplatform.h
       
   470     case OpenGlES11RFC::EglCurrentPaletteMatrixOES:
       
   471         ret = glCurrentPaletteMatrixOES();
       
   472         break;
       
   473     case OpenGlES11RFC::EglDrawTexfOES:
       
   474         ret = glDrawTexfOES();
       
   475         break;
       
   476     case OpenGlES11RFC::EglDrawTexfvOES:
       
   477         ret = glDrawTexfvOES();
       
   478         break;
       
   479     case OpenGlES11RFC::EglDrawTexiOES:
       
   480         ret = glDrawTexiOES();
       
   481         break;
       
   482     case OpenGlES11RFC::EglDrawTexivOES:
       
   483         ret = glDrawTexivOES();
       
   484         break;
       
   485     case OpenGlES11RFC::EglDrawTexsOES:
       
   486         ret = glDrawTexsOES();
       
   487         break;
       
   488     case OpenGlES11RFC::EglDrawTexsvOES:
       
   489         ret = glDrawTexsvOES();
       
   490         break;
       
   491     case OpenGlES11RFC::EglDrawTexxOES:
       
   492         ret = glDrawTexxOES();
       
   493         break;
       
   494     case OpenGlES11RFC::EglDrawTexxvOES:
       
   495         ret = glDrawTexxvOES();
       
   496         break;
       
   497     case OpenGlES11RFC::EglLoadPaletteFromModelViewMatrixOES:
       
   498         ret = glLoadPaletteFromModelViewMatrixOES();
       
   499         break;
       
   500     case OpenGlES11RFC::EglQueryMatrixxOES:
       
   501         ret = glQueryMatrixxOES();
       
   502         break;
       
   503 
       
   504     case OpenGlES11RFC::EglColorPointer:
       
   505     case OpenGlES11RFC::EglNormalPointer:
       
   506     case OpenGlES11RFC::EglTexCoordPointer:
       
   507     case OpenGlES11RFC::EglVertexPointer:
       
   508     case OpenGlES11RFC::EglMatrixIndexPointerOES:
       
   509     case OpenGlES11RFC::EglWeightPointerOES:    
       
   510         TRACE("OpenGLES11APIWrapper: ERROR! Vertex pointer functions are not handled directly, should not be here\n");
       
   511         break;
       
   512         
       
   513     // client shutdown
       
   514     case OpenGlES11RFC::EClientShutdown:
       
   515         TRACE("OpenGLES11APIWrapper: Client shutdown unimplemented\n");
       
   516         break;
       
   517 
       
   518     default:
       
   519         TRACE("OpenGLES11APIWrapper: Unimplemented OpenGL ES Op code %u\n",aCode);
       
   520         break;
       
   521     }
       
   522     TRACE("OpenGLES11APIWrapper: OpenGL ES 1.1 command processed\n");
       
   523     return ret;
       
   524 }
       
   525 
       
   526 int OGLES11Wrapper::WriteReply()
       
   527 {
       
   528 #ifdef LOG_ERROR
       
   529     int operationid = (int)m_currentFunctionCall.Data().Header().iOpCode;
       
   530     
       
   531     int glerror = ::glGetError();
       
   532     if ( m_lastGlError != glerror )
       
   533     {
       
   534         if ( GL_NO_ERROR != glerror )
       
   535         {
       
   536             TRACE("OpenGLES11APIWrapper: OpenGL error 0x%X, for request %d\n", glerror, operationid );
       
   537         }
       
   538         m_lastGlError = glerror;
       
   539     }
       
   540 #endif
       
   541     return APIWrapper::WriteReply();
       
   542 }
       
   543 
       
   544 // ///////////////////////////////////////////////////
       
   545 // Here follows the functions that map to the GL calls
       
   546 
       
   547 
       
   548 int OGLES11Wrapper::glActiveTexture()
       
   549 {
       
   550     GLenum texture;
       
   551     m_currentFunctionCall.GetParamValue(texture, 0);
       
   552     ::glActiveTexture(texture);
       
   553     return WriteReply();
       
   554 }
       
   555 int OGLES11Wrapper::glAlphaFunc()
       
   556 {
       
   557     GLenum func;
       
   558     m_currentFunctionCall.GetParamValue(func, 0);
       
   559     GLclampf ref;
       
   560     m_currentFunctionCall.GetParamValue(ref, 1);
       
   561     ::glAlphaFunc(func, ref);
       
   562     return WriteReply();
       
   563 }
       
   564 int OGLES11Wrapper::glAlphaFuncx()
       
   565 {
       
   566     GLenum func;
       
   567     m_currentFunctionCall.GetParamValue(func, 0);
       
   568     GLclampx ref;
       
   569     m_currentFunctionCall.GetParamValue(ref, 1);
       
   570     ::glAlphaFuncx(func, ref);
       
   571     return WriteReply();
       
   572 }
       
   573 int OGLES11Wrapper::glBindBuffer()
       
   574 {
       
   575     GLenum target;
       
   576     m_currentFunctionCall.GetParamValue(target, 0);    
       
   577     GLuint buffer;
       
   578     m_currentFunctionCall.GetParamValue(buffer, 1);
       
   579     ::glBindBuffer(target, buffer);
       
   580     return WriteReply();
       
   581 }
       
   582 int OGLES11Wrapper::glBindTexture()
       
   583 {
       
   584     GLenum target;
       
   585     m_currentFunctionCall.GetParamValue(target, 0);    
       
   586     GLuint texIndex;
       
   587     m_currentFunctionCall.GetParamValue(texIndex, 1);
       
   588     ::glBindTexture(target, texIndex);
       
   589     return WriteReply();
       
   590 }
       
   591 int OGLES11Wrapper::glBlendFunc()
       
   592 {
       
   593     GLenum src;
       
   594     m_currentFunctionCall.GetParamValue(src, 0);
       
   595     GLenum dst;
       
   596     m_currentFunctionCall.GetParamValue(dst, 1);
       
   597     ::glBlendFunc(src, dst);
       
   598     return WriteReply();
       
   599 }
       
   600 int OGLES11Wrapper::glBufferData()
       
   601 {
       
   602     GLenum target;
       
   603     m_currentFunctionCall.GetParamValue(target, 0);
       
   604     //GLsizeiptr size;    
       
   605     GLint size;
       
   606     m_currentFunctionCall.GetParamValue(size, 1);
       
   607     
       
   608     void* data;
       
   609     //GLsizeiptr size2;
       
   610     GLint size2;
       
   611     m_currentFunctionCall.GetVectorData(data, size2, 2); //is this correct??
       
   612     //size == size2 ?
       
   613     
       
   614     GLenum usage;
       
   615     m_currentFunctionCall.GetParamValue(usage, 3);
       
   616     ::glBufferData(target, size, data, usage);
       
   617     return WriteReply();
       
   618 }
       
   619 int OGLES11Wrapper::glBufferSubData()
       
   620 {
       
   621     GLenum target;
       
   622     m_currentFunctionCall.GetParamValue(target, 0);
       
   623     //GLintptr offset;
       
   624     GLint offset;
       
   625     m_currentFunctionCall.GetParamValue(offset, 1);
       
   626     //GLsizeiptr size;
       
   627     GLint size;
       
   628     m_currentFunctionCall.GetParamValue(size, 2);
       
   629     void* data;
       
   630     //GLsizeiptr size2;
       
   631     GLint size2;
       
   632     m_currentFunctionCall.GetVectorData(data, size2, 3); //is this correct??
       
   633     ::glBufferSubData(target,offset,size,data);
       
   634     return WriteReply();
       
   635 }
       
   636 int OGLES11Wrapper::glClear()
       
   637 {
       
   638     GLbitfield buf;
       
   639     m_currentFunctionCall.GetParamValue(buf, 0);
       
   640     ::glClear(buf);
       
   641     return WriteReply();
       
   642 }
       
   643 int OGLES11Wrapper::glClearColor()
       
   644 {
       
   645     GLclampf r;
       
   646     m_currentFunctionCall.GetParamValue(r, 0);
       
   647     GLclampf g;
       
   648     m_currentFunctionCall.GetParamValue(g, 1);
       
   649     GLclampf b;
       
   650     m_currentFunctionCall.GetParamValue(b, 2);
       
   651     GLclampf a;
       
   652     m_currentFunctionCall.GetParamValue(a, 3);
       
   653     ::glClearColor(r,g,b,a);
       
   654     return WriteReply();
       
   655 }
       
   656 int OGLES11Wrapper::glClearColorx()
       
   657 {
       
   658     GLclampx r;
       
   659     m_currentFunctionCall.GetParamValue(r, 0);
       
   660     GLclampx g;
       
   661     m_currentFunctionCall.GetParamValue(g, 1);
       
   662     GLclampx b;
       
   663     m_currentFunctionCall.GetParamValue(b, 2);
       
   664     GLclampx a;
       
   665     m_currentFunctionCall.GetParamValue(a, 3);
       
   666     ::glClearColorx(r,g,b,a);
       
   667     return WriteReply();
       
   668 }
       
   669 int OGLES11Wrapper::glClearDepthf()
       
   670 {
       
   671     GLclampf d;
       
   672     m_currentFunctionCall.GetParamValue(d, 0);
       
   673     ::glClearDepthf(d);
       
   674     return WriteReply();
       
   675 }
       
   676 int OGLES11Wrapper::glClearDepthx()
       
   677 {
       
   678     GLfixed d;
       
   679     m_currentFunctionCall.GetParamValue(d, 0);
       
   680     ::glClearDepthx(d);    
       
   681     return WriteReply();
       
   682 }
       
   683 int OGLES11Wrapper::glClearStencil()
       
   684 {
       
   685     GLint s;
       
   686     m_currentFunctionCall.GetParamValue(s, 0);
       
   687     ::glClearStencil(s);     
       
   688     return WriteReply();
       
   689 }
       
   690 int OGLES11Wrapper::glClientActiveTexture()
       
   691 {
       
   692     GLenum texture;
       
   693     m_currentFunctionCall.GetParamValue(texture, 0);
       
   694     ::glClientActiveTexture(texture);     
       
   695     return WriteReply();
       
   696 }
       
   697 int OGLES11Wrapper::glClipPlanef()
       
   698 {
       
   699     GLenum plane;
       
   700     GLfloat* equation;
       
   701     m_currentFunctionCall.GetParamValue(plane, 0);
       
   702     //GLsizeiptr size;
       
   703     GLint size;
       
   704     m_currentFunctionCall.GetVectorData(equation, size, 1);
       
   705     ::glClipPlanef(plane,equation);
       
   706     return WriteReply();
       
   707 }
       
   708 int OGLES11Wrapper::glClipPlanex()
       
   709 {
       
   710     GLenum plane;
       
   711     GLfixed* equation;
       
   712     //GLsizeiptr size;
       
   713     GLint size;
       
   714     m_currentFunctionCall.GetParamValue(plane, 0);
       
   715     m_currentFunctionCall.GetVectorData(equation, size, 1);
       
   716     ::glClipPlanex(plane,equation);
       
   717     return WriteReply();
       
   718 }
       
   719 int OGLES11Wrapper::glColor4f()
       
   720 {
       
   721     GLfloat r,g,b,a;
       
   722     m_currentFunctionCall.GetParamValue(r, 0);
       
   723     m_currentFunctionCall.GetParamValue(g, 1);
       
   724     m_currentFunctionCall.GetParamValue(b, 2);
       
   725     m_currentFunctionCall.GetParamValue(a, 3);
       
   726     ::glColor4f(r,g,b,a);    
       
   727     return WriteReply();
       
   728 }
       
   729 int OGLES11Wrapper::glColor4ub()
       
   730 {
       
   731     GLubyte r,g,b,a;
       
   732     m_currentFunctionCall.GetParamValue(r, 0);
       
   733     m_currentFunctionCall.GetParamValue(g, 1);
       
   734     m_currentFunctionCall.GetParamValue(b, 2);
       
   735     m_currentFunctionCall.GetParamValue(a, 3);
       
   736     ::glColor4ub(r,g,b,a);  
       
   737     return WriteReply();
       
   738 }
       
   739 int OGLES11Wrapper::glColor4x()
       
   740 {
       
   741     GLfixed r,g,b,a;
       
   742     m_currentFunctionCall.GetParamValue(r, 0);
       
   743     m_currentFunctionCall.GetParamValue(g, 1);
       
   744     m_currentFunctionCall.GetParamValue(b, 2);
       
   745     m_currentFunctionCall.GetParamValue(a, 3);
       
   746     ::glColor4x(r,g,b,a);
       
   747     return WriteReply();
       
   748 }
       
   749 int OGLES11Wrapper::glColorMask()
       
   750 {
       
   751     GLboolean r,g,b,a;
       
   752     m_currentFunctionCall.GetParamValue(r, 0);
       
   753     m_currentFunctionCall.GetParamValue(g, 1);
       
   754     m_currentFunctionCall.GetParamValue(b, 2);
       
   755     m_currentFunctionCall.GetParamValue(a, 3);
       
   756     ::glColorMask(r,g,b,a);
       
   757     return WriteReply();
       
   758 }
       
   759 
       
   760 int OGLES11Wrapper::glCompressedTexImage2D()
       
   761 {
       
   762     GLenum target;
       
   763     GLint level;
       
   764     GLenum internalFormat;
       
   765     GLsizei width;
       
   766     GLsizei height;
       
   767     GLint border;
       
   768     GLsizei imageSize;
       
   769     GLvoid* data;
       
   770     //GLsizeiptr size;
       
   771     GLint size;
       
   772     m_currentFunctionCall.GetParamValue(target, 0);
       
   773     m_currentFunctionCall.GetParamValue(level, 1);
       
   774     m_currentFunctionCall.GetParamValue(internalFormat, 2);
       
   775     m_currentFunctionCall.GetParamValue(width, 3);
       
   776     m_currentFunctionCall.GetParamValue(height, 4);
       
   777     m_currentFunctionCall.GetParamValue(border, 5);
       
   778     m_currentFunctionCall.GetParamValue(imageSize, 6);
       
   779     m_currentFunctionCall.GetVectorData(data, size, 7);
       
   780     ::glCompressedTexImage2D(target,level,internalFormat,width,height,border,imageSize,data);
       
   781     return WriteReply();
       
   782 }
       
   783 int OGLES11Wrapper::glCompressedTexSubImage2D()
       
   784 {
       
   785     GLenum target;
       
   786     GLint level;
       
   787     GLint xoffset;
       
   788     GLint yoffset;
       
   789     GLsizei width;
       
   790     GLsizei height;
       
   791     GLenum format;
       
   792     GLsizei imageSize;
       
   793     GLvoid*   data;
       
   794     //GLsizeiptr size;
       
   795     GLint size;
       
   796     m_currentFunctionCall.GetParamValue(target, 0);
       
   797     m_currentFunctionCall.GetParamValue(level, 1);
       
   798     m_currentFunctionCall.GetParamValue(xoffset, 2);
       
   799     m_currentFunctionCall.GetParamValue(yoffset, 3);
       
   800     m_currentFunctionCall.GetParamValue(width, 4);
       
   801     m_currentFunctionCall.GetParamValue(height, 5);
       
   802     m_currentFunctionCall.GetParamValue(format, 6);
       
   803     m_currentFunctionCall.GetParamValue(imageSize, 7);
       
   804     m_currentFunctionCall.GetVectorData(data, size, 8);
       
   805     ::glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
       
   806     return WriteReply();
       
   807 }
       
   808 int OGLES11Wrapper::glCopyTexImage2D()
       
   809 {
       
   810     GLenum target;    
       
   811     GLint level;
       
   812     GLenum internalFormat;
       
   813     GLint x;
       
   814     GLint y;
       
   815     GLsizei width;
       
   816     GLsizei height;
       
   817     GLint border;
       
   818     m_currentFunctionCall.GetParamValue(target, 0);
       
   819     m_currentFunctionCall.GetParamValue(level, 1);
       
   820     m_currentFunctionCall.GetParamValue(internalFormat, 2);
       
   821     m_currentFunctionCall.GetParamValue(x, 3);
       
   822     m_currentFunctionCall.GetParamValue(y, 4);    
       
   823     m_currentFunctionCall.GetParamValue(width, 5);    
       
   824     m_currentFunctionCall.GetParamValue(height, 6);    
       
   825     m_currentFunctionCall.GetParamValue(border, 7);
       
   826     ::glCopyTexImage2D(target,level,internalFormat,x,y,width,height,border);
       
   827     return WriteReply();
       
   828 }
       
   829 int OGLES11Wrapper::glCopyTexSubImage2D()
       
   830 {
       
   831     GLenum  target;
       
   832     GLint   level;
       
   833     GLint   xoffset;
       
   834     GLint   yoffset;
       
   835     GLint   x;
       
   836     GLint   y;
       
   837     GLsizei width;
       
   838     GLsizei height;
       
   839     m_currentFunctionCall.GetParamValue(target, 0);
       
   840     m_currentFunctionCall.GetParamValue(level, 1);
       
   841     m_currentFunctionCall.GetParamValue(xoffset, 2);
       
   842     m_currentFunctionCall.GetParamValue(yoffset, 3);
       
   843     m_currentFunctionCall.GetParamValue(x, 4);
       
   844     m_currentFunctionCall.GetParamValue(y, 5);
       
   845     m_currentFunctionCall.GetParamValue(width, 6);
       
   846     m_currentFunctionCall.GetParamValue(height, 7);    
       
   847     ::glCopyTexSubImage2D(target,level,xoffset,yoffset,x,y,width,height);
       
   848     return WriteReply();
       
   849 }
       
   850 int OGLES11Wrapper::glCullFace()
       
   851 {
       
   852     GLenum mode;
       
   853 
       
   854     m_currentFunctionCall.GetParamValue(mode, 0);
       
   855 
       
   856     ::glCullFace(mode);
       
   857     return WriteReply();
       
   858 }
       
   859 int OGLES11Wrapper::glDeleteBuffers()
       
   860 {
       
   861     GLsizei n;
       
   862     GLuint *buffers;
       
   863 
       
   864     m_currentFunctionCall.GetParamValue(n, 0);
       
   865     TInt size1;
       
   866     m_currentFunctionCall.GetVectorData(buffers, size1, 1);
       
   867 
       
   868     ::glDeleteBuffers(n, buffers);
       
   869     return WriteReply();
       
   870 }
       
   871 int OGLES11Wrapper::glDeleteTextures()
       
   872 {
       
   873     GLsizei n;
       
   874     GLuint *textures;
       
   875 
       
   876     m_currentFunctionCall.GetParamValue(n, 0);
       
   877     TInt size1;
       
   878     m_currentFunctionCall.GetVectorData(textures, size1, 1);
       
   879 
       
   880     ::glDeleteTextures(n, textures);
       
   881     return WriteReply();
       
   882 }
       
   883 int OGLES11Wrapper::glDepthFunc()
       
   884 {
       
   885     GLenum func;
       
   886 
       
   887     m_currentFunctionCall.GetParamValue(func, 0);
       
   888 
       
   889     ::glDepthFunc(func);
       
   890     return WriteReply();
       
   891 }
       
   892 int OGLES11Wrapper::glDepthMask()
       
   893 {
       
   894     GLboolean flag;
       
   895 
       
   896     m_currentFunctionCall.GetParamValue(flag, 0);
       
   897 
       
   898     ::glDepthMask(flag);
       
   899     return WriteReply();
       
   900 }
       
   901 int OGLES11Wrapper::glDepthRangef()
       
   902 {
       
   903     GLclampf zNear;
       
   904     GLclampf zFar;
       
   905 
       
   906     m_currentFunctionCall.GetParamValue(zNear, 0);
       
   907     m_currentFunctionCall.GetParamValue(zFar, 1);
       
   908 
       
   909     ::glDepthRangef(zNear, zFar);
       
   910 
       
   911     return WriteReply();
       
   912 }
       
   913 int OGLES11Wrapper::glDepthRangex()
       
   914 {
       
   915     GLclampx zNear;
       
   916     GLclampx zFar;
       
   917 
       
   918     m_currentFunctionCall.GetParamValue(zNear, 0);
       
   919     m_currentFunctionCall.GetParamValue(zFar, 1);
       
   920 
       
   921     ::glDepthRangex(zNear, zFar);
       
   922 
       
   923     return WriteReply();
       
   924 }
       
   925 int OGLES11Wrapper::glDisable()
       
   926 {
       
   927     GLenum cap;
       
   928 
       
   929     m_currentFunctionCall.GetParamValue(cap, 0);
       
   930 
       
   931     ::glDisable(cap);
       
   932 
       
   933     return WriteReply();
       
   934 }
       
   935 int OGLES11Wrapper::glDisableClientState()
       
   936 {
       
   937     GLenum array;
       
   938 
       
   939     m_currentFunctionCall.GetParamValue(array, 0);
       
   940 
       
   941     ::glDisableClientState(array);
       
   942 
       
   943     return WriteReply();
       
   944 }
       
   945 int OGLES11Wrapper::glDrawArrays()
       
   946 {
       
   947     GLenum mode;
       
   948     GLint first;
       
   949     GLsizei count;
       
   950 
       
   951     m_currentFunctionCall.GetParamValue(mode, 0);
       
   952     m_currentFunctionCall.GetParamValue(first, 1);
       
   953     m_currentFunctionCall.GetParamValue(count, 2);
       
   954 
       
   955     // Get the data arrays themselves -- note that this is additional data
       
   956     TInt arrayCount, arrayEnabled;
       
   957     m_currentFunctionCall.GetParamValue(arrayCount, 3);
       
   958     m_currentFunctionCall.GetParamValue(arrayEnabled, 4);
       
   959 
       
   960     vertexArrayInfo *vertexArrays;
       
   961     vertexArrays = (vertexArrayInfo *) malloc(arrayCount * sizeof(vertexArrayInfo));
       
   962 
       
   963     for (int i=0; i<arrayCount; i++)
       
   964     {
       
   965         m_currentFunctionCall.GetParamValue(vertexArrays[i].size, 5 + 4*i);
       
   966         m_currentFunctionCall.GetParamValue(vertexArrays[i].type, 6 + 4*i);
       
   967         m_currentFunctionCall.GetParamValue(vertexArrays[i].stride, 7 + 4*i);
       
   968         TInt size;
       
   969         m_currentFunctionCall.GetVectorData(vertexArrays[i].pointer, size, 8 + 4*i);
       
   970     }
       
   971     
       
   972     int x = 0; //position in the vertexArrays, 'i' in the loop above
       
   973     for(int i=0; i<NUM_ARRAYS; i++) 
       
   974     {
       
   975         switch( i )
       
   976         {
       
   977             case COLOR_ARRAY:
       
   978                 if (arrayEnabled & (1<<6))
       
   979                 {
       
   980                     ::glColorPointer(vertexArrays[x].size, vertexArrays[x].type, vertexArrays[x].stride, vertexArrays[x].pointer);
       
   981                     x++;
       
   982                 }
       
   983                 break;
       
   984             case NORMAL_ARRAY:
       
   985                 if (arrayEnabled & (1<<5))
       
   986                 {
       
   987                     ::glNormalPointer(vertexArrays[x].type, vertexArrays[x].stride, vertexArrays[x].pointer);
       
   988                     x++;
       
   989                 }
       
   990                 break;
       
   991             case POINT_SIZE_ARRAY:
       
   992                 if (arrayEnabled & (1<<4))
       
   993                 {
       
   994                     ::glPointSizePointerOES(vertexArrays[x].type, vertexArrays[x].stride, vertexArrays[x].pointer);
       
   995                     x++;
       
   996                 }
       
   997                 break;
       
   998             case TEX_COORD_ARRAY:
       
   999                 if (arrayEnabled & (1<<3))
       
  1000                 {
       
  1001                     ::glTexCoordPointer(vertexArrays[x].size, vertexArrays[x].type, vertexArrays[x].stride, vertexArrays[x].pointer);
       
  1002                     x++;
       
  1003                 }
       
  1004                 break;
       
  1005             case VERTEX_ARRAY:
       
  1006                 if (arrayEnabled & (1<<2)){
       
  1007                     ::glVertexPointer(vertexArrays[x].size, vertexArrays[x].type, vertexArrays[x].stride, vertexArrays[x].pointer);
       
  1008                     x++;
       
  1009                 }
       
  1010                 break;
       
  1011             case MATRIX_INDEX_ARRAY:
       
  1012                 break;
       
  1013             case WEIGHT_ARRAY:
       
  1014                 break;
       
  1015             default:
       
  1016                 // Do nothing
       
  1017                 break;
       
  1018         }   
       
  1019     }
       
  1020 
       
  1021     ::glDrawArrays(mode, first, count);
       
  1022     return WriteReply();
       
  1023 }
       
  1024 int OGLES11Wrapper::glDrawElements()
       
  1025 {
       
  1026     GLenum mode;
       
  1027     GLsizei count;
       
  1028     GLenum type;
       
  1029     GLvoid *indices;
       
  1030 
       
  1031     m_currentFunctionCall.GetParamValue(mode, 0);
       
  1032     m_currentFunctionCall.GetParamValue(count, 1);
       
  1033     m_currentFunctionCall.GetParamValue(type, 2);
       
  1034     TInt size3;
       
  1035     m_currentFunctionCall.GetVectorData(indices, size3, 3);
       
  1036 
       
  1037     // Get the data arrays themselves -- note that this is additional data
       
  1038     TInt arrayCount, arrayEnabled;
       
  1039     m_currentFunctionCall.GetParamValue(arrayCount, 4);
       
  1040     m_currentFunctionCall.GetParamValue(arrayEnabled, 5);
       
  1041 
       
  1042     vertexArrayInfo *vertexArrays;
       
  1043     vertexArrays = (vertexArrayInfo *) malloc(arrayCount * sizeof(vertexArrayInfo));
       
  1044 
       
  1045     for (int i=0; i<arrayCount; i++)
       
  1046     {
       
  1047         m_currentFunctionCall.GetParamValue(vertexArrays[i].size, 6 + 4*i);
       
  1048         m_currentFunctionCall.GetParamValue(vertexArrays[i].type, 7 + 4*i);
       
  1049         m_currentFunctionCall.GetParamValue(vertexArrays[i].stride, 8 + 4*i);
       
  1050         TInt size;
       
  1051         m_currentFunctionCall.GetVectorData(vertexArrays[i].pointer, size, 9 + 4*i);
       
  1052     }
       
  1053     
       
  1054     int x = 0; //position in the vertexArrays, 'i' in the loop above
       
  1055     for(int i=0; i<NUM_ARRAYS; i++) 
       
  1056     {
       
  1057         switch( i )
       
  1058         {
       
  1059             case COLOR_ARRAY:
       
  1060                 if (arrayEnabled & (1<<6))
       
  1061                 {
       
  1062                     ::glColorPointer(vertexArrays[x].size, vertexArrays[x].type, vertexArrays[x].stride, vertexArrays[x].pointer);
       
  1063                     x++;
       
  1064                 }
       
  1065                 break;
       
  1066             case NORMAL_ARRAY:
       
  1067                 if (arrayEnabled & (1<<5))
       
  1068                 {
       
  1069                     ::glNormalPointer(vertexArrays[x].type, vertexArrays[x].stride, vertexArrays[x].pointer);
       
  1070                     x++;
       
  1071                 }
       
  1072                 break;
       
  1073             case POINT_SIZE_ARRAY:
       
  1074                 if (arrayEnabled & (1<<4))
       
  1075                 {
       
  1076                     ::glPointSizePointerOES(vertexArrays[x].type, vertexArrays[x].stride, vertexArrays[x].pointer);
       
  1077                     x++;
       
  1078                 }
       
  1079                 break;
       
  1080             case TEX_COORD_ARRAY:
       
  1081                 if (arrayEnabled & (1<<3))
       
  1082                 {
       
  1083                     ::glTexCoordPointer(vertexArrays[x].size, vertexArrays[x].type, vertexArrays[x].stride, vertexArrays[x].pointer);
       
  1084                     x++;
       
  1085                 }
       
  1086                 break;
       
  1087             case VERTEX_ARRAY:
       
  1088                 if (arrayEnabled & (1<<2)){
       
  1089                     ::glVertexPointer(vertexArrays[x].size, vertexArrays[x].type, vertexArrays[x].stride, vertexArrays[x].pointer);
       
  1090                     x++;
       
  1091                 }
       
  1092                 break;
       
  1093             case MATRIX_INDEX_ARRAY:
       
  1094                 break;
       
  1095             case WEIGHT_ARRAY:
       
  1096                 break;
       
  1097             default:
       
  1098                 // Do nothing
       
  1099                 break;
       
  1100         }   
       
  1101     }
       
  1102 
       
  1103 
       
  1104     ::glDrawElements(mode, count, type, indices);
       
  1105     return WriteReply();
       
  1106 }
       
  1107 int OGLES11Wrapper::glEnable()
       
  1108 {
       
  1109     GLenum cap;
       
  1110 
       
  1111     m_currentFunctionCall.GetParamValue(cap, 0);
       
  1112 
       
  1113     ::glEnable(cap);
       
  1114 
       
  1115     return WriteReply();
       
  1116 }
       
  1117 int OGLES11Wrapper::glEnableClientState()
       
  1118 {
       
  1119     GLenum array;
       
  1120 
       
  1121     m_currentFunctionCall.GetParamValue(array, 0);
       
  1122 
       
  1123     ::glEnableClientState(array);
       
  1124 
       
  1125     return WriteReply();
       
  1126 }
       
  1127 int OGLES11Wrapper::glFinish()
       
  1128 {
       
  1129     ::glFinish();
       
  1130     return WriteReply();
       
  1131 }
       
  1132 int OGLES11Wrapper::glFlush()
       
  1133 {
       
  1134     ::glFlush();
       
  1135     return WriteReply();
       
  1136 }
       
  1137 int OGLES11Wrapper::glFogf()
       
  1138 {
       
  1139     GLenum pname;
       
  1140     GLfloat param;
       
  1141 
       
  1142     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1143     m_currentFunctionCall.GetParamValue(param, 1);
       
  1144 
       
  1145     ::glFogf(pname, param);
       
  1146 
       
  1147     return WriteReply();
       
  1148 }
       
  1149 int OGLES11Wrapper::glFogfv()
       
  1150 {
       
  1151     GLenum pname;
       
  1152     GLfloat *params;
       
  1153 
       
  1154     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1155     TInt size1;
       
  1156     m_currentFunctionCall.GetVectorData(params, size1, 1);
       
  1157 
       
  1158     ::glFogfv(pname, params);
       
  1159 
       
  1160     return WriteReply();
       
  1161 }
       
  1162 int OGLES11Wrapper::glFogx()
       
  1163 {
       
  1164     GLenum pname;
       
  1165     GLfixed param;
       
  1166 
       
  1167     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1168     m_currentFunctionCall.GetParamValue(param, 1);
       
  1169 
       
  1170     ::glFogx(pname, param);
       
  1171 
       
  1172     return WriteReply();
       
  1173 }
       
  1174 int OGLES11Wrapper::glFogxv()
       
  1175 {
       
  1176     GLenum pname;
       
  1177     GLfixed *params;
       
  1178 
       
  1179     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1180     TInt size1;
       
  1181     m_currentFunctionCall.GetVectorData(params, size1, 1);
       
  1182 
       
  1183     ::glFogxv(pname, params);
       
  1184 
       
  1185     return WriteReply();
       
  1186 }
       
  1187 int OGLES11Wrapper::glFrontFace()
       
  1188 {
       
  1189     GLenum mode;
       
  1190 
       
  1191     m_currentFunctionCall.GetParamValue(mode, 0);
       
  1192 
       
  1193     ::glFrontFace(mode);
       
  1194 
       
  1195     return WriteReply();
       
  1196 }
       
  1197 int OGLES11Wrapper::glFrustumf()
       
  1198 {
       
  1199     GLfloat left;
       
  1200     GLfloat right;
       
  1201     GLfloat bottom;
       
  1202     GLfloat top;
       
  1203     GLfloat zNear;
       
  1204     GLfloat zFar;
       
  1205 
       
  1206     m_currentFunctionCall.GetParamValue(left, 0);
       
  1207     m_currentFunctionCall.GetParamValue(right, 1);
       
  1208     m_currentFunctionCall.GetParamValue(bottom, 2);
       
  1209     m_currentFunctionCall.GetParamValue(top, 3);
       
  1210     m_currentFunctionCall.GetParamValue(zNear, 4);
       
  1211     m_currentFunctionCall.GetParamValue(zFar, 5);
       
  1212 
       
  1213     ::glFrustumf(left, right, bottom, top, zNear, zFar);
       
  1214 
       
  1215     return WriteReply();
       
  1216 }
       
  1217 int OGLES11Wrapper::glFrustumx()
       
  1218 {
       
  1219     GLfixed left;
       
  1220     GLfixed right;
       
  1221     GLfixed bottom;
       
  1222     GLfixed top;
       
  1223     GLfixed zNear;
       
  1224     GLfixed zFar;
       
  1225 
       
  1226     m_currentFunctionCall.GetParamValue(left, 0);
       
  1227     m_currentFunctionCall.GetParamValue(right, 1);
       
  1228     m_currentFunctionCall.GetParamValue(bottom, 2);
       
  1229     m_currentFunctionCall.GetParamValue(top, 3);
       
  1230     m_currentFunctionCall.GetParamValue(zNear, 4);
       
  1231     m_currentFunctionCall.GetParamValue(zFar, 5);
       
  1232 
       
  1233     ::glFrustumx(left, right, bottom, top, zNear, zFar);
       
  1234 
       
  1235     return WriteReply();
       
  1236 }
       
  1237 int OGLES11Wrapper::glGenBuffers()
       
  1238 {
       
  1239     GLsizei n;
       
  1240     m_currentFunctionCall.GetParamValue(n, 0);
       
  1241     
       
  1242     GLuint *buffers = (GLuint*)iStack->AllocFromStack( n*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLuint ),
       
  1243         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLuint ) );
       
  1244 
       
  1245     ::glGenBuffers(n, buffers);
       
  1246 
       
  1247     m_currentFunctionCall.SetVectorData( buffers, n, 1 ); // EOut
       
  1248     //TODO: when do we free the allocated buffer??
       
  1249     
       
  1250     int ret = WriteReply(); //TODO: clarify the copy-pasted magic sequence
       
  1251     iStack->ClearStack();
       
  1252     buffers = NULL;
       
  1253     return ret; 
       
  1254 }
       
  1255 int OGLES11Wrapper::glGenTextures()
       
  1256 {
       
  1257     GLsizei n;
       
  1258     m_currentFunctionCall.GetParamValue(n, 0);
       
  1259     
       
  1260     GLuint *textures = (GLuint*)iStack->AllocFromStack( n*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLuint ),
       
  1261         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLuint ) );
       
  1262 
       
  1263     ::glGenTextures(n, textures);
       
  1264 
       
  1265     m_currentFunctionCall.SetVectorData( textures, n, 1 ); // EOut
       
  1266 
       
  1267     int ret = WriteReply();
       
  1268     iStack->ClearStack();
       
  1269     textures = NULL;
       
  1270     return ret;    
       
  1271 }
       
  1272 int OGLES11Wrapper::glGetBooleanv()
       
  1273 {
       
  1274     GLenum pname;
       
  1275     GLboolean *params;
       
  1276 
       
  1277     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1278     TInt size1;
       
  1279     m_currentFunctionCall.GetVectorData(params, size1, 1);
       
  1280     
       
  1281     params = (GLboolean*)iStack->AllocFromStack( size1*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLboolean ),
       
  1282         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLboolean ) );
       
  1283         
       
  1284     ::glGetBooleanv(pname, params); //TODO: how does the ::glGetBooleanv know the array size?
       
  1285     
       
  1286     m_currentFunctionCall.SetVectorData( params, size1, 1 ); // EOut    
       
  1287 
       
  1288     int ret = WriteReply();
       
  1289     iStack->ClearStack();
       
  1290     params = NULL;
       
  1291     return ret; 
       
  1292 }
       
  1293 int OGLES11Wrapper::glGetBufferParameteriv()
       
  1294 {
       
  1295     GLenum target;
       
  1296     GLenum pname;
       
  1297     GLint *params;
       
  1298 
       
  1299     m_currentFunctionCall.GetParamValue(target, 0);
       
  1300     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1301     TInt size2;
       
  1302     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1303 
       
  1304     params = (GLint*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLint ),
       
  1305         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLint ) );
       
  1306 
       
  1307     ::glGetBufferParameteriv(target, pname, params);
       
  1308 
       
  1309     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1310 
       
  1311     int ret = WriteReply();
       
  1312     iStack->ClearStack();
       
  1313     params = NULL;
       
  1314     return ret; 
       
  1315 }
       
  1316 int OGLES11Wrapper::glGetClipPlanef()
       
  1317 {
       
  1318     GLenum pname;
       
  1319     GLfloat *equation;
       
  1320 
       
  1321     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1322     TInt size1;
       
  1323     m_currentFunctionCall.GetVectorData(equation, size1, 1);
       
  1324 
       
  1325     equation = (GLfloat*)iStack->AllocFromStack( size1*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLfloat ),
       
  1326         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLfloat ) );
       
  1327 
       
  1328 
       
  1329     ::glGetClipPlanef(pname, equation);
       
  1330 
       
  1331     m_currentFunctionCall.SetVectorData( equation, size1, 1 ); // EOut    
       
  1332 
       
  1333     int ret = WriteReply();
       
  1334     iStack->ClearStack();
       
  1335     equation = NULL;
       
  1336     return ret; 
       
  1337 }
       
  1338 int OGLES11Wrapper::glGetClipPlanex()
       
  1339 {
       
  1340     GLenum pname;
       
  1341     GLfixed *eqn;
       
  1342 
       
  1343     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1344     TInt size1;
       
  1345     m_currentFunctionCall.GetVectorData(eqn, size1, 1);
       
  1346 
       
  1347     eqn = (GLfixed*)iStack->AllocFromStack( size1*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLint ),
       
  1348         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLint ) );
       
  1349 
       
  1350     ::glGetClipPlanex(pname, eqn);
       
  1351     
       
  1352     m_currentFunctionCall.SetVectorData( eqn, size1, 1 ); // EOut    
       
  1353 
       
  1354     int ret = WriteReply();
       
  1355     iStack->ClearStack();
       
  1356     eqn = NULL;
       
  1357     return ret; 
       
  1358 }
       
  1359 int OGLES11Wrapper::glGetError()
       
  1360 {
       
  1361     GLenum ret = ::glGetError();
       
  1362     m_currentFunctionCall.SetReturnValue((TUint32) ret);
       
  1363     return WriteReply();
       
  1364 }
       
  1365 int OGLES11Wrapper::glGetFixedv()
       
  1366 {
       
  1367     GLenum pname;
       
  1368     GLfixed *params;
       
  1369 
       
  1370     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1371     TInt size1;
       
  1372     m_currentFunctionCall.GetVectorData(params, size1, 1);
       
  1373 
       
  1374     params = (GLfixed*)iStack->AllocFromStack( size1*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLint ),
       
  1375     m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLint ) );        
       
  1376 
       
  1377     ::glGetFixedv(pname, params);
       
  1378 
       
  1379     m_currentFunctionCall.SetVectorData( params, size1, 1 ); // EOut    
       
  1380 
       
  1381     int ret = WriteReply();
       
  1382     iStack->ClearStack();
       
  1383     params = NULL;
       
  1384     return ret; 
       
  1385 }
       
  1386 int OGLES11Wrapper::glGetFloatv()
       
  1387 {
       
  1388     GLenum pname;
       
  1389     GLfloat *params;
       
  1390 
       
  1391     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1392     TInt size1;
       
  1393     m_currentFunctionCall.GetVectorData(params, size1, 1);
       
  1394 
       
  1395     params = (GLfloat*)iStack->AllocFromStack( size1*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLfloat ),
       
  1396     m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLfloat ) ); 
       
  1397     
       
  1398     ::glGetFloatv(pname, params);
       
  1399 
       
  1400     m_currentFunctionCall.SetVectorData( params, size1, 1 ); // EOut    
       
  1401 
       
  1402     int ret = WriteReply();
       
  1403     iStack->ClearStack();
       
  1404     params = NULL;
       
  1405     return ret; 
       
  1406 }
       
  1407 int OGLES11Wrapper::glGetIntegerv()
       
  1408 {
       
  1409     GLenum pname;
       
  1410     GLint *params;
       
  1411 
       
  1412     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1413     TInt size1;
       
  1414     m_currentFunctionCall.GetVectorData(params, size1, 1);
       
  1415 
       
  1416     params = (GLint*)iStack->AllocFromStack( size1*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLint ),
       
  1417     m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLint ) ); 
       
  1418     
       
  1419     ::glGetIntegerv(pname, params);
       
  1420 
       
  1421     m_currentFunctionCall.SetVectorData( params, size1, 1 ); // EOut    
       
  1422 
       
  1423     int ret = WriteReply();
       
  1424     iStack->ClearStack();
       
  1425     params = NULL;
       
  1426     return ret;
       
  1427 }
       
  1428 int OGLES11Wrapper::glGetLightfv()
       
  1429 {
       
  1430     GLenum light;
       
  1431     GLenum pname;
       
  1432     GLfloat *params;
       
  1433 
       
  1434     m_currentFunctionCall.GetParamValue(light, 0);
       
  1435     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1436     TInt size2;
       
  1437     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1438 
       
  1439     params = (GLfloat*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLfloat ),
       
  1440     m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLfloat ) );
       
  1441     
       
  1442     ::glGetLightfv(light, pname, params);
       
  1443     
       
  1444     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1445 
       
  1446     int ret = WriteReply();
       
  1447     iStack->ClearStack();
       
  1448     params = NULL;
       
  1449     return ret;
       
  1450 }
       
  1451 int OGLES11Wrapper::glGetLightxv()
       
  1452 {
       
  1453     GLenum light;
       
  1454     GLenum pname;
       
  1455     GLfixed *params;
       
  1456 
       
  1457     m_currentFunctionCall.GetParamValue(light, 0);
       
  1458     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1459     TInt size2;
       
  1460     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1461     
       
  1462     params = (GLfixed*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLint ),
       
  1463         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLint ) );
       
  1464 
       
  1465     ::glGetLightxv(light, pname, params);
       
  1466 
       
  1467     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1468 
       
  1469     int ret = WriteReply();
       
  1470     iStack->ClearStack();
       
  1471     params = NULL;
       
  1472     return ret;
       
  1473 }
       
  1474 int OGLES11Wrapper::glGetMaterialfv()
       
  1475 {
       
  1476     GLenum face;
       
  1477     GLenum pname;
       
  1478     GLfloat *params;
       
  1479 
       
  1480     m_currentFunctionCall.GetParamValue(face, 0);
       
  1481     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1482     TInt size2;
       
  1483     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1484 
       
  1485     params = (GLfloat*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLfloat ),
       
  1486         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLfloat ) );
       
  1487     
       
  1488     ::glGetMaterialfv(face, pname, params);
       
  1489 
       
  1490     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1491 
       
  1492     int ret = WriteReply();
       
  1493     iStack->ClearStack();
       
  1494     params = NULL;
       
  1495     return ret;
       
  1496 }
       
  1497 int OGLES11Wrapper::glGetMaterialxv()
       
  1498 {
       
  1499     GLenum face;
       
  1500     GLenum pname;
       
  1501     GLfixed *params;
       
  1502 
       
  1503     m_currentFunctionCall.GetParamValue(face, 0);
       
  1504     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1505     TInt size2;
       
  1506     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1507 
       
  1508     params = (GLfixed*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLint ),
       
  1509         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLint ) );
       
  1510         
       
  1511     ::glGetMaterialxv(face, pname, params);
       
  1512 
       
  1513     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1514 
       
  1515     int ret = WriteReply();
       
  1516     iStack->ClearStack();
       
  1517     params = NULL;
       
  1518     return ret;
       
  1519 }
       
  1520 int OGLES11Wrapper::glGetPointerv()
       
  1521 {
       
  1522     //never gets called?
       
  1523     return WriteReply();
       
  1524 }
       
  1525 int OGLES11Wrapper::glGetString()
       
  1526 {
       
  1527     // Not used
       
  1528     return WriteReply();
       
  1529 }
       
  1530 int OGLES11Wrapper::glGetTexEnvfv()
       
  1531 {
       
  1532     GLenum env;
       
  1533     GLenum pname;
       
  1534     GLfloat *params;
       
  1535 
       
  1536     m_currentFunctionCall.GetParamValue(env, 0);
       
  1537     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1538     TInt size2;
       
  1539     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1540 
       
  1541     params = (GLfloat*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLfloat ),
       
  1542         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLfloat ) );
       
  1543         
       
  1544     ::glGetTexEnvfv(env, pname, params);
       
  1545 
       
  1546     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1547 
       
  1548     int ret = WriteReply();
       
  1549     iStack->ClearStack();
       
  1550     params = NULL;
       
  1551     return ret;
       
  1552 }
       
  1553 int OGLES11Wrapper::glGetTexEnviv()
       
  1554 {
       
  1555     GLenum env;
       
  1556     GLenum pname;
       
  1557     GLint *params;
       
  1558 
       
  1559     m_currentFunctionCall.GetParamValue(env, 0);
       
  1560     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1561     TInt size2;
       
  1562     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1563 
       
  1564     params = (GLint*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLint ),
       
  1565         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLint ) );
       
  1566         
       
  1567     ::glGetTexEnviv(env, pname, params);
       
  1568 
       
  1569     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1570 
       
  1571     int ret = WriteReply();
       
  1572     iStack->ClearStack();
       
  1573     params = NULL;
       
  1574     return ret;
       
  1575 }
       
  1576 int OGLES11Wrapper::glGetTexEnvxv()
       
  1577 {
       
  1578     GLenum env;
       
  1579     GLenum pname;
       
  1580     GLfixed *params;
       
  1581 
       
  1582     m_currentFunctionCall.GetParamValue(env, 0);
       
  1583     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1584     TInt size2;
       
  1585     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1586 
       
  1587     params = (GLfixed*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLint ),
       
  1588         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLint ) );
       
  1589         
       
  1590     ::glGetTexEnvxv(env, pname, params);
       
  1591 
       
  1592     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1593 
       
  1594     int ret = WriteReply();
       
  1595     iStack->ClearStack();
       
  1596     params = NULL;
       
  1597     return ret;
       
  1598 }
       
  1599 int OGLES11Wrapper::glGetTexParameterfv()
       
  1600 {
       
  1601     GLenum target;
       
  1602     GLenum pname;
       
  1603     GLfloat *params;
       
  1604 
       
  1605     m_currentFunctionCall.GetParamValue(target, 0);
       
  1606     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1607     TInt size2;
       
  1608     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1609 
       
  1610     params = (GLfloat*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLfloat ),    
       
  1611         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLfloat ) );
       
  1612         
       
  1613     ::glGetTexParameterfv(target, pname, params);
       
  1614 
       
  1615     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1616 
       
  1617     int ret = WriteReply();
       
  1618     iStack->ClearStack();
       
  1619     params = NULL;
       
  1620     return ret;
       
  1621 }
       
  1622 int OGLES11Wrapper::glGetTexParameteriv()
       
  1623 {
       
  1624     GLenum target;
       
  1625     GLenum pname;
       
  1626     GLint *params;
       
  1627 
       
  1628     m_currentFunctionCall.GetParamValue(target, 0);
       
  1629     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1630     TInt size2;
       
  1631     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1632 
       
  1633     params = (GLint*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLint ),
       
  1634         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLint ) );
       
  1635         
       
  1636     ::glGetTexParameteriv(target, pname, params);
       
  1637 
       
  1638     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1639 
       
  1640     int ret = WriteReply();
       
  1641     iStack->ClearStack();
       
  1642     params = NULL;
       
  1643     return ret;
       
  1644 }
       
  1645 int OGLES11Wrapper::glGetTexParameterxv()
       
  1646 {
       
  1647     GLenum target;
       
  1648     GLenum pname;
       
  1649     GLfixed *params;
       
  1650 
       
  1651     m_currentFunctionCall.GetParamValue(target, 0);
       
  1652     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1653     TInt size2;
       
  1654     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1655 
       
  1656     params = (GLint*)iStack->AllocFromStack( size2*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLint ),
       
  1657         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLint ) );
       
  1658         
       
  1659     ::glGetTexParameterxv(target, pname, params);
       
  1660     
       
  1661     m_currentFunctionCall.SetVectorData( params, size2, 2 ); // EOut    
       
  1662 
       
  1663     int ret = WriteReply();
       
  1664     iStack->ClearStack();
       
  1665     params = NULL;
       
  1666     return ret;
       
  1667 }
       
  1668 int OGLES11Wrapper::glHint()
       
  1669 {
       
  1670     GLenum target;
       
  1671     GLenum mode;
       
  1672 
       
  1673     m_currentFunctionCall.GetParamValue(target, 0);
       
  1674     m_currentFunctionCall.GetParamValue(mode, 1);
       
  1675 
       
  1676     ::glHint(target, mode);
       
  1677     
       
  1678     return WriteReply();
       
  1679 }
       
  1680 int OGLES11Wrapper::glIsBuffer()
       
  1681 {
       
  1682     GLuint buffer;
       
  1683 
       
  1684     m_currentFunctionCall.GetParamValue(buffer, 0);
       
  1685 
       
  1686     GLboolean ret = ::glIsBuffer(buffer);
       
  1687     m_currentFunctionCall.SetReturnValue( ret);
       
  1688 
       
  1689     return WriteReply();
       
  1690 }
       
  1691 int OGLES11Wrapper::glIsEnabled()
       
  1692 {
       
  1693     GLenum cap;
       
  1694     m_currentFunctionCall.GetParamValue(cap, 0);
       
  1695     
       
  1696     GLboolean ret = ::glIsEnabled(cap);
       
  1697     m_currentFunctionCall.SetReturnValue( ret);
       
  1698     
       
  1699     return WriteReply();
       
  1700 }
       
  1701 int OGLES11Wrapper::glIsTexture()
       
  1702 {
       
  1703     GLuint texIndex;
       
  1704     m_currentFunctionCall.GetParamValue(texIndex, 0);
       
  1705     
       
  1706     GLboolean ret = ::glIsEnabled(texIndex);
       
  1707     m_currentFunctionCall.SetReturnValue( ret);
       
  1708         
       
  1709     return WriteReply();
       
  1710 }
       
  1711 int OGLES11Wrapper::glLightModelf()
       
  1712 {
       
  1713     GLenum pname;
       
  1714     GLfloat param;
       
  1715 
       
  1716     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1717     m_currentFunctionCall.GetParamValue(param, 1);
       
  1718 
       
  1719     ::glLightModelf(pname, param);
       
  1720 
       
  1721     return WriteReply();
       
  1722 }
       
  1723 int OGLES11Wrapper::glLightModelfv()
       
  1724 {
       
  1725     GLenum pname;
       
  1726     GLfloat *params;
       
  1727 
       
  1728     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1729     TInt size1;
       
  1730     m_currentFunctionCall.GetVectorData(params, size1, 1);
       
  1731 
       
  1732     ::glLightModelfv(pname, params);
       
  1733 
       
  1734     return WriteReply();
       
  1735 }
       
  1736 int OGLES11Wrapper::glLightModelx()
       
  1737 {
       
  1738     GLenum pname;
       
  1739     GLfixed param;
       
  1740 
       
  1741     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1742     m_currentFunctionCall.GetParamValue(param, 1);
       
  1743 
       
  1744     ::glLightModelx(pname, param);
       
  1745 
       
  1746     return WriteReply();
       
  1747 }
       
  1748 int OGLES11Wrapper::glLightModelxv()
       
  1749 {
       
  1750     GLenum pname;
       
  1751     GLfixed *params;
       
  1752 
       
  1753     m_currentFunctionCall.GetParamValue(pname, 0);
       
  1754     TInt size1;
       
  1755     m_currentFunctionCall.GetVectorData(params, size1, 1);
       
  1756 
       
  1757     ::glLightModelxv(pname, params);
       
  1758 
       
  1759     return WriteReply();
       
  1760 }
       
  1761 int OGLES11Wrapper::glLightf()
       
  1762 {
       
  1763     GLenum light;
       
  1764     GLenum pname;
       
  1765     GLfloat param;
       
  1766 
       
  1767     m_currentFunctionCall.GetParamValue(light, 0);
       
  1768     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1769     m_currentFunctionCall.GetParamValue(param, 2);
       
  1770 
       
  1771     ::glLightf(light, pname, param);
       
  1772 
       
  1773     return WriteReply();
       
  1774 }
       
  1775 int OGLES11Wrapper::glLightfv()
       
  1776 {
       
  1777     GLenum light;
       
  1778     GLenum pname;
       
  1779     GLfloat *params;
       
  1780 
       
  1781     m_currentFunctionCall.GetParamValue(light, 0);
       
  1782     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1783     TInt size2;
       
  1784     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1785 
       
  1786     ::glLightfv(light, pname, params);
       
  1787 
       
  1788     return WriteReply();
       
  1789 }
       
  1790 int OGLES11Wrapper::glLightx()
       
  1791 {
       
  1792     GLenum light;
       
  1793     GLenum pname;
       
  1794     GLfixed param;
       
  1795 
       
  1796     m_currentFunctionCall.GetParamValue(light, 0);
       
  1797     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1798     m_currentFunctionCall.GetParamValue(param, 2);
       
  1799 
       
  1800     ::glLightx(light, pname, param);
       
  1801 
       
  1802     return WriteReply();
       
  1803 }
       
  1804 int OGLES11Wrapper::glLightxv()
       
  1805 {
       
  1806     GLenum light;
       
  1807     GLenum pname;
       
  1808     GLfixed *params;
       
  1809 
       
  1810     m_currentFunctionCall.GetParamValue(light, 0);
       
  1811     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1812     TInt size2;
       
  1813     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1814 
       
  1815     ::glLightxv(light, pname, params);
       
  1816     return WriteReply();
       
  1817 }
       
  1818 int OGLES11Wrapper::glLineWidth()
       
  1819 {
       
  1820     GLfloat width;
       
  1821 
       
  1822     m_currentFunctionCall.GetParamValue(width, 0);
       
  1823 
       
  1824     ::glLineWidth(width);
       
  1825 
       
  1826     return WriteReply();
       
  1827 }
       
  1828 int OGLES11Wrapper::glLineWidthx()
       
  1829 {
       
  1830     GLfixed width;
       
  1831 
       
  1832     m_currentFunctionCall.GetParamValue(width, 0);
       
  1833 
       
  1834     ::glLineWidthx(width);
       
  1835 
       
  1836     return WriteReply();
       
  1837 }
       
  1838 int OGLES11Wrapper::glLoadIdentity()
       
  1839 {
       
  1840     ::glLoadIdentity();
       
  1841     return WriteReply();
       
  1842 }
       
  1843 int OGLES11Wrapper::glLoadMatrixf()
       
  1844 {
       
  1845     GLfloat *m;
       
  1846 
       
  1847     TInt size0;
       
  1848     m_currentFunctionCall.GetVectorData(m, size0, 0);
       
  1849 
       
  1850     ::glLoadMatrixf(m);
       
  1851 
       
  1852     return WriteReply();
       
  1853 }
       
  1854 int OGLES11Wrapper::glLoadMatrixx()
       
  1855 {
       
  1856     GLfixed *m;
       
  1857 
       
  1858     TInt size0;
       
  1859     m_currentFunctionCall.GetVectorData(m, size0, 0);
       
  1860 
       
  1861     ::glLoadMatrixx(m);
       
  1862     return WriteReply();
       
  1863 }
       
  1864 int OGLES11Wrapper::glLogicOp()
       
  1865 {
       
  1866     GLenum opcode;
       
  1867 
       
  1868     m_currentFunctionCall.GetParamValue(opcode, 0);
       
  1869 
       
  1870     ::glLogicOp(opcode);
       
  1871 
       
  1872     return WriteReply();
       
  1873 }
       
  1874 int OGLES11Wrapper::glMaterialf()
       
  1875 {
       
  1876     GLenum face;
       
  1877     GLenum pname;
       
  1878     GLfloat param;
       
  1879 
       
  1880     m_currentFunctionCall.GetParamValue(face, 0);
       
  1881     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1882     m_currentFunctionCall.GetParamValue(param, 2);
       
  1883 
       
  1884     ::glMaterialf(face, pname, param);
       
  1885 
       
  1886     return WriteReply();
       
  1887 }
       
  1888 int OGLES11Wrapper::glMaterialfv()
       
  1889 {
       
  1890     GLenum face;
       
  1891     GLenum pname;
       
  1892     GLfloat *params;
       
  1893 
       
  1894     m_currentFunctionCall.GetParamValue(face, 0);
       
  1895     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1896     TInt size2;
       
  1897     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1898 
       
  1899     ::glMaterialfv(face, pname, params);
       
  1900 
       
  1901     return WriteReply();
       
  1902 }
       
  1903 int OGLES11Wrapper::glMaterialx()
       
  1904 {
       
  1905     GLenum face;
       
  1906     GLenum pname;
       
  1907     GLfixed param;
       
  1908 
       
  1909     m_currentFunctionCall.GetParamValue(face, 0);
       
  1910     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1911     m_currentFunctionCall.GetParamValue(param, 2);
       
  1912 
       
  1913     ::glMaterialx(face, pname, param);
       
  1914 
       
  1915     return WriteReply();
       
  1916 }
       
  1917 int OGLES11Wrapper::glMaterialxv()
       
  1918 {
       
  1919     GLenum face;
       
  1920     GLenum pname;
       
  1921     GLfixed *params;
       
  1922 
       
  1923     m_currentFunctionCall.GetParamValue(face, 0);
       
  1924     m_currentFunctionCall.GetParamValue(pname, 1);
       
  1925     TInt size2;
       
  1926     m_currentFunctionCall.GetVectorData(params, size2, 2);
       
  1927 
       
  1928     ::glMaterialxv(face, pname, params);
       
  1929 
       
  1930     return WriteReply();
       
  1931 }
       
  1932 int OGLES11Wrapper::glMatrixMode()
       
  1933 {
       
  1934     GLenum mode;
       
  1935 
       
  1936     m_currentFunctionCall.GetParamValue(mode, 0);
       
  1937 
       
  1938     ::glMatrixMode(mode);
       
  1939 
       
  1940     return WriteReply();
       
  1941 }
       
  1942 int OGLES11Wrapper::glMultMatrixf()
       
  1943 {
       
  1944     GLfloat *m;
       
  1945 
       
  1946     TInt size0;
       
  1947     m_currentFunctionCall.GetVectorData(m, size0, 0);
       
  1948 
       
  1949     ::glMultMatrixf(m);
       
  1950 
       
  1951     return WriteReply();
       
  1952 }
       
  1953 int OGLES11Wrapper::glMultMatrixx()
       
  1954 {
       
  1955     GLfixed *m;
       
  1956 
       
  1957     TInt size0;
       
  1958     m_currentFunctionCall.GetVectorData(m, size0, 0);
       
  1959 
       
  1960     ::glMultMatrixx(m);
       
  1961 
       
  1962     return WriteReply();
       
  1963 }
       
  1964 int OGLES11Wrapper::glMultiTexCoord4f()
       
  1965 {
       
  1966     GLenum target;
       
  1967     GLfloat s;
       
  1968     GLfloat t;
       
  1969     GLfloat r;
       
  1970     GLfloat q;
       
  1971 
       
  1972     m_currentFunctionCall.GetParamValue(target, 0);
       
  1973     m_currentFunctionCall.GetParamValue(s, 1);
       
  1974     m_currentFunctionCall.GetParamValue(t, 2);
       
  1975     m_currentFunctionCall.GetParamValue(r, 3);
       
  1976     m_currentFunctionCall.GetParamValue(q, 4);
       
  1977 
       
  1978     ::glMultiTexCoord4f(target, s, t, r, q);
       
  1979 
       
  1980     return WriteReply();
       
  1981 }
       
  1982 int OGLES11Wrapper::glMultiTexCoord4x()
       
  1983 {
       
  1984     GLenum target;
       
  1985     GLfixed s;
       
  1986     GLfixed t;
       
  1987     GLfixed r;
       
  1988     GLfixed q;
       
  1989 
       
  1990     m_currentFunctionCall.GetParamValue(target, 0);
       
  1991     m_currentFunctionCall.GetParamValue(s, 1);
       
  1992     m_currentFunctionCall.GetParamValue(t, 2);
       
  1993     m_currentFunctionCall.GetParamValue(r, 3);
       
  1994     m_currentFunctionCall.GetParamValue(q, 4);
       
  1995 
       
  1996     ::glMultiTexCoord4x(target, s, t, r, q);
       
  1997 
       
  1998     return WriteReply();
       
  1999 }
       
  2000 int OGLES11Wrapper::glNormal3f()
       
  2001 {
       
  2002     GLfloat nx;
       
  2003     GLfloat ny;
       
  2004     GLfloat nz;
       
  2005 
       
  2006     m_currentFunctionCall.GetParamValue(nx, 0);
       
  2007     m_currentFunctionCall.GetParamValue(ny, 1);
       
  2008     m_currentFunctionCall.GetParamValue(nz, 2);
       
  2009 
       
  2010     ::glNormal3f(nx, ny, nz);
       
  2011 
       
  2012     return WriteReply();
       
  2013 }
       
  2014 int OGLES11Wrapper::glNormal3x()
       
  2015 {
       
  2016     GLfixed nx;
       
  2017     GLfixed ny;
       
  2018     GLfixed nz;
       
  2019 
       
  2020     m_currentFunctionCall.GetParamValue(nx, 0);
       
  2021     m_currentFunctionCall.GetParamValue(ny, 1);
       
  2022     m_currentFunctionCall.GetParamValue(nz, 2);
       
  2023 
       
  2024     ::glNormal3x(nx, ny, nz);
       
  2025 
       
  2026     return WriteReply();
       
  2027 }
       
  2028 
       
  2029 int OGLES11Wrapper::glOrthof()
       
  2030 {
       
  2031     GLfloat left;
       
  2032     GLfloat right;
       
  2033     GLfloat bottom;
       
  2034     GLfloat top;
       
  2035     GLfloat zNear;
       
  2036     GLfloat zFar;
       
  2037 
       
  2038     m_currentFunctionCall.GetParamValue(left, 0);
       
  2039     m_currentFunctionCall.GetParamValue(right, 1);
       
  2040     m_currentFunctionCall.GetParamValue(bottom, 2);
       
  2041     m_currentFunctionCall.GetParamValue(top, 3);
       
  2042     m_currentFunctionCall.GetParamValue(zNear, 4);
       
  2043     m_currentFunctionCall.GetParamValue(zFar, 5);
       
  2044 
       
  2045     ::glOrthof(left, right, bottom, top, zNear, zFar);
       
  2046 
       
  2047     return WriteReply();
       
  2048 }
       
  2049 int OGLES11Wrapper::glOrthox()
       
  2050 {
       
  2051     GLfixed left;
       
  2052     GLfixed right;
       
  2053     GLfixed bottom;
       
  2054     GLfixed top;
       
  2055     GLfixed zNear;
       
  2056     GLfixed zFar;
       
  2057 
       
  2058     m_currentFunctionCall.GetParamValue(left, 0);
       
  2059     m_currentFunctionCall.GetParamValue(right, 1);
       
  2060     m_currentFunctionCall.GetParamValue(bottom, 2);
       
  2061     m_currentFunctionCall.GetParamValue(top, 3);
       
  2062     m_currentFunctionCall.GetParamValue(zNear, 4);
       
  2063     m_currentFunctionCall.GetParamValue(zFar, 5);
       
  2064 
       
  2065     ::glOrthox(left, right, bottom, top, zNear, zFar);
       
  2066 
       
  2067     return WriteReply();
       
  2068 }
       
  2069 int OGLES11Wrapper::glPixelStorei()
       
  2070 {
       
  2071     GLenum pname;
       
  2072     GLint param;
       
  2073 
       
  2074     m_currentFunctionCall.GetParamValue(pname, 0);
       
  2075     m_currentFunctionCall.GetParamValue(param, 1);
       
  2076 
       
  2077     ::glPixelStorei(pname, param);
       
  2078 
       
  2079     return WriteReply();
       
  2080 }
       
  2081 int OGLES11Wrapper::glPointParameterf()
       
  2082 {
       
  2083     GLenum pname;
       
  2084     GLfloat param;
       
  2085 
       
  2086     m_currentFunctionCall.GetParamValue(pname, 0);
       
  2087     m_currentFunctionCall.GetParamValue(param, 1);
       
  2088 
       
  2089     ::glPointParameterf(pname, param);
       
  2090 
       
  2091     return WriteReply();
       
  2092 }
       
  2093 int OGLES11Wrapper::glPointParameterfv()
       
  2094 {
       
  2095     GLenum pname;
       
  2096     GLfloat *params;
       
  2097 
       
  2098     m_currentFunctionCall.GetParamValue(pname, 0);
       
  2099     TInt size1;
       
  2100     m_currentFunctionCall.GetVectorData(params, size1, 1);
       
  2101 
       
  2102     ::glPointParameterfv(pname, params);
       
  2103 
       
  2104     return WriteReply();
       
  2105 }
       
  2106 int OGLES11Wrapper::glPointParameterx()
       
  2107 {
       
  2108     GLenum pname;
       
  2109     GLfixed param;
       
  2110 
       
  2111     m_currentFunctionCall.GetParamValue(pname, 0);
       
  2112     m_currentFunctionCall.GetParamValue(param, 1);
       
  2113 
       
  2114     ::glPointParameterx(pname, param);
       
  2115 
       
  2116     return WriteReply();
       
  2117 }
       
  2118 int OGLES11Wrapper::glPointParameterxv()
       
  2119 {
       
  2120     GLenum pname;
       
  2121     GLfixed *params;
       
  2122 
       
  2123     m_currentFunctionCall.GetParamValue(pname, 0);
       
  2124     TInt size1;
       
  2125     m_currentFunctionCall.GetVectorData(params, size1, 1);
       
  2126 
       
  2127     ::glPointParameterxv(pname, params);
       
  2128 
       
  2129     return WriteReply();
       
  2130 }
       
  2131 int OGLES11Wrapper::glPointSize()
       
  2132 {
       
  2133     GLfloat size;
       
  2134 
       
  2135     m_currentFunctionCall.GetParamValue(size, 0);
       
  2136 
       
  2137     ::glPointSize(size);
       
  2138 
       
  2139     return WriteReply();
       
  2140 }
       
  2141 int OGLES11Wrapper::glPointSizex()
       
  2142 {
       
  2143     GLfixed size;
       
  2144 
       
  2145     m_currentFunctionCall.GetParamValue(size, 0);
       
  2146 
       
  2147     ::glPointSizex(size);
       
  2148 
       
  2149     return WriteReply();
       
  2150 }
       
  2151 int OGLES11Wrapper::glPolygonOffset()
       
  2152 {
       
  2153     GLfloat factor;
       
  2154     GLfloat units;
       
  2155 
       
  2156     m_currentFunctionCall.GetParamValue(factor, 0);
       
  2157     m_currentFunctionCall.GetParamValue(units, 1);
       
  2158 
       
  2159     ::glPolygonOffset(factor, units);
       
  2160 
       
  2161     return WriteReply();
       
  2162 }
       
  2163 int OGLES11Wrapper::glPolygonOffsetx()
       
  2164 {
       
  2165     GLfixed factor;
       
  2166     GLfixed units;
       
  2167 
       
  2168     m_currentFunctionCall.GetParamValue(factor, 0);
       
  2169     m_currentFunctionCall.GetParamValue(units, 1);
       
  2170 
       
  2171     ::glPolygonOffsetx(factor, units);
       
  2172 
       
  2173     return WriteReply();
       
  2174 }
       
  2175 int OGLES11Wrapper::glPopMatrix()
       
  2176 {
       
  2177     ::glPopMatrix();
       
  2178     return WriteReply();
       
  2179 }
       
  2180 int OGLES11Wrapper::glPushMatrix()
       
  2181 {
       
  2182     ::glPushMatrix();
       
  2183     return WriteReply();
       
  2184 }
       
  2185 int OGLES11Wrapper::glReadPixels()
       
  2186 {
       
  2187     GLint x;
       
  2188     GLint y;
       
  2189     GLsizei width;
       
  2190     GLsizei height;
       
  2191     GLenum format;
       
  2192     GLenum type;
       
  2193     GLvoid *pixels;
       
  2194 
       
  2195     m_currentFunctionCall.GetParamValue(x, 0);
       
  2196     m_currentFunctionCall.GetParamValue(y, 1);
       
  2197     m_currentFunctionCall.GetParamValue(width, 2);
       
  2198     m_currentFunctionCall.GetParamValue(height, 3);
       
  2199     m_currentFunctionCall.GetParamValue(format, 4);
       
  2200     m_currentFunctionCall.GetParamValue(type, 5);
       
  2201     TInt size6;
       
  2202     m_currentFunctionCall.GetVectorData(pixels, size6, 6);
       
  2203 
       
  2204     pixels = (GLvoid*)iStack->AllocFromStack( size6*m_currentFunctionCall.GetTypeSize( OpenGlES11RFC::EGLvoid ),
       
  2205         m_currentFunctionCall.GetTypeAlignment( OpenGlES11RFC::EGLvoid ) );
       
  2206 
       
  2207     ::glReadPixels(x, y, width, height, format, type, pixels);
       
  2208 
       
  2209     m_currentFunctionCall.SetVectorData( pixels, size6, 6 ); // EOut    
       
  2210 
       
  2211     int ret = WriteReply();
       
  2212     iStack->ClearStack();
       
  2213     pixels = NULL;
       
  2214     return ret;
       
  2215 }
       
  2216 int OGLES11Wrapper::glRotatef()
       
  2217 {
       
  2218     GLfloat angle, x, y, z;
       
  2219     m_currentFunctionCall.GetParamValue(angle, 0);
       
  2220     m_currentFunctionCall.GetParamValue(x, 1);
       
  2221     m_currentFunctionCall.GetParamValue(y, 2);
       
  2222     m_currentFunctionCall.GetParamValue(z, 3);
       
  2223     ::glRotatef(angle, x, y, z);
       
  2224     return WriteReply();
       
  2225 }
       
  2226 int OGLES11Wrapper::glRotatex()
       
  2227 {
       
  2228     GLfixed angle, x, y, z;
       
  2229     m_currentFunctionCall.GetParamValue(angle, 0);
       
  2230     m_currentFunctionCall.GetParamValue(x, 1);
       
  2231     m_currentFunctionCall.GetParamValue(y, 2);
       
  2232     m_currentFunctionCall.GetParamValue(z, 3);
       
  2233     ::glRotatex(angle, x, y, z);
       
  2234     return WriteReply();
       
  2235 }
       
  2236 int OGLES11Wrapper::glSampleCoverage()
       
  2237 {
       
  2238     GLclampf value;
       
  2239     GLboolean invert;
       
  2240     m_currentFunctionCall.GetParamValue(value, 0);
       
  2241     m_currentFunctionCall.GetParamValue(invert, 1);
       
  2242     ::glSampleCoverage(value, invert);
       
  2243     return WriteReply();
       
  2244 }
       
  2245 int OGLES11Wrapper::glSampleCoveragex()
       
  2246 {
       
  2247     GLclampx value;
       
  2248     GLboolean invert;
       
  2249     m_currentFunctionCall.GetParamValue(value, 0);
       
  2250     m_currentFunctionCall.GetParamValue(invert, 1);
       
  2251     ::glSampleCoveragex(value, invert);
       
  2252     return WriteReply();
       
  2253 }
       
  2254 int OGLES11Wrapper::glScalef()
       
  2255 {
       
  2256     GLfloat x, y, z;
       
  2257     m_currentFunctionCall.GetParamValue(x, 0);
       
  2258     m_currentFunctionCall.GetParamValue(y, 1);
       
  2259     m_currentFunctionCall.GetParamValue(z, 2);
       
  2260     ::glScalef(x, y, z);
       
  2261     return WriteReply();
       
  2262 }
       
  2263 int OGLES11Wrapper::glScalex()
       
  2264 {
       
  2265     GLfixed x, y, z;
       
  2266     m_currentFunctionCall.GetParamValue(x, 0);
       
  2267     m_currentFunctionCall.GetParamValue(y, 1);
       
  2268     m_currentFunctionCall.GetParamValue(z, 2);
       
  2269     ::glScalex(x, y, z);
       
  2270     return WriteReply();
       
  2271 }
       
  2272 int OGLES11Wrapper::glScissor()
       
  2273 {
       
  2274     GLint x, y;
       
  2275     GLsizei width, height;
       
  2276     m_currentFunctionCall.GetParamValue(x, 0);
       
  2277     m_currentFunctionCall.GetParamValue(y, 1);
       
  2278     m_currentFunctionCall.GetParamValue(width, 2);
       
  2279     m_currentFunctionCall.GetParamValue(height, 3);
       
  2280     ::glScissor(x, y, width, height);
       
  2281     return WriteReply();
       
  2282 }
       
  2283 int OGLES11Wrapper::glShadeModel()
       
  2284 {
       
  2285     GLenum mode;
       
  2286     m_currentFunctionCall.GetParamValue(mode, 0);
       
  2287     ::glShadeModel(mode);
       
  2288     return WriteReply();
       
  2289 }
       
  2290 int OGLES11Wrapper::glStencilFunc()
       
  2291 {
       
  2292     GLenum func;
       
  2293     GLint ref;
       
  2294     GLuint mask;
       
  2295     m_currentFunctionCall.GetParamValue(func, 0);
       
  2296     m_currentFunctionCall.GetParamValue(ref, 1);
       
  2297     m_currentFunctionCall.GetParamValue(mask, 2);
       
  2298     ::glStencilFunc(func, ref, mask);
       
  2299     return WriteReply();
       
  2300 }
       
  2301 int OGLES11Wrapper::glStencilMask()
       
  2302 {
       
  2303     GLuint mask;
       
  2304     m_currentFunctionCall.GetParamValue(mask, 0);
       
  2305     ::glStencilMask(mask);
       
  2306     return WriteReply();
       
  2307 }
       
  2308 int OGLES11Wrapper::glStencilOp()
       
  2309 {
       
  2310     GLenum fail, zfail, zpass;
       
  2311     m_currentFunctionCall.GetParamValue(fail, 0);
       
  2312     m_currentFunctionCall.GetParamValue(zfail, 1);
       
  2313     m_currentFunctionCall.GetParamValue(zpass, 2);
       
  2314     ::glStencilOp (fail, zfail, zpass);
       
  2315     return WriteReply();
       
  2316 }
       
  2317 int OGLES11Wrapper::glTexEnvf()
       
  2318 {
       
  2319     GLenum target, pname;
       
  2320     GLfloat param;
       
  2321     m_currentFunctionCall.GetParamValue(target, 0);
       
  2322     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2323     m_currentFunctionCall.GetParamValue(param, 2);
       
  2324     ::glTexEnvf(target, pname, param);
       
  2325     return WriteReply();
       
  2326 }
       
  2327 int OGLES11Wrapper::glTexEnvfv()
       
  2328 {
       
  2329     GLenum target, pname;
       
  2330     GLfloat *params;
       
  2331     m_currentFunctionCall.GetParamValue(target, 0);
       
  2332     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2333 
       
  2334     TInt size;
       
  2335     m_currentFunctionCall.GetVectorData(params, size, 2);
       
  2336 
       
  2337     ::glTexEnvfv(target, pname, params);
       
  2338     return WriteReply();
       
  2339 }
       
  2340 int OGLES11Wrapper::glTexEnvi()
       
  2341 {
       
  2342     GLenum target, pname;
       
  2343     GLint param;
       
  2344     m_currentFunctionCall.GetParamValue(target, 0);
       
  2345     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2346     m_currentFunctionCall.GetParamValue(param, 2);
       
  2347     ::glTexEnvi(target, pname, param);
       
  2348     return WriteReply();
       
  2349 }
       
  2350 int OGLES11Wrapper::glTexEnviv()
       
  2351 {
       
  2352     GLenum target, pname;
       
  2353     GLint *params;
       
  2354     m_currentFunctionCall.GetParamValue(target, 0);
       
  2355     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2356 
       
  2357     TInt size;
       
  2358     m_currentFunctionCall.GetVectorData(params, size, 2);
       
  2359 
       
  2360     ::glTexEnviv(target, pname, params);
       
  2361     return WriteReply();
       
  2362 }
       
  2363 int OGLES11Wrapper::glTexEnvx()
       
  2364 {
       
  2365     GLenum target, pname;
       
  2366     GLfixed param;
       
  2367     m_currentFunctionCall.GetParamValue(target, 0);
       
  2368     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2369     m_currentFunctionCall.GetParamValue(param, 2);
       
  2370     ::glTexEnvx(target, pname, param);
       
  2371     return WriteReply();
       
  2372 }
       
  2373 int OGLES11Wrapper::glTexEnvxv()
       
  2374 {
       
  2375     GLenum target, pname;
       
  2376     GLfixed *params;
       
  2377     m_currentFunctionCall.GetParamValue(target, 0);
       
  2378     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2379 
       
  2380     TInt size;
       
  2381     m_currentFunctionCall.GetVectorData(params, size, 2);
       
  2382 
       
  2383     ::glTexEnvxv(target, pname, params);
       
  2384     return WriteReply();
       
  2385 }
       
  2386 int OGLES11Wrapper::glTexImage2D()
       
  2387 {
       
  2388     GLenum target;
       
  2389     GLint level;
       
  2390     GLint internalformat;
       
  2391     GLsizei width;
       
  2392     GLsizei height;
       
  2393     GLint border;
       
  2394     GLenum format;
       
  2395     GLenum type;
       
  2396     GLvoid *pixels;
       
  2397 
       
  2398     m_currentFunctionCall.GetParamValue(target, 0);
       
  2399     m_currentFunctionCall.GetParamValue(level, 1);
       
  2400     m_currentFunctionCall.GetParamValue(internalformat, 2);
       
  2401     m_currentFunctionCall.GetParamValue(width, 3);
       
  2402     m_currentFunctionCall.GetParamValue(height, 4);
       
  2403     m_currentFunctionCall.GetParamValue(border, 5);
       
  2404     m_currentFunctionCall.GetParamValue(format, 6);
       
  2405     m_currentFunctionCall.GetParamValue(type, 7);
       
  2406 
       
  2407     TInt size;
       
  2408     m_currentFunctionCall.GetVectorData(pixels, size, 8);
       
  2409 
       
  2410     ::glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
       
  2411     return WriteReply();
       
  2412 }
       
  2413 int OGLES11Wrapper::glTexParameterf()
       
  2414 {
       
  2415     GLenum target, pname;
       
  2416     GLfloat param;
       
  2417     m_currentFunctionCall.GetParamValue(target, 0);
       
  2418     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2419     m_currentFunctionCall.GetParamValue(param, 2);
       
  2420     ::glTexParameterf(target, pname, param);
       
  2421     return WriteReply();
       
  2422 }
       
  2423 int OGLES11Wrapper::glTexParameterfv()
       
  2424 {
       
  2425     GLenum target, pname;
       
  2426     GLfloat *params;
       
  2427     m_currentFunctionCall.GetParamValue(target, 0);
       
  2428     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2429 
       
  2430     TInt size;
       
  2431     m_currentFunctionCall.GetVectorData(params, size, 2);
       
  2432 
       
  2433     ::glTexParameterfv(target, pname, params);
       
  2434     return WriteReply();
       
  2435 }
       
  2436 int OGLES11Wrapper::glTexParameteri()
       
  2437 {
       
  2438     GLenum target, pname;
       
  2439     GLint param;
       
  2440     m_currentFunctionCall.GetParamValue(target, 0);
       
  2441     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2442     m_currentFunctionCall.GetParamValue(param, 2);
       
  2443     ::glTexParameteri(target, pname, param);
       
  2444     return WriteReply();
       
  2445 }
       
  2446 int OGLES11Wrapper::glTexParameteriv()
       
  2447 {
       
  2448     GLenum target, pname;
       
  2449     GLint *params;
       
  2450     m_currentFunctionCall.GetParamValue(target, 0);
       
  2451     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2452 
       
  2453     TInt size;
       
  2454     m_currentFunctionCall.GetVectorData(params, size, 2);
       
  2455 
       
  2456     ::glTexParameteriv(target, pname, params);
       
  2457     return WriteReply();
       
  2458 }
       
  2459 int OGLES11Wrapper::glTexParameterx()
       
  2460 {
       
  2461     GLenum target, pname;
       
  2462     GLfixed param;
       
  2463     m_currentFunctionCall.GetParamValue(target, 0);
       
  2464     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2465     m_currentFunctionCall.GetParamValue(param, 2);
       
  2466     ::glTexParameterx(target, pname, param);
       
  2467     return WriteReply();
       
  2468 }
       
  2469 int OGLES11Wrapper::glTexParameterxv()
       
  2470 {
       
  2471     GLenum target, pname;
       
  2472     GLfixed *params;
       
  2473     m_currentFunctionCall.GetParamValue(target, 0);
       
  2474     m_currentFunctionCall.GetParamValue(pname, 1);
       
  2475 
       
  2476     TInt size;
       
  2477     m_currentFunctionCall.GetVectorData(params, size, 2);
       
  2478 
       
  2479     ::glTexParameterxv(target, pname, params);
       
  2480     return WriteReply();
       
  2481 }
       
  2482 int OGLES11Wrapper::glTexSubImage2D()
       
  2483 {
       
  2484     GLenum target;
       
  2485     GLint level;
       
  2486     GLint xoffset;
       
  2487     GLint yoffset;
       
  2488     GLsizei width;
       
  2489     GLsizei height;
       
  2490     GLenum format;
       
  2491     GLenum type;
       
  2492     GLvoid *pixels;
       
  2493 
       
  2494     m_currentFunctionCall.GetParamValue(target, 0);
       
  2495     m_currentFunctionCall.GetParamValue(level, 1);
       
  2496     m_currentFunctionCall.GetParamValue(xoffset, 2);
       
  2497     m_currentFunctionCall.GetParamValue(yoffset, 3);
       
  2498     m_currentFunctionCall.GetParamValue(width, 4);
       
  2499     m_currentFunctionCall.GetParamValue(height, 5);
       
  2500     m_currentFunctionCall.GetParamValue(format, 6);
       
  2501     m_currentFunctionCall.GetParamValue(type, 7);
       
  2502     TInt size8;
       
  2503     m_currentFunctionCall.GetVectorData(pixels, size8, 8);
       
  2504 
       
  2505     ::glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
       
  2506     return WriteReply();
       
  2507 }
       
  2508 int OGLES11Wrapper::glTranslatef()
       
  2509 {
       
  2510     GLfloat x, y, z;
       
  2511     m_currentFunctionCall.GetParamValue(x, 0);
       
  2512     m_currentFunctionCall.GetParamValue(y, 1);
       
  2513     m_currentFunctionCall.GetParamValue(z, 2);
       
  2514     ::glTranslatef(x, y, z);
       
  2515     return WriteReply();
       
  2516 }
       
  2517 int OGLES11Wrapper::glTranslatex()
       
  2518 {
       
  2519     GLfixed x, y, z;
       
  2520     m_currentFunctionCall.GetParamValue(x, 0);
       
  2521     m_currentFunctionCall.GetParamValue(y, 1);
       
  2522     m_currentFunctionCall.GetParamValue(z, 2);
       
  2523     ::glTranslatex(x, y, z);
       
  2524     return WriteReply();
       
  2525 }
       
  2526 int OGLES11Wrapper::glViewport()
       
  2527 {
       
  2528     GLint x, y;
       
  2529     GLsizei width, height;
       
  2530     m_currentFunctionCall.GetParamValue(x, 0);
       
  2531     m_currentFunctionCall.GetParamValue(y, 1);
       
  2532     m_currentFunctionCall.GetParamValue(width, 2);
       
  2533     m_currentFunctionCall.GetParamValue(height, 3);
       
  2534     ::glViewport(x, y, width, height);
       
  2535     return WriteReply();
       
  2536 }
       
  2537 int OGLES11Wrapper::glCurrentPaletteMatrixOES()
       
  2538 {
       
  2539     return 0;
       
  2540 }
       
  2541 int OGLES11Wrapper::glDrawTexfOES()
       
  2542 {
       
  2543     return 0;
       
  2544 }
       
  2545 int OGLES11Wrapper::glDrawTexfvOES()
       
  2546 {
       
  2547     return 0;
       
  2548 }
       
  2549 int OGLES11Wrapper::glDrawTexiOES()
       
  2550 {
       
  2551     return 0;
       
  2552 }
       
  2553 int OGLES11Wrapper::glDrawTexivOES()
       
  2554 {
       
  2555     return 0;
       
  2556 }
       
  2557 int OGLES11Wrapper::glDrawTexsOES()
       
  2558 {
       
  2559     return 0;
       
  2560 }
       
  2561 int OGLES11Wrapper::glDrawTexsvOES()
       
  2562 {
       
  2563     return 0;
       
  2564 }
       
  2565 int OGLES11Wrapper::glDrawTexxOES()
       
  2566 {
       
  2567     return 0;
       
  2568 }
       
  2569 int OGLES11Wrapper::glDrawTexxvOES()
       
  2570 {
       
  2571     return 0;
       
  2572 }
       
  2573 int OGLES11Wrapper::glLoadPaletteFromModelViewMatrixOES()
       
  2574 {
       
  2575     return 0;
       
  2576 }
       
  2577 int OGLES11Wrapper::glQueryMatrixxOES()
       
  2578 {
       
  2579     return 0;
       
  2580 }