hostsupport/hostopengles11/src/glesapi.cpp
author Matt Plumtree <matt.plumtree@nokia.com>
Mon, 15 Nov 2010 09:56:25 +0000
branchbug235_bringup_0
changeset 77 b0395290e61f
parent 68 8d4efe9fa1cf
permissions -rw-r--r--
Ensure OpenGL ES 2.0 C functions use C signatures in C++ builds (fixes VS builds)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
53
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     1
/* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     2
 *
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     3
 * Permission is hereby granted, free of charge, to any person obtaining a
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     4
 * copy of this software and /or associated documentation files
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     5
 * (the "Materials "), to deal in the Materials without restriction,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     6
 * including without limitation the rights to use, copy, modify, merge,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     7
 * publish, distribute, sublicense, and/or sell copies of the Materials,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     8
 * and to permit persons to whom the Materials are furnished to do so,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
     9
 * subject to the following conditions:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    10
 *
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    11
 * The above copyright notice and this permission notice shall be included
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    12
 * in all copies or substantial portions of the Materials.
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    13
 *
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    14
 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    15
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    16
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    17
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    18
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    19
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    20
 * THE USE OR OTHER DEALINGS IN THE MATERIALS.
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    21
 *
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    22
 * Initial Contributors:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    23
 * Nokia Corporation - initial contribution.
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    24
 *
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    25
 * Contributors:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    26
 *
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    27
 * Description:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    28
 *
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    29
 */
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    30
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    31
#include <GLES/gl.h>
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    32
#include <GLES/glplatform.h>
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    33
#include <iostream>
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    34
#include "GLESDesktopGL.h"
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    35
#include "glesInternal.h"
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    36
#include "EGLInterface.h"
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    37
#include "GLESContext.h"
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    38
#include "GLESArray.h"
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    39
#include "GLESTexture.h"
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    40
#include "glesGet.h"
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    41
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    42
// exit()
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    43
#include <stdlib.h>
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    44
// memcpy
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    45
#include <string.h>
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    46
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    47
#ifdef __cplusplus
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    48
extern "C" {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    49
#endif
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    50
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    51
/* Available only in Common profile */
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    52
GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    53
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    54
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    55
    ctx->DGL().glAlphaFunc (func, ref);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    56
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    57
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    58
GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    59
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    60
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    61
    ctx->DGL().glClearColor (red, green, blue, alpha);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    62
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    63
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    64
GL_API void GL_APIENTRY glClearDepthf (GLclampf depth)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    65
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    66
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    67
    ctx->DGL().glClearDepth (depth);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    68
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    69
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    70
GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    71
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    72
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    73
    GLES_ERROR_IF(plane < GL_CLIP_PLANE0 || plane >= GL_CLIP_PLANE0 + ctx->MaxClipPlanes(), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    74
    GLdouble dequation[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    75
    for(int i = 0; i < 4; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    76
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    77
        dequation[i] = static_cast<GLdouble>(equation[i]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    78
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    79
    ctx->DGL().glClipPlane (plane, dequation);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    80
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    81
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    82
GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    83
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    84
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    85
    ctx->DGL().glColor4f (red, green, blue, alpha);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    86
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    87
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    88
GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    89
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    90
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    91
    ctx->DGL().glDepthRange(zNear, zFar);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    92
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    93
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    94
bool isValidSingleValuedFogParamEnum(GLenum pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    95
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    96
    switch(pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    97
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    98
    case GL_FOG_MODE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
    99
    case GL_FOG_DENSITY:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   100
    case GL_FOG_START:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   101
    case GL_FOG_END:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   102
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   103
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   104
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   105
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   106
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   107
bool isValidFogParamEnum(GLenum pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   108
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   109
    return isValidSingleValuedFogParamEnum(pname) || pname == GL_FOG_COLOR;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   110
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   111
GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   112
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   113
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   114
    GLES_ERROR_IF(!isValidFogParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   115
    ctx->DGL().glFogf (pname, param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   116
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   117
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   118
GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   119
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   120
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   121
    GLES_ERROR_IF(!isValidFogParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   122
    ctx->DGL().glFogfv (pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   123
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   124
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   125
GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   126
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   127
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   128
    ctx->DGL().glFrustum (left, right, bottom, top, zNear, zFar);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   129
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   130
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   131
GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4])
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   132
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   133
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   134
    GLdouble deqn[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   135
    ctx->DGL().glGetClipPlane (pname, deqn);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   136
    for(int i = 0; i < 4; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   137
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   138
        eqn[i] = static_cast<GLfloat>(deqn[i]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   139
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   140
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   141
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   142
GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   143
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   144
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   145
    if(!glesGetParameter(*ctx, ctx->DGL(), pname, GLES_TYPE_FLOAT, params))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   146
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   147
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   148
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   149
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   150
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   151
GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   152
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   153
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   154
    ctx->DGL().glGetLightfv (light, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   155
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   156
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   157
GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   158
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   159
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   160
    ctx->DGL().glGetMaterialfv (face, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   161
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   162
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   163
bool isValidTexEnvTargetEnum(GLenum target)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   164
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   165
    switch(target)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   166
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   167
    case GL_POINT_SPRITE_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   168
    case GL_TEXTURE_ENV:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   169
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   170
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   171
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   172
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   173
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   174
bool isValidSingleValuedTexEnvParamEnum(GLenum pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   175
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   176
    switch(pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   177
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   178
    case GL_TEXTURE_ENV_MODE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   179
    case GL_COORD_REPLACE_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   180
    case GL_COMBINE_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   181
    case GL_COMBINE_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   182
    case GL_SRC0_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   183
    case GL_SRC1_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   184
    case GL_SRC2_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   185
    case GL_SRC0_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   186
    case GL_SRC1_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   187
    case GL_SRC2_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   188
    case GL_OPERAND0_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   189
    case GL_OPERAND1_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   190
    case GL_OPERAND2_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   191
    case GL_OPERAND0_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   192
    case GL_OPERAND1_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   193
    case GL_OPERAND2_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   194
    case GL_RGB_SCALE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   195
    case GL_ALPHA_SCALE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   196
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   197
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   198
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   199
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   200
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   201
bool isValidTexEnvParamEnum(GLenum pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   202
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   203
    return isValidSingleValuedTexEnvParamEnum(pname) || pname == GL_TEXTURE_ENV_COLOR;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   204
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   205
GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   206
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   207
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   208
    GLES_ERROR_IF(!isValidTexEnvTargetEnum(env), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   209
    GLES_ERROR_IF(!isValidTexEnvParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   210
    env = env == GL_POINT_SPRITE_OES ? GL_POINT_SPRITE : env;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   211
    pname = pname == GL_COORD_REPLACE_OES ? GL_COORD_REPLACE : pname;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   212
    ctx->DGL().glGetTexEnvfv (env, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   213
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   214
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   215
bool isValidTexParamEnum(GLenum pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   216
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   217
    switch(pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   218
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   219
    case GL_TEXTURE_MIN_FILTER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   220
    case GL_TEXTURE_MAG_FILTER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   221
    case GL_TEXTURE_WRAP_S:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   222
    case GL_TEXTURE_WRAP_T:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   223
    case GL_GENERATE_MIPMAP:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   224
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   225
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   226
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   227
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   228
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   229
GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   230
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   231
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   232
    GLES_ERROR_IF(!isValidTexParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   233
    ctx->DGL().glGetTexParameterfv (target, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   234
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   235
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   236
bool isValidLightModelParamEnum(GLenum pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   237
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   238
    switch(pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   239
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   240
    case GL_LIGHT_MODEL_AMBIENT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   241
    case GL_LIGHT_MODEL_TWO_SIDE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   242
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   243
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   244
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   245
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   246
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   247
GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   248
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   249
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   250
    GLES_ERROR_IF(!isValidLightModelParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   251
    ctx->DGL().glLightModelf (pname, param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   252
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   253
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   254
GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   255
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   256
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   257
    GLES_ERROR_IF(!isValidLightModelParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   258
    ctx->DGL().glLightModelfv (pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   259
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   260
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   261
GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   262
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   263
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   264
    ctx->DGL().glLightf (light, pname, param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   265
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   266
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   267
GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   268
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   269
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   270
    ctx->DGL().glLightfv (light, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   271
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   272
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   273
GL_API void GL_APIENTRY glLineWidth (GLfloat width)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   274
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   275
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   276
    ctx->DGL().glLineWidth (width);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   277
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   278
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   279
GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   280
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   281
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   282
    ctx->DGL().glLoadMatrixf (m);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   283
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   284
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   285
GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   286
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   287
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   288
    ctx->DGL().glMaterialf (face, pname, param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   289
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   290
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   291
bool isValidSingleValuedMaterialParamEnum(GLenum pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   292
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   293
    return pname == GL_SHININESS;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   294
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   295
bool isValidMaterialParamEnum(GLenum pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   296
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   297
    if(isValidSingleValuedMaterialParamEnum(pname))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   298
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   299
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   300
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   301
    else
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   302
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   303
        switch(pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   304
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   305
        case GL_AMBIENT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   306
        case GL_DIFFUSE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   307
        case GL_AMBIENT_AND_DIFFUSE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   308
        case GL_SPECULAR:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   309
        case GL_EMISSION:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   310
        case GL_SHININESS:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   311
            return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   312
        default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   313
            return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   314
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   315
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   316
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   317
GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   318
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   319
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   320
    GLES_ERROR_IF(!isValidMaterialParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   321
    ctx->DGL().glMaterialfv (face, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   322
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   323
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   324
GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   325
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   326
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   327
    ctx->DGL().glMultMatrixf(m);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   328
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   329
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   330
bool isValidTextureTargetEnum(GLenum target, unsigned int maxTextureUnits)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   331
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   332
    return target >= GL_TEXTURE0 && target < GL_TEXTURE0 + maxTextureUnits;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   333
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   334
GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   335
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   336
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   337
    GLES_ERROR_IF(!isValidTextureTargetEnum(target, ctx->MaxTextureUnits()), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   338
    ctx->DGL().glMultiTexCoord4f(target, s, t, r, q);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   339
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   340
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   341
GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   342
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   343
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   344
    ctx->DGL().glNormal3f(nx, ny, nz);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   345
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   346
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   347
GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   348
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   349
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   350
    ctx->DGL().glOrtho(left, right, bottom, top, zNear, zFar);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   351
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   352
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   353
GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   354
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   355
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   356
    ctx->DGL().glPointParameterf (pname, param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   357
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   358
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   359
GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   360
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   361
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   362
    ctx->DGL().glPointParameterfv (pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   363
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   364
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   365
GL_API void GL_APIENTRY glPointSize (GLfloat size)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   366
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   367
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   368
    ctx->DGL().glPointSize (size);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   369
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   370
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   371
GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   372
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   373
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   374
    ctx->DGL().glPolygonOffset (factor, units);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   375
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   376
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   377
GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   378
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   379
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   380
    ctx->DGL().glRotatef (angle, x, y, z);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   381
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   382
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   383
GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   384
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   385
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   386
    ctx->DGL().glScalef (x, y, z);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   387
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   388
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   389
GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   390
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   391
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   392
    GLES_ERROR_IF(!isValidTexEnvTargetEnum(target), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   393
    GLES_ERROR_IF(!isValidTexEnvParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   394
    target = target == GL_POINT_SPRITE_OES ? GL_POINT_SPRITE : target;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   395
    pname = pname == GL_COORD_REPLACE_OES ? GL_COORD_REPLACE : pname;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   396
    ctx->DGL().glTexEnvf (target, pname, param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   397
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   398
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   399
GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   400
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   401
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   402
    GLES_ERROR_IF(!isValidTexEnvTargetEnum(target), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   403
    GLES_ERROR_IF(!isValidTexEnvParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   404
    target = target == GL_POINT_SPRITE_OES ? GL_POINT_SPRITE : target;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   405
    pname = pname == GL_COORD_REPLACE_OES ? GL_COORD_REPLACE : pname;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   406
    ctx->DGL().glTexEnvfv (target, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   407
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   408
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   409
GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   410
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   411
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   412
    GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   413
    GLES_ERROR_IF(!isValidTexParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   414
    pname = pname == GL_COORD_REPLACE_OES ? GL_COORD_REPLACE : pname;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   415
    ctx->DGL().glTexParameterf (target, pname, param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   416
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   417
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   418
GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   419
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   420
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   421
    GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   422
    GLES_ERROR_IF(!isValidTexParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   423
    target = target == GL_POINT_SPRITE_OES ? GL_POINT_SPRITE : target;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   424
    pname = pname == GL_COORD_REPLACE_OES ? GL_COORD_REPLACE : pname;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   425
    ctx->DGL().glTexParameterfv (target, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   426
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   427
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   428
GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   429
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   430
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   431
    ctx->DGL().glTranslatef (x, y, z);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   432
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   433
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   434
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   435
/* Available in both Common and Common-Lite profiles */
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   436
GL_API void GL_APIENTRY glActiveTexture (GLenum texture)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   437
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   438
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   439
    GLES_ERROR_IF(!isValidTextureTargetEnum(texture, ctx->MaxTextureUnits()), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   440
    ctx->DGL().glActiveTexture (texture);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   441
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   442
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   443
GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   444
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   445
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   446
    ctx->DGL().glAlphaFunc(func, X_TO_F(ref));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   447
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   448
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   449
bool isValidBufferTarget(GLenum target)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   450
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   451
    switch(target)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   452
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   453
    case GL_ARRAY_BUFFER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   454
    case GL_ELEMENT_ARRAY_BUFFER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   455
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   456
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   457
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   458
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   459
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   460
GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   461
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   462
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   463
    GLES_ERROR_IF(!isValidBufferTarget(target), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   464
    switch(target)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   465
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   466
    case GL_ARRAY_BUFFER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   467
        if(!ctx->BindArrayBuffer(buffer))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   468
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   469
            GLES_ERROR(GL_OUT_OF_MEMORY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   470
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   471
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   472
    case GL_ELEMENT_ARRAY_BUFFER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   473
        if(!ctx->BindElementArrayBuffer(buffer))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   474
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   475
            GLES_ERROR(GL_OUT_OF_MEMORY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   476
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   477
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   478
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   479
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   480
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   481
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   482
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   483
GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   484
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   485
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   486
    GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   487
    ctx->GetHostError();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   488
    ctx->DGL().glBindTexture (target, texture);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   489
    if(ctx->GetHostError() == GL_NO_ERROR)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   490
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   491
        ctx->BindTexture(texture);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   492
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   493
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   494
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   495
bool isValidSrcBlendFuncEnum(GLenum func)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   496
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   497
    switch(func)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   498
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   499
    case GL_ZERO:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   500
    case GL_ONE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   501
    case GL_DST_COLOR:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   502
    case GL_ONE_MINUS_DST_COLOR:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   503
    case GL_SRC_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   504
    case GL_ONE_MINUS_SRC_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   505
    case GL_DST_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   506
    case GL_ONE_MINUS_DST_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   507
    case GL_SRC_ALPHA_SATURATE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   508
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   509
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   510
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   511
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   512
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   513
bool isValidDstBlendFuncEnum(GLenum func)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   514
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   515
    switch(func)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   516
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   517
    case GL_ZERO:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   518
    case GL_ONE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   519
    case GL_SRC_COLOR:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   520
    case GL_ONE_MINUS_SRC_COLOR:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   521
    case GL_SRC_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   522
    case GL_ONE_MINUS_SRC_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   523
    case GL_DST_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   524
    case GL_ONE_MINUS_DST_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   525
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   526
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   527
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   528
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   529
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   530
GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   531
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   532
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   533
    GLES_ERROR_IF(!isValidSrcBlendFuncEnum(sfactor), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   534
    GLES_ERROR_IF(!isValidDstBlendFuncEnum(dfactor), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   535
    ctx->DGL().glBlendFunc (sfactor, dfactor);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   536
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   537
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   538
GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   539
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   540
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   541
    GLES_ERROR_IF(size < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   542
    GLES_ERROR_IF(usage != GL_STATIC_DRAW && usage != GL_DYNAMIC_DRAW, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   543
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   544
    GLESBuffer* buffer;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   545
    switch(target)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   546
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   547
    case GL_ARRAY_BUFFER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   548
        GLES_ERROR_IF(ctx->ArrayBufferBinding() == 0, GL_INVALID_OPERATION);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   549
        buffer = ctx->ArrayBuffer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   550
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   551
    case GL_ELEMENT_ARRAY_BUFFER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   552
        GLES_ERROR_IF(ctx->ElementArrayBufferBinding() == 0, GL_INVALID_OPERATION);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   553
        buffer = ctx->ElementArrayBuffer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   554
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   555
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   556
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   557
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   558
    GLES_ASSERT(buffer);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   559
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   560
    delete[] buffer->data;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   561
    buffer->data = GLES_NEW char[size];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   562
    if(buffer->data == NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   563
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   564
        GLES_ERROR(GL_OUT_OF_MEMORY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   565
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   566
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   567
    if(data != NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   568
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   569
        memcpy(buffer->data, data, size);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   570
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   571
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   572
    buffer->size = size;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   573
    buffer->usage = usage;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   574
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   575
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   576
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   577
GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   578
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   579
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   580
    GLES_ERROR_IF(offset < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   581
    GLES_ERROR_IF(size < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   582
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   583
    GLESBuffer* buffer;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   584
    switch(target)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   585
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   586
    case GL_ARRAY_BUFFER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   587
        GLES_ERROR_IF(ctx->ArrayBufferBinding() == 0, GL_INVALID_OPERATION);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   588
        buffer = ctx->ArrayBuffer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   589
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   590
    case GL_ELEMENT_ARRAY_BUFFER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   591
        GLES_ERROR_IF(ctx->ElementArrayBufferBinding() == 0, GL_INVALID_OPERATION);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   592
        buffer = ctx->ElementArrayBuffer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   593
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   594
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   595
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   596
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   597
    GLES_ASSERT(buffer);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   598
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   599
    GLES_ERROR_IF(size + offset > buffer->size, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   600
    memcpy(static_cast<char*>(buffer->data) + offset, data, size);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   601
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   602
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   603
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   604
GL_API void GL_APIENTRY glClear (GLbitfield mask)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   605
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   606
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   607
	GLES_LOCK_DRAW_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   608
	ctx->DGL().glClear (mask);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   609
	GLES_UNLOCK_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   610
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   611
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   612
GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   613
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   614
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   615
    ctx->DGL().glClearColor (X_TO_F(red), X_TO_F(green), X_TO_F(blue), X_TO_F(alpha));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   616
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   617
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   618
GL_API void GL_APIENTRY glClearDepthx (GLclampx depth)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   619
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   620
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   621
    ctx->DGL().glClearDepth (X_TO_D(depth));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   622
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   623
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   624
GL_API void GL_APIENTRY glClearStencil (GLint s)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   625
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   626
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   627
    ctx->DGL().glClearStencil (s);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   628
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   629
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   630
GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   631
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   632
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   633
    GLES_ERROR_IF(!isValidTextureTargetEnum(texture, ctx->MaxTextureUnits()), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   634
    ctx->GetHostError();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   635
    ctx->DGL().glClientActiveTexture (texture);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   636
    if(ctx->GetHostError() == GL_NO_ERROR)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   637
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   638
        ctx->SetClientActiveTexture(texture - GL_TEXTURE0);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   639
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   640
    GLES_LEAVE_NO_ERROR_CHECK();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   641
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   642
GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   643
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   644
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   645
    GLdouble dequation[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   646
    for(int i = 0; i < 4; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   647
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   648
        dequation[i] = X_TO_D(equation[i]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   649
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   650
    ctx->DGL().glClipPlane (plane, dequation);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   651
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   652
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   653
GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   654
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   655
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   656
    ctx->DGL().glColor4ub (red, green, blue, alpha);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   657
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   658
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   659
GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   660
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   661
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   662
    ctx->DGL().glColor4d(X_TO_D(red), X_TO_D(green), X_TO_D(blue), X_TO_D(alpha));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   663
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   664
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   665
GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   666
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   667
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   668
    ctx->DGL().glColorMask (red, green, blue, alpha);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   669
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   670
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   671
GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   672
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   673
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   674
    GLES_ERROR_IF(size != 4, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   675
    GLES_ERROR_IF(type != GL_UNSIGNED_BYTE && type != GL_FIXED && type != GL_FLOAT, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   676
    GLES_ERROR_IF(stride < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   677
    ctx->SetColorArray(size, type, stride, pointer);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   678
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   679
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   680
GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   681
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   682
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   683
	GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   684
	GLES_ERROR_IF(level > 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   685
	GLES_ERROR_IF(!glesIsValidCompressedFormat(internalformat), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   686
	GLES_ERROR_IF(height < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   687
	GLES_ERROR_IF(width < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   688
	GLES_ERROR_IF(height > 0 && !glesIsPowerOfTwo(height), GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   689
	GLES_ERROR_IF(width > 0 && !glesIsPowerOfTwo(width), GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   690
	GLES_ERROR_IF(imageSize < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   691
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   692
	GLenum baseFormat = glesMapCompressedToBaseFormat(internalformat);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   693
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   694
	int numLevels = -level + 1;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   695
	for(int curLevel = 0; curLevel < numLevels; curLevel++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   696
	{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   697
		if(data != NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   698
		{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   699
			void* uncompressedData = glesUncompressImage(curLevel, internalformat, width, height, imageSize, data);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   700
			if(uncompressedData == NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   701
			{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   702
				GLES_ERROR(GL_OUT_OF_MEMORY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   703
			}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   704
			ctx->DGL().glTexImage2D(target, curLevel, baseFormat, width, height, border, baseFormat, GL_UNSIGNED_BYTE, uncompressedData);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   705
			delete uncompressedData;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   706
		}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   707
		else
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   708
		{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   709
			ctx->DGL().glTexImage2D(target, curLevel, baseFormat, width, height, border, baseFormat, GL_UNSIGNED_BYTE, NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   710
		}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   711
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   712
		if(ctx->GetHostError() == GL_NO_ERROR)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   713
		{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   714
			GLESTexture* texture = ctx->Texture(ctx->TextureBinding());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   715
			GLES_ASSERT(texture != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   716
			texture->SetLevel(level, internalformat, width, height);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   717
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   718
			if(texture->Level(level)->boundSurface != NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   719
			{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   720
				// Texture is respecified. Release the bound EGLSurface.
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   721
				glesReleaseTexImage(texture->Level(level)->boundSurface, texture->Name(), level);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   722
				texture->Level(level)->boundSurface = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   723
			}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   724
		}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   725
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   726
		width /= 2;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   727
		height /= 2;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   728
	}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   729
	
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   730
	GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   731
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   732
static bool isPalettedFormat(GLenum format)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   733
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   734
    switch(format)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   735
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   736
    case GL_PALETTE4_RGB8_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   737
    case GL_PALETTE4_RGBA8_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   738
    case GL_PALETTE4_R5_G6_B5_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   739
    case GL_PALETTE4_RGBA4_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   740
    case GL_PALETTE4_RGB5_A1_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   741
    case GL_PALETTE8_RGB8_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   742
    case GL_PALETTE8_RGBA8_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   743
    case GL_PALETTE8_R5_G6_B5_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   744
    case GL_PALETTE8_RGBA4_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   745
    case GL_PALETTE8_RGB5_A1_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   746
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   747
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   748
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   749
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   750
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   751
GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   752
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   753
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   754
    GLES_ERROR_IF(!isPalettedFormat(format), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   755
    // Not supported for compressed paletted textures.
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   756
    GLES_ERROR(GL_INVALID_OPERATION);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   757
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   758
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   759
bool isValidPixelFormatEnum(GLenum format)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   760
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   761
    switch(format)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   762
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   763
    case GL_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   764
    case GL_LUMINANCE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   765
    case GL_LUMINANCE_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   766
    case GL_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   767
    case GL_RGBA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   768
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   769
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   770
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   771
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   772
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   773
GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   774
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   775
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   776
	GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   777
	GLES_ERROR_IF(!isValidPixelFormatEnum(internalformat), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   778
	
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   779
	GLES_LOCK_READ_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   780
	ctx->DGL().glCopyTexImage2D (target, level, internalformat, x, y, width, height, border);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   781
	GLES_UNLOCK_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   782
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   783
	if(ctx->GetHostError() == GL_NO_ERROR)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   784
	{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   785
		GLint genMipmap;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   786
		ctx->DGL().glGetTexParameteriv(target, GL_GENERATE_MIPMAP, &genMipmap);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   787
		GLESTexture* texture = ctx->Texture(ctx->TextureBinding());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   788
		GLES_ASSERT(texture != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   789
		if(level == 0 && genMipmap)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   790
		{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   791
			texture->GenerateMipmap();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   792
		}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   793
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   794
		if(texture->Level(level)->boundSurface != NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   795
		{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   796
			// Texture is respecified. Release the bound EGLSurface.
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   797
			glesReleaseTexImage(texture->Level(level)->boundSurface, texture->Name(), level);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   798
			texture->Level(level)->boundSurface = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   799
		}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   800
	}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   801
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   802
	GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   803
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   804
GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   805
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   806
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   807
	GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   808
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   809
	GLESTexture* texture = ctx->Texture(ctx->TextureBinding());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   810
	GLES_ASSERT(texture != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   811
	const GLESTextureLevel* level_obj = texture->Level(level);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   812
	if(isPalettedFormat(level_obj->format))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   813
	{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   814
		GLES_ERROR(GL_INVALID_OPERATION);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   815
	}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   816
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   817
	GLES_LOCK_READ_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   818
	ctx->DGL().glCopyTexSubImage2D (target, level, xoffset, yoffset, x, y, width, height);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   819
	GLES_UNLOCK_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   820
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   821
	if(ctx->GetHostError() == GL_NO_ERROR)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   822
	{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   823
		GLint genMipmap;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   824
		ctx->DGL().glGetTexParameteriv(target, GL_GENERATE_MIPMAP, &genMipmap);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   825
		if(level == 0 && genMipmap)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   826
		{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   827
			GLESTexture* texture = ctx->Texture(ctx->TextureBinding());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   828
			GLES_ASSERT(texture != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   829
			texture->GenerateMipmap();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   830
		}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   831
	}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   832
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   833
	GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   834
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   835
GL_API void GL_APIENTRY glCullFace (GLenum mode)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   836
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   837
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   838
    ctx->DGL().glCullFace (mode);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   839
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   840
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   841
GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   842
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   843
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   844
    GLES_ERROR_IF(n < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   845
    for(int i = 0; i < n; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   846
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   847
        ctx->DeleteBuffer(buffers[i]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   848
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   849
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   850
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   851
GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   852
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   853
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   854
    GLES_ERROR_IF(n < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   855
    ctx->GetHostError();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   856
    ctx->DGL().glDeleteTextures (n, textures);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   857
    if(ctx->GetHostError() == GL_NO_ERROR)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   858
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   859
        for(int i = 0; i < n; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   860
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   861
            ctx->DeleteTexture(textures[i]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   862
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   863
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   864
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   865
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   866
GL_API void GL_APIENTRY glDepthFunc (GLenum func)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   867
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   868
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   869
    ctx->DGL().glDepthFunc (func);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   870
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   871
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   872
GL_API void GL_APIENTRY glDepthMask (GLboolean flag)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   873
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   874
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   875
    ctx->DGL().glDepthMask (flag);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   876
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   877
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   878
GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   879
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   880
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   881
    ctx->DGL().glDepthRange(X_TO_D(zNear), X_TO_D(zFar));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   882
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   883
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   884
bool isValidCapabilityEnum(GLenum cap)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   885
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   886
    switch(cap)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   887
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   888
    case GL_NORMALIZE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   889
    case GL_RESCALE_NORMAL:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   890
    case GL_CLIP_PLANE0:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   891
    case GL_CLIP_PLANE1:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   892
    case GL_CLIP_PLANE2:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   893
    case GL_CLIP_PLANE3:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   894
    case GL_CLIP_PLANE4:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   895
    case GL_CLIP_PLANE5:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   896
    case GL_FOG:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   897
    case GL_LIGHTING:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   898
    case GL_COLOR_MATERIAL:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   899
    case GL_LIGHT0:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   900
    case GL_LIGHT1:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   901
    case GL_LIGHT2:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   902
    case GL_LIGHT3:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   903
    case GL_LIGHT4:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   904
    case GL_LIGHT5:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   905
    case GL_LIGHT6:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   906
    case GL_LIGHT7:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   907
    case GL_POINT_SMOOTH:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   908
    case GL_POINT_SPRITE_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   909
    case GL_LINE_SMOOTH:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   910
    case GL_CULL_FACE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   911
    case GL_POLYGON_OFFSET_FILL:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   912
    case GL_MULTISAMPLE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   913
    case GL_SAMPLE_ALPHA_TO_COVERAGE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   914
    case GL_SAMPLE_ALPHA_TO_ONE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   915
    case GL_SAMPLE_COVERAGE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   916
    case GL_TEXTURE_2D:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   917
    case GL_SCISSOR_TEST:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   918
    case GL_ALPHA_TEST:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   919
    case GL_STENCIL_TEST:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   920
    case GL_DEPTH_TEST:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   921
    case GL_BLEND:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   922
    case GL_DITHER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   923
    case GL_COLOR_LOGIC_OP:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   924
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   925
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   926
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   927
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   928
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   929
GL_API void GL_APIENTRY glDisable (GLenum cap)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   930
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   931
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   932
    GLES_ERROR_IF(!isValidCapabilityEnum(cap), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   933
    cap = cap == GL_POINT_SPRITE_OES ? GL_POINT_SPRITE : cap;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   934
    ctx->DGL().glDisable (cap);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   935
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   936
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   937
static GLESArrayFlag mapArrayType(GLenum type)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   938
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   939
    switch(type)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   940
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   941
    case GL_VERTEX_ARRAY:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   942
        return GLES_VERTEX_ARRAY;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   943
    case GL_NORMAL_ARRAY:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   944
        return GLES_NORMAL_ARRAY;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   945
    case GL_COLOR_ARRAY:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   946
        return GLES_COLOR_ARRAY;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   947
    case GL_POINT_SIZE_ARRAY_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   948
        return GLES_POINT_SIZE_ARRAY;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   949
    case GL_TEXTURE_COORD_ARRAY:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   950
        return GLES_TEXTURE_COORD_ARRAY;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   951
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   952
        return GLES_INVALID_ARRAY;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   953
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   954
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   955
GL_API void GL_APIENTRY glDisableClientState (GLenum array)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   956
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   957
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   958
    int flag = static_cast<int>(mapArrayType(array));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   959
    GLES_ERROR_IF(flag == GLES_INVALID_ARRAY, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   960
    if(flag == GLES_TEXTURE_COORD_ARRAY)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   961
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   962
        flag <<= ctx->ClientActiveTexture();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   963
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   964
    ctx->DisableArray(static_cast<GLESArrayFlag>(flag));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   965
    if(array != GL_POINT_SIZE_ARRAY_OES)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   966
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   967
        ctx->DGL().glDisableClientState(array);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   968
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   969
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   970
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   971
static bool convertArrays(const GLESContext& ctx, GLsizei count, GLESArray** vertexArr, GLESArray** normalArr,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   972
                          GLESArray** colorArr, GLESArray** texCoordArr)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   973
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   974
    *vertexArr = ctx.VertexArray().Convert(count);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   975
    if(*vertexArr == NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   976
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   977
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   978
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   979
    ctx.DGL().glVertexPointer((*vertexArr)->Size(), (*vertexArr)->Type(), (*vertexArr)->Stride(), (*vertexArr)->Pointer());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   980
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   981
    if(ctx.IsArrayEnabled(GLES_NORMAL_ARRAY))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   982
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   983
        *normalArr = ctx.NormalArray().Convert(count);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   984
        if(*normalArr == NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   985
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   986
            return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   987
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   988
        ctx.DGL().glNormalPointer((*normalArr)->Type(), (*normalArr)->Stride(), (*normalArr)->Pointer());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   989
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   990
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   991
    if(ctx.IsArrayEnabled(GLES_COLOR_ARRAY))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   992
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   993
        *colorArr = ctx.ColorArray().Convert(count);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   994
        if(*colorArr == NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   995
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   996
            return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   997
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   998
        ctx.DGL().glColorPointer((*colorArr)->Size(), (*colorArr)->Type(), (*colorArr)->Stride(), (*colorArr)->Pointer());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
   999
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1000
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1001
    for(unsigned int i = 0; i < ctx.MaxTextureUnits(); i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1002
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1003
        if(ctx.IsArrayEnabled(static_cast<GLESArrayFlag>(GLES_TEXTURE_COORD_ARRAY << i)))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1004
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1005
            texCoordArr[i] = ctx.TexCoordArray(i).Convert(count);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1006
            if(texCoordArr[i] == NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1007
            {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1008
                return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1009
            }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1010
            ctx.DGL().glClientActiveTexture(GL_TEXTURE0 + i);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1011
            ctx.DGL().glTexCoordPointer(texCoordArr[i]->Size(), texCoordArr[i]->Type(),
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1012
                                    texCoordArr[i]->Stride(), texCoordArr[i]->Pointer());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1013
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1014
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1015
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1016
    // Reset state
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1017
    ctx.DGL().glClientActiveTexture(GL_TEXTURE0 + ctx.ClientActiveTexture());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1018
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1019
    return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1020
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1021
void drawPoint(const GLESContext& ctx, int i, GLESArrayPointer& vertexPtr, GLESArrayPointer& normalPtr,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1022
               GLESArrayPointer& colorPtr, GLESArrayPointer& pointSizePtr,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1023
               GLESArrayPointer* texCoordPtr)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1024
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1025
    if(normalPtr != NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1026
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1027
        switch(normalPtr.Type())
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1028
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1029
        case GL_BYTE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1030
        case GL_SHORT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1031
            ctx.DGL().glNormal3sv(static_cast<const GLshort*>(normalPtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1032
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1033
        case GL_FIXED:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1034
        case GL_FLOAT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1035
            ctx.DGL().glNormal3fv(static_cast<const GLfloat*>(normalPtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1036
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1037
        default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1038
            GLES_ASSERT(false);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1039
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1040
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1041
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1042
    if(colorPtr != NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1043
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1044
        switch(colorPtr.Type())
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1045
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1046
        case GL_UNSIGNED_BYTE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1047
            ctx.DGL().glColor4ubv(static_cast<const GLubyte*>(colorPtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1048
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1049
        case GL_FIXED:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1050
        case GL_FLOAT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1051
            ctx.DGL().glColor4fv(static_cast<const GLfloat*>(colorPtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1052
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1053
        default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1054
            GLES_ASSERT(false);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1055
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1056
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1057
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1058
    GLES_ASSERT(pointSizePtr != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1059
    ctx.DGL().glPointSize(*static_cast<const GLfloat*>(pointSizePtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1060
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1061
    for(unsigned int j = 0; j < ctx.MaxTextureUnits(); j++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1062
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1063
        int texture = GL_TEXTURE0 + j;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1064
		
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1065
        if(texCoordPtr[j] != NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1066
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1067
            switch(texCoordPtr[j].Type())
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1068
            {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1069
            case GL_BYTE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1070
            case GL_SHORT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1071
                switch(texCoordPtr[j].Size())
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1072
                {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1073
                case 2:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1074
                    ctx.DGL().glMultiTexCoord2sv(texture, static_cast<const GLshort*>(texCoordPtr[j][i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1075
                    break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1076
                case 3:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1077
                    ctx.DGL().glMultiTexCoord3sv(texture, static_cast<const GLshort*>(texCoordPtr[j][i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1078
                    break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1079
                case 4:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1080
                    ctx.DGL().glMultiTexCoord4sv(texture, static_cast<const GLshort*>(texCoordPtr[j][i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1081
                    break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1082
                default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1083
                    GLES_ASSERT(false);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1084
                }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1085
                break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1086
            case GL_FIXED:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1087
            case GL_FLOAT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1088
                switch(texCoordPtr[j].Size())
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1089
                {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1090
                case 2:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1091
                    ctx.DGL().glMultiTexCoord2fv(texture, static_cast<const GLfloat*>(texCoordPtr[j][i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1092
                    break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1093
                case 3:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1094
                    ctx.DGL().glMultiTexCoord3fv(texture, static_cast<const GLfloat*>(texCoordPtr[j][i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1095
                    break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1096
                case 4:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1097
                    ctx.DGL().glMultiTexCoord4fv(texture, static_cast<const GLfloat*>(texCoordPtr[j][i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1098
                    break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1099
                default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1100
                    GLES_ASSERT(false);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1101
                }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1102
                break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1103
            default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1104
                GLES_ASSERT(false);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1105
            }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1106
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1107
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1108
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1109
    GLES_ASSERT(vertexPtr != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1110
    ctx.DGL().glBegin(GL_POINTS);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1111
    switch(vertexPtr.Type())
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1112
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1113
    case GL_BYTE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1114
    case GL_SHORT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1115
        switch(vertexPtr.Size())
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1116
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1117
        case 2:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1118
            ctx.DGL().glVertex2sv(static_cast<const GLshort*>(vertexPtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1119
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1120
        case 3:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1121
            ctx.DGL().glVertex3sv(static_cast<const GLshort*>(vertexPtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1122
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1123
        case 4:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1124
            ctx.DGL().glVertex4sv(static_cast<const GLshort*>(vertexPtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1125
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1126
        default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1127
            GLES_ASSERT(false);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1128
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1129
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1130
    case GL_FIXED:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1131
    case GL_FLOAT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1132
        switch(vertexPtr.Size())
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1133
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1134
        case 2:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1135
            ctx.DGL().glVertex2fv(static_cast<const GLfloat*>(vertexPtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1136
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1137
        case 3:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1138
            ctx.DGL().glVertex3fv(static_cast<const GLfloat*>(vertexPtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1139
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1140
        case 4:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1141
            ctx.DGL().glVertex4fv(static_cast<const GLfloat*>(vertexPtr[i]));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1142
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1143
        default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1144
            GLES_ASSERT(false);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1145
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1146
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1147
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1148
        GLES_ASSERT(false);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1149
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1150
    ctx.DGL().glEnd();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1151
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1152
bool drawPointArrays(const GLESContext& ctx, int first, int count,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1153
                     GLESArray* vertexArr, GLESArray* normalArr, GLESArray* colorArr, GLESArray** texCoordArr)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1154
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1155
    GLESArray* pointSizeArr = ctx.PointSizeArray().Convert(count);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1156
    if(pointSizeArr == NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1157
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1158
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1159
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1160
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1161
    GLES_ASSERT(vertexArr != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1162
    GLESArrayPointer vertexPtr = vertexArr->ArrayPointer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1163
    GLESArrayPointer normalPtr = normalArr != NULL ? normalArr->ArrayPointer() : GLESArrayPointer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1164
    GLESArrayPointer colorPtr = colorArr != NULL ? colorArr->ArrayPointer() : GLESArrayPointer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1165
    GLESArrayPointer pointSizePtr = pointSizeArr != NULL ? pointSizeArr->ArrayPointer() : GLESArrayPointer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1166
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1167
    GLESArrayPointer* texCoordPtr = GLES_NEW GLESArrayPointer[ctx.MaxTextureUnits()];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1168
    if(texCoordPtr == NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1169
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1170
        delete pointSizeArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1171
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1172
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1173
    for(unsigned int i = 0; i < ctx.MaxTextureUnits(); i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1174
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1175
        texCoordPtr[i] = texCoordArr[i] != NULL ? texCoordArr[i]->ArrayPointer() : GLESArrayPointer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1176
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1177
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1178
    // Draw individual points
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1179
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1180
    for(int i = first; i < first + count; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1181
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1182
        drawPoint(ctx, i, vertexPtr, normalPtr, colorPtr, pointSizePtr, texCoordPtr);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1183
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1184
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1185
    delete[] texCoordPtr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1186
    delete pointSizeArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1187
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1188
    return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1189
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1190
bool drawPointElements(const GLESContext& ctx, int count, GLenum type, const void* indices,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1191
                       GLESArray* vertexArr, GLESArray* normalArr, GLESArray* colorArr, GLESArray** texCoordArr)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1192
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1193
    GLESArray* pointSizeArr = ctx.PointSizeArray().Convert(count);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1194
    if(pointSizeArr == NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1195
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1196
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1197
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1198
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1199
    GLES_ASSERT(vertexArr != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1200
    GLESArrayPointer vertexPtr = vertexArr->ArrayPointer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1201
    GLESArrayPointer normalPtr = normalArr != NULL ? normalArr->ArrayPointer() : GLESArrayPointer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1202
    GLESArrayPointer colorPtr = colorArr != NULL ? colorArr->ArrayPointer() : GLESArrayPointer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1203
    GLESArrayPointer pointSizePtr = pointSizeArr != NULL ? pointSizeArr->ArrayPointer() : GLESArrayPointer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1204
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1205
    GLESArrayPointer* texCoordPtr = GLES_NEW GLESArrayPointer[ctx.MaxTextureUnits()];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1206
    if(texCoordPtr == NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1207
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1208
        delete pointSizeArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1209
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1210
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1211
    for(unsigned int i = 0; i < ctx.MaxTextureUnits(); i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1212
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1213
        texCoordPtr[i] = texCoordArr[i] != NULL ? texCoordArr[i]->ArrayPointer() : GLESArrayPointer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1214
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1215
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1216
    // Draw individual points
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1217
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1218
    for(int i = 0; i < count; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1219
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1220
        int index;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1221
        switch(type)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1222
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1223
        case GL_UNSIGNED_BYTE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1224
            index = static_cast<const GLubyte*>(indices)[i];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1225
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1226
        case GL_UNSIGNED_SHORT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1227
            index = static_cast<const GLushort*>(indices)[i];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1228
            break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1229
        default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1230
            GLES_ASSERT(false);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1231
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1232
        drawPoint(ctx, index, vertexPtr, normalPtr, colorPtr, pointSizePtr, texCoordPtr);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1233
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1234
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1235
    delete[] texCoordPtr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1236
    delete pointSizeArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1237
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1238
    return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1239
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1240
GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1241
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1242
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1243
	GLES_ERROR_IF(count < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1244
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1245
    if(!ctx->IsArrayEnabled(GLES_VERTEX_ARRAY) || !count)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1246
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1247
        // Nothing to draw
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1248
        GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1249
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1250
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1251
    GLESArray* vertexArr = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1252
    GLESArray* normalArr = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1253
    GLESArray* colorArr = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1254
    GLESArray** texCoordArr = GLES_NEW GLESArray*[ctx->MaxTextureUnits()];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1255
    for(unsigned int i = 0; i < ctx->MaxTextureUnits(); i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1256
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1257
        texCoordArr[i] = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1258
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1259
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1260
    bool oom = !convertArrays(*ctx, count, &vertexArr, &normalArr, &colorArr, texCoordArr);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1261
    if(!oom)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1262
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1263
		GLES_LOCK_DRAW_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1264
        if(mode == GL_POINTS && ctx->IsArrayEnabled(GLES_POINT_SIZE_ARRAY))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1265
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1266
            oom = !drawPointArrays(*ctx, first, count, vertexArr, normalArr, colorArr, texCoordArr);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1267
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1268
        else
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1269
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1270
            ctx->DGL().glDrawArrays (mode, first, count);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1271
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1272
		GLES_UNLOCK_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1273
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1274
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1275
    for(unsigned int i = 0; i < ctx->MaxTextureUnits(); i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1276
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1277
        delete texCoordArr[i];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1278
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1279
    delete colorArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1280
    delete normalArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1281
    delete vertexArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1282
    delete[] texCoordArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1283
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1284
    if(oom)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1285
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1286
        GLES_ERROR(GL_OUT_OF_MEMORY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1287
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1288
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1289
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1290
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1291
GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1292
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1293
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1294
	GLES_ERROR_IF(count < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1295
	GLES_ERROR_IF(type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_SHORT, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1296
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1297
    if(!ctx->IsArrayEnabled(GLES_VERTEX_ARRAY) || !count)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1298
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1299
        // Nothing to draw
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1300
        GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1301
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1302
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1303
    GLESArray* vertexArr = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1304
    GLESArray* normalArr = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1305
    GLESArray* colorArr = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1306
    GLESArray** texCoordArr = GLES_NEW GLESArray*[ctx->MaxTextureUnits()];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1307
    for(unsigned int i = 0; i < ctx->MaxTextureUnits(); i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1308
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1309
        texCoordArr[i] = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1310
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1311
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1312
    bool oom = !convertArrays(*ctx, count, &vertexArr, &normalArr, &colorArr, texCoordArr);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1313
    if(!oom)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1314
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1315
        if(indices == NULL && ctx->ElementArrayBufferBinding())
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1316
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1317
            indices = ctx->ElementArrayBuffer()->data;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1318
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1319
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1320
		GLES_LOCK_DRAW_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1321
        if(mode == GL_POINTS && ctx->IsArrayEnabled(GLES_POINT_SIZE_ARRAY))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1322
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1323
            oom = !drawPointElements(*ctx, count, type, indices,
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1324
                                     vertexArr, normalArr, colorArr, texCoordArr);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1325
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1326
        else
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1327
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1328
            ctx->DGL().glDrawElements (mode, count, type, indices);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1329
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1330
		GLES_UNLOCK_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1331
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1332
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1333
    for(unsigned int i = 0; i < ctx->MaxTextureUnits(); i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1334
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1335
        delete texCoordArr[i];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1336
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1337
    delete colorArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1338
    delete normalArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1339
    delete vertexArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1340
    delete[] texCoordArr;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1341
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1342
    if(oom)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1343
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1344
        GLES_ERROR(GL_OUT_OF_MEMORY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1345
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1346
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1347
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1348
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1349
GL_API void GL_APIENTRY glEnable (GLenum cap)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1350
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1351
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1352
    GLES_ERROR_IF(!isValidCapabilityEnum(cap), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1353
    ctx->DGL().glEnable (cap);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1354
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1355
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1356
GL_API void GL_APIENTRY glEnableClientState (GLenum array)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1357
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1358
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1359
    array = array == GL_POINT_SIZE_ARRAY_OES ? GL_POINT_SIZE_ARRAY : array;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1360
    int flag = static_cast<int>(mapArrayType(array));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1361
    GLES_ERROR_IF(flag == GLES_INVALID_ARRAY, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1362
    if(flag == GLES_TEXTURE_COORD_ARRAY)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1363
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1364
        flag <<= ctx->ClientActiveTexture();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1365
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1366
    ctx->EnableArray(static_cast<GLESArrayFlag>(flag));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1367
    if(array != GL_POINT_SIZE_ARRAY_OES)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1368
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1369
        ctx->DGL().glEnableClientState(array);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1370
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1371
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1372
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1373
GL_API void GL_APIENTRY glFinish (void)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1374
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1375
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1376
	ctx->DGL().glFinish();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1377
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1378
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1379
GL_API void GL_APIENTRY glFlush (void)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1380
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1381
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1382
	ctx->DGL().glFlush();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1383
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1384
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1385
GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1386
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1387
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1388
    GLES_ERROR_IF(!isValidSingleValuedFogParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1389
    if(pname == GL_FOG_MODE)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1390
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1391
        ctx->DGL().glFogf(pname, static_cast<GLfloat>(param));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1392
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1393
    else
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1394
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1395
        ctx->DGL().glFogf(pname, X_TO_F(param));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1396
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1397
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1398
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1399
GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1400
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1401
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1402
    GLES_ERROR_IF(!isValidFogParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1403
    if(pname == GL_FOG_MODE)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1404
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1405
        GLfloat fparam = static_cast<GLfloat>(params[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1406
        ctx->DGL().glFogfv (pname, &fparam);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1407
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1408
    else
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1409
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1410
        GLfloat fparams[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1411
        fparams[0] = X_TO_F(params[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1412
        if (pname == GL_FOG_COLOR)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1413
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1414
            fparams[1] = X_TO_F(params[1]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1415
            fparams[2] = X_TO_F(params[2]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1416
            fparams[3] = X_TO_F(params[3]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1417
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1418
        ctx->DGL().glFogfv (pname, fparams);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1419
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1420
	
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1421
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1422
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1423
GL_API void GL_APIENTRY glFrontFace (GLenum mode)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1424
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1425
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1426
    ctx->DGL().glFrontFace (mode);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1427
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1428
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1429
GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1430
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1431
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1432
    ctx->DGL().glFrustum (X_TO_D(left), X_TO_D(right), X_TO_D(bottom), X_TO_D(top), X_TO_D(zNear), X_TO_D(zFar));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1433
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1434
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1435
GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1436
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1437
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1438
    if(!glesGetParameter(*ctx, ctx->DGL(), pname, GLES_TYPE_BOOLEAN, params))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1439
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1440
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1441
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1442
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1443
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1444
GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1445
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1446
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1447
    GLES_ERROR_IF(!isValidBufferTarget(target), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1448
	
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1449
    const GLESBuffer* buffer;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1450
    switch(target)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1451
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1452
    case GL_ARRAY_BUFFER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1453
        buffer = ctx->ArrayBuffer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1454
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1455
    case GL_ELEMENT_ARRAY_BUFFER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1456
        buffer = ctx->ElementArrayBuffer();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1457
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1458
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1459
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1460
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1461
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1462
    switch(pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1463
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1464
    case GL_BUFFER_SIZE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1465
        *params = buffer->size;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1466
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1467
    case GL_BUFFER_USAGE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1468
        *params = buffer->usage;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1469
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1470
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1471
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1472
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1473
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1474
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1475
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1476
GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4])
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1477
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1478
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1479
    GLES_ERROR_IF(pname < GL_CLIP_PLANE0 || pname >= GL_CLIP_PLANE0 + ctx->MaxClipPlanes(), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1480
    GLdouble deqn[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1481
    ctx->DGL().glGetClipPlane(pname, deqn);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1482
    for (int i = 0; i < 4; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1483
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1484
        eqn[i] = D_TO_X(deqn[i]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1485
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1486
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1487
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1488
GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1489
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1490
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1491
    GLES_ERROR_IF(n < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1492
    ctx->ReserveBufferNames(n, buffers);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1493
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1494
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1495
GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1496
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1497
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1498
    ctx->DGL().glGenTextures (n, textures);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1499
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1500
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1501
GL_API GLenum GL_APIENTRY glGetError (void)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1502
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1503
    GLES_ENTER_RET(GL_INVALID_OPERATION);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1504
    GLenum error = ctx->Error();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1505
    ctx->SetError(GL_NO_ERROR);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1506
    GLES_LEAVE_RET(error);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1507
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1508
GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1509
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1510
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1511
    if(!glesGetParameter(*ctx, ctx->DGL(), pname, GLES_TYPE_FIXED, params))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1512
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1513
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1514
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1515
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1516
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1517
GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1518
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1519
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1520
    if(!glesGetParameter(*ctx, ctx->DGL(), pname, GLES_TYPE_INTEGER, params))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1521
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1522
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1523
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1524
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1525
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1526
bool isValidLightEnum(GLenum light, unsigned int maxLights)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1527
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1528
    return light >= GL_LIGHT0 && light < GL_LIGHT0 + maxLights;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1529
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1530
GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1531
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1532
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1533
    GLES_ERROR_IF(!isValidLightEnum(light, ctx->MaxLights()), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1534
	
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1535
    float fparams[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1536
    ctx->DGL().glGetLightfv(light, pname, fparams);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1537
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1538
    switch (pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1539
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1540
    case GL_AMBIENT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1541
    case GL_DIFFUSE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1542
    case GL_SPECULAR:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1543
    case GL_POSITION:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1544
        params[3] = F_TO_X(fparams[3]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1545
    case GL_SPOT_DIRECTION:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1546
        params[2] = F_TO_X(fparams[2]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1547
        params[1] = F_TO_X(fparams[1]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1548
    case GL_SPOT_EXPONENT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1549
    case GL_SPOT_CUTOFF:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1550
    case GL_CONSTANT_ATTENUATION:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1551
    case GL_LINEAR_ATTENUATION:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1552
    case GL_QUADRATIC_ATTENUATION:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1553
        params[0] = F_TO_X(fparams[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1554
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1555
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1556
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1557
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1558
	
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1559
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1560
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1561
GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1562
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1563
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1564
    GLES_ERROR_IF(!isValidMaterialParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1565
    GLfloat fparams[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1566
    ctx->DGL().glGetMaterialfv (face, pname, fparams);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1567
    params[0] = F_TO_X(fparams[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1568
    if(pname != GL_SHININESS)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1569
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1570
        params[1] = F_TO_X(fparams[1]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1571
        params[2] = F_TO_X(fparams[2]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1572
        params[3] = F_TO_X(fparams[3]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1573
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1574
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1575
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1576
GL_API void GL_APIENTRY glGetPointerv (GLenum pname, GLvoid **params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1577
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1578
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1579
    switch(pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1580
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1581
    case GL_VERTEX_ARRAY_POINTER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1582
        *params = const_cast<GLvoid*>(ctx->VertexArray().Pointer());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1583
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1584
    case GL_NORMAL_ARRAY_POINTER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1585
        *params = const_cast<GLvoid*>(ctx->NormalArray().Pointer());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1586
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1587
    case GL_COLOR_ARRAY_POINTER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1588
        *params = const_cast<GLvoid*>(ctx->ColorArray().Pointer());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1589
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1590
    case GL_POINT_SIZE_ARRAY_POINTER_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1591
        *params = const_cast<GLvoid*>(ctx->PointSizeArray().Pointer());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1592
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1593
    case GL_TEXTURE_COORD_ARRAY_POINTER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1594
        *params = const_cast<GLvoid*>(ctx->TexCoordArray().Pointer());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1595
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1596
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1597
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1598
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1599
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1600
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1601
GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1602
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1603
    GLES_ENTER_RET(NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1604
    static const GLubyte vendor[] = "Nokia";
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1605
    static const GLubyte renderer[] = "OpenGL ES-CM 1.1";
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1606
    static const GLubyte version[] = "OpenGL ES-CM 1.1";
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1607
    static const GLubyte extensions[] = "GL_OES_read_format GL_OES_compressed_paletted_texture "
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1608
                                        "GL_OES_point_size_array GL_OES_point_sprite";
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1609
    const GLubyte* str = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1610
    switch(name)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1611
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1612
    case GL_VENDOR:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1613
        str = vendor;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1614
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1615
    case GL_RENDERER:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1616
        str = renderer;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1617
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1618
    case GL_VERSION:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1619
        str = version;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1620
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1621
    case GL_EXTENSIONS:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1622
        str = extensions;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1623
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1624
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1625
        GLES_ERROR_RET(GL_INVALID_ENUM, NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1626
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1627
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1628
    GLES_LEAVE_RET(str);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1629
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1630
GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1631
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1632
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1633
    pname = pname == GL_COORD_REPLACE_OES ? GL_COORD_REPLACE : pname;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1634
    ctx->DGL().glGetTexEnviv (env, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1635
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1636
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1637
GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1638
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1639
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1640
    GLfloat fparams[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1641
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1642
    pname = pname == GL_COORD_REPLACE_OES ? GL_COORD_REPLACE : pname;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1643
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1644
    switch (pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1645
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1646
    case GL_TEXTURE_ENV_COLOR:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1647
        ctx->DGL().glGetTexEnvfv(env, pname, fparams);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1648
        params[0] = F_TO_X(fparams[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1649
        params[1] = F_TO_X(fparams[1]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1650
        params[2] = F_TO_X(fparams[2]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1651
        params[3] = F_TO_X(fparams[3]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1652
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1653
    case GL_RGB_SCALE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1654
    case GL_ALPHA_SCALE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1655
        ctx->DGL().glGetTexEnvfv(env, pname, fparams);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1656
        params[0] = F_TO_X(fparams[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1657
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1658
    case GL_COMBINE_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1659
    case GL_COMBINE_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1660
    case GL_COORD_REPLACE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1661
    case GL_TEXTURE_ENV_MODE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1662
    case GL_SRC0_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1663
    case GL_SRC0_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1664
    case GL_SRC1_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1665
    case GL_SRC1_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1666
    case GL_SRC2_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1667
    case GL_SRC2_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1668
    case GL_OPERAND0_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1669
    case GL_OPERAND0_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1670
    case GL_OPERAND1_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1671
    case GL_OPERAND1_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1672
    case GL_OPERAND2_RGB:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1673
    case GL_OPERAND2_ALPHA:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1674
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1675
            GLint i;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1676
            ctx->DGL().glGetTexEnviv(env, pname, &i);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1677
            params[0] = static_cast<GLfixed>(i);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1678
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1679
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1680
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1681
        GLES_ERROR(GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1682
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1683
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1684
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1685
GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1686
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1687
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1688
    GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1689
    GLES_ERROR_IF(!isValidTexParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1690
    ctx->DGL().glGetTexParameteriv (target, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1691
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1692
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1693
GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1694
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1695
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1696
    GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1697
    GLES_ERROR_IF(!isValidTexParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1698
    // All parameters are enum values, no conversion to be done.
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1699
    ctx->DGL().glGetTexParameteriv (target, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1700
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1701
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1702
bool isValidHintEnum(GLenum hint)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1703
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1704
    switch(hint)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1705
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1706
    case GL_PERSPECTIVE_CORRECTION_HINT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1707
    case GL_POINT_SMOOTH_HINT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1708
    case GL_LINE_SMOOTH_HINT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1709
    case GL_FOG_HINT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1710
    case GL_GENERATE_MIPMAP_HINT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1711
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1712
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1713
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1714
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1715
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1716
GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1717
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1718
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1719
    GLES_ERROR_IF(!isValidHintEnum(target), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1720
    ctx->DGL().glHint (target, mode);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1721
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1722
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1723
GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1724
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1725
    GLES_ENTER_RET(GL_FALSE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1726
    return ctx->Buffer(buffer) != NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1727
    GLES_LEAVE_RET(GL_FALSE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1728
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1729
GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1730
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1731
    GLES_ENTER_RET(GL_FALSE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1732
    switch(cap)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1733
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1734
    case GL_VERTEX_ARRAY:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1735
        return ctx->IsArrayEnabled(GLES_VERTEX_ARRAY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1736
    case GL_NORMAL_ARRAY:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1737
        return ctx->IsArrayEnabled(GLES_NORMAL_ARRAY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1738
    case GL_COLOR_ARRAY:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1739
        return ctx->IsArrayEnabled(GLES_COLOR_ARRAY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1740
    case GL_POINT_SIZE_ARRAY_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1741
        return ctx->IsArrayEnabled(GLES_POINT_SIZE_ARRAY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1742
    case GL_TEXTURE_COORD_ARRAY:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1743
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1744
        int flag = static_cast<int>(GLES_TEXTURE_COORD_ARRAY);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1745
        flag <<= ctx->ClientActiveTexture();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1746
        return ctx->IsArrayEnabled(static_cast<GLESArrayFlag>(flag));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1747
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1748
    case GL_POINT_SPRITE_OES:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1749
        return ctx->DGL().glIsEnabled(GL_POINT_SPRITE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1750
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1751
        GLES_ERROR_IF_RET(!isValidCapabilityEnum(cap), GL_INVALID_ENUM, GL_FALSE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1752
        return ctx->DGL().glIsEnabled(cap);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1753
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1754
    GLES_LEAVE_RET(ctx->DGL().glIsEnabled (cap));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1755
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1756
GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1757
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1758
    GLES_ENTER_RET(GL_FALSE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1759
    GLES_LEAVE_RET(ctx->DGL().glIsTexture (texture));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1760
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1761
GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1762
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1763
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1764
    GLES_ERROR_IF(pname != GL_LIGHT_MODEL_TWO_SIDE, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1765
    ctx->DGL().glLightModelf (pname, static_cast<GLfloat>(param));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1766
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1767
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1768
GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1769
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1770
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1771
    GLES_ERROR_IF(!isValidLightModelParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1772
    if(pname == GL_LIGHT_MODEL_TWO_SIDE)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1773
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1774
        GLfloat fparam = static_cast<GLfloat>(params[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1775
        ctx->DGL().glLightModelfv (pname, &fparam);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1776
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1777
    else
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1778
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1779
        GLfloat fparams[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1780
        fparams[0] = X_TO_F(params[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1781
        if(pname == GL_LIGHT_MODEL_AMBIENT)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1782
        {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1783
            fparams[1] = X_TO_F(params[1]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1784
            fparams[2] = X_TO_F(params[2]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1785
            fparams[3] = X_TO_F(params[3]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1786
        }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1787
        ctx->DGL().glLightModelfv (pname, fparams);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1788
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1789
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1790
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1791
GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1792
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1793
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1794
    GLES_ERROR_IF(!isValidLightEnum(light, ctx->MaxLights()), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1795
    ctx->DGL().glLightf (light, pname, X_TO_F(param));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1796
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1797
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1798
GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1799
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1800
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1801
    GLES_ERROR_IF(!isValidLightEnum(light, ctx->MaxLights()), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1802
    GLfloat fparams[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1803
    switch(pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1804
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1805
    case GL_AMBIENT:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1806
    case GL_DIFFUSE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1807
    case GL_SPECULAR:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1808
    case GL_POSITION:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1809
        fparams[3] = X_TO_F(params[3]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1810
    case GL_SPOT_DIRECTION:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1811
        fparams[2] = X_TO_F(params[2]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1812
        fparams[1] = X_TO_F(params[1]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1813
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1814
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1815
    fparams[0] = X_TO_F(params[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1816
    ctx->DGL().glLightfv (light, pname, fparams);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1817
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1818
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1819
GL_API void GL_APIENTRY glLineWidthx (GLfixed width)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1820
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1821
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1822
    ctx->DGL().glLineWidth (X_TO_F(width));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1823
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1824
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1825
GL_API void GL_APIENTRY glLoadIdentity (void)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1826
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1827
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1828
    ctx->DGL().glLoadIdentity ();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1829
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1830
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1831
GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1832
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1833
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1834
    GLfloat fm[16];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1835
    for(int i = 0; i < 16; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1836
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1837
        fm[i] = X_TO_F(m[i]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1838
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1839
    ctx->DGL().glLoadMatrixf (fm);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1840
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1841
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1842
GL_API void GL_APIENTRY glLogicOp (GLenum opcode)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1843
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1844
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1845
    ctx->DGL().glLogicOp (opcode);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1846
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1847
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1848
GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1849
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1850
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1851
    GLES_ERROR_IF(!isValidSingleValuedMaterialParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1852
    ctx->DGL().glMaterialf (face, pname, X_TO_F(param));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1853
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1854
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1855
GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1856
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1857
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1858
    GLES_ERROR_IF(!isValidMaterialParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1859
    GLfloat fparams[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1860
    for(int i = 0; i < 4; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1861
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1862
        fparams[i] = X_TO_F(params[i]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1863
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1864
    ctx->DGL().glMaterialfv (face, pname, fparams);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1865
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1866
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1867
GL_API void GL_APIENTRY glMatrixMode (GLenum mode)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1868
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1869
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1870
    ctx->DGL().glMatrixMode (mode);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1871
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1872
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1873
GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1874
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1875
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1876
    GLfloat fm[16];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1877
    for(int i = 0; i < 16; i++)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1878
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1879
        fm[i] = X_TO_F(m[i]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1880
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1881
    ctx->DGL().glMultMatrixf (fm);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1882
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1883
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1884
GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1885
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1886
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1887
    GLES_ERROR_IF(!isValidTextureTargetEnum(target, ctx->MaxTextureUnits()), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1888
    ctx->DGL().glMultiTexCoord4f (target, X_TO_F(s), X_TO_F(t), X_TO_F(r), X_TO_F(q));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1889
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1890
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1891
GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1892
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1893
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1894
    ctx->DGL().glNormal3f (X_TO_F(nx), X_TO_F(ny), X_TO_F(nz));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1895
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1896
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1897
GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1898
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1899
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1900
    GLES_ERROR_IF(type != GL_BYTE && type != GL_SHORT && type != GL_FIXED && type != GL_FLOAT, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1901
    GLES_ERROR_IF(stride < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1902
    ctx->SetNormalArray(type, stride, pointer);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1903
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1904
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1905
GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1906
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1907
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1908
    ctx->DGL().glOrtho (X_TO_D(left), X_TO_D(right), X_TO_D(bottom), X_TO_D(top), X_TO_D(zNear), X_TO_D(zFar));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1909
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1910
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1911
GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1912
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1913
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1914
    ctx->DGL().glPixelStorei (pname, param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1915
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1916
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1917
GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1918
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1919
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1920
    ctx->DGL().glPointParameterf (pname, X_TO_F(param));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1921
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1922
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1923
GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1924
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1925
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1926
    GLfloat fparams[3];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1927
    fparams[0] = X_TO_F(params[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1928
    if(pname == GL_POINT_DISTANCE_ATTENUATION)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1929
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1930
        fparams[1] = X_TO_F(params[1]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1931
        fparams[2] = X_TO_F(params[2]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1932
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1933
    ctx->DGL().glPointParameterfv (pname, fparams);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1934
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1935
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1936
GL_API void GL_APIENTRY glPointSizex (GLfixed size)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1937
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1938
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1939
    ctx->DGL().glPointSize (X_TO_F(size));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1940
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1941
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1942
GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1943
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1944
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1945
    ctx->DGL().glPolygonOffset (X_TO_F(factor), X_TO_F(units));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1946
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1947
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1948
GL_API void GL_APIENTRY glPopMatrix (void)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1949
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1950
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1951
    ctx->DGL().glPopMatrix();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1952
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1953
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1954
GL_API void GL_APIENTRY glPushMatrix (void)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1955
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1956
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1957
    ctx->DGL().glPushMatrix();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1958
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1959
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1960
bool isValidPixelTypeEnum(GLenum type)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1961
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1962
    switch(type)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1963
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1964
    case GL_UNSIGNED_BYTE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1965
    case GL_UNSIGNED_SHORT_5_6_5:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1966
    case GL_UNSIGNED_SHORT_4_4_4_4:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1967
    case GL_UNSIGNED_SHORT_5_5_5_1:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1968
        return true;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1969
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1970
        return false;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1971
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1972
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1973
GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1974
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1975
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1976
	GLES_ERROR_IF(!isValidPixelFormatEnum(format), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1977
	GLES_ERROR_IF(!isValidPixelTypeEnum(type), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1978
	GLES_LOCK_READ_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1979
	ctx->DGL().glReadPixels (x, y, width, height, format, type, pixels);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1980
	GLES_UNLOCK_SURFACE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1981
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1982
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1983
GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1984
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1985
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1986
    ctx->DGL().glRotatef (X_TO_F(angle), X_TO_F(x), X_TO_F(y), X_TO_F(z));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1987
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1988
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1989
GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1990
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1991
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1992
    ctx->DGL().glSampleCoverage (value, invert);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1993
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1994
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1995
GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1996
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1997
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1998
    ctx->DGL().glSampleCoverage (X_TO_F(value), invert);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  1999
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2000
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2001
GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2002
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2003
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2004
    ctx->DGL().glScalef (X_TO_F(x), X_TO_F(y), X_TO_F(z));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2005
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2006
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2007
GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2008
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2009
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2010
    ctx->DGL().glScissor (x, y, width, height);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2011
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2012
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2013
GL_API void GL_APIENTRY glShadeModel (GLenum mode)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2014
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2015
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2016
    ctx->DGL().glShadeModel (mode);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2017
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2018
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2019
GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2020
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2021
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2022
    ctx->DGL().glStencilFunc (func, ref, mask);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2023
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2024
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2025
GL_API void GL_APIENTRY glStencilMask (GLuint mask)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2026
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2027
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2028
    ctx->DGL().glStencilMask (mask);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2029
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2030
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2031
GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2032
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2033
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2034
    ctx->DGL().glStencilOp (fail,  zfail, zpass);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2035
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2036
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2037
GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2038
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2039
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2040
    GLES_ERROR_IF(size != 2 && size != 3 && size != 4, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2041
    GLES_ERROR_IF(type != GL_BYTE && type != GL_SHORT && type != GL_FIXED && type != GL_FLOAT, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2042
    GLES_ERROR_IF(stride < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2043
    ctx->SetTexCoordArray(size, type, stride, pointer);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2044
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2045
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2046
GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2047
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2048
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2049
    GLES_ERROR_IF(!isValidTexEnvTargetEnum(target), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2050
    GLES_ERROR_IF(!isValidSingleValuedTexEnvParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2051
    ctx->DGL().glTexEnvi (target, pname, param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2052
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2053
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2054
GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2055
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2056
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2057
    GLES_ERROR_IF(!isValidTexEnvTargetEnum(target), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2058
    GLES_ERROR_IF(!isValidSingleValuedTexEnvParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2059
    GLfloat fparam;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2060
    if(target == GL_TEXTURE_ENV && (pname == GL_RGB_SCALE || pname == GL_ALPHA_SCALE))
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2061
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2062
        fparam = X_TO_F(param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2063
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2064
    else
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2065
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2066
        fparam = static_cast<GLfloat>(param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2067
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2068
    ctx->DGL().glTexEnvf (target, pname, fparam);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2069
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2070
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2071
GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2072
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2073
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2074
    GLES_ERROR_IF(!isValidTexEnvTargetEnum(target), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2075
    GLES_ERROR_IF(!isValidTexEnvParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2076
    ctx->DGL().glTexEnviv (target, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2077
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2078
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2079
GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2080
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2081
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2082
    GLES_ERROR_IF(!isValidTexEnvTargetEnum(target), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2083
    GLES_ERROR_IF(!isValidTexEnvParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2084
    GLfloat fparams[4];
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2085
    switch(pname)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2086
    {
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2087
    case GL_TEXTURE_ENV_COLOR:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2088
        fparams[3] = X_TO_F(params[3]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2089
        fparams[2] = X_TO_F(params[2]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2090
        fparams[1] = X_TO_F(params[1]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2091
        // fall-through
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2092
    case GL_RGB_SCALE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2093
    case GL_ALPHA_SCALE:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2094
        fparams[0] = X_TO_F(params[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2095
        break;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2096
    default:
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2097
        fparams[0] = static_cast<GLfloat>(params[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2098
    }
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2099
    ctx->DGL().glTexEnvfv (target, pname, fparams);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2100
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2101
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2102
GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2103
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2104
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2105
	GLES_ERROR_IF(!isValidPixelFormatEnum(internalformat), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2106
	GLES_ERROR_IF(!isValidPixelFormatEnum(format), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2107
	GLES_ERROR_IF(!isValidPixelTypeEnum(type), GL_INVALID_ENUM);
68
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents: 53
diff changeset
  2108
	GLES_ERROR_IF(internalformat != (GLint)format, GL_INVALID_ENUM);
53
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2109
	GLES_ERROR_IF(isPalettedFormat(internalformat), GL_INVALID_OPERATION);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2110
	
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2111
	ctx->DGL().glTexImage2D (target, level, internalformat, width, height, border, format, type, pixels);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2112
	if(ctx->GetHostError() == GL_NO_ERROR)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2113
	{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2114
		GLESTexture* texture = ctx->Texture(ctx->TextureBinding());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2115
		GLES_ASSERT(texture != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2116
		texture->SetLevel(level, internalformat, width, height);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2117
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2118
		GLint genMipmap;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2119
		ctx->DGL().glGetTexParameteriv(target, GL_GENERATE_MIPMAP, &genMipmap);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2120
		if(level == 0 && genMipmap)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2121
		{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2122
			GLESTexture* texture = ctx->Texture(ctx->TextureBinding());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2123
			GLES_ASSERT(texture != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2124
			texture->GenerateMipmap();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2125
		}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2126
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2127
		if(texture->Level(level)->boundSurface != NULL)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2128
		{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2129
			// Texture is respecified. Release the bound EGLSurface.
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2130
			glesReleaseTexImage(texture->Level(level)->boundSurface, texture->Name(), level);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2131
			texture->Level(level)->boundSurface = NULL;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2132
		}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2133
	}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2134
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2135
	GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2136
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2137
GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2138
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2139
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2140
    GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2141
    GLES_ERROR_IF(!isValidTexParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2142
    ctx->DGL().glTexParameteri (target, pname, param);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2143
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2144
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2145
GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2146
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2147
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2148
    GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2149
    GLES_ERROR_IF(!isValidTexParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2150
    ctx->DGL().glTexParameterf (target, pname, static_cast<GLfloat>(param));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2151
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2152
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2153
GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2154
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2155
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2156
    GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2157
    GLES_ERROR_IF(!isValidTexParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2158
    ctx->DGL().glTexParameteriv (target, pname, params);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2159
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2160
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2161
GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2162
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2163
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2164
    GLES_ERROR_IF(target != GL_TEXTURE_2D, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2165
    GLES_ERROR_IF(!isValidTexParamEnum(pname), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2166
    GLfloat fparam = static_cast<GLfloat>(params[0]);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2167
    ctx->DGL().glTexParameterfv (target, pname, &fparam);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2168
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2169
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2170
GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2171
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2172
	GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2173
	GLES_ERROR_IF(!isValidPixelFormatEnum(format), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2174
	GLES_ERROR_IF(!isValidPixelTypeEnum(type), GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2175
	
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2176
	ctx->DGL().glTexSubImage2D (target, level, xoffset, yoffset, width, height, format, type, pixels);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2177
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2178
	if(ctx->GetHostError() == GL_NO_ERROR)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2179
	{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2180
		GLint genMipmap;
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2181
		ctx->DGL().glGetTexParameteriv(target, GL_GENERATE_MIPMAP, &genMipmap);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2182
		if(level == 0 && genMipmap)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2183
		{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2184
			GLESTexture* texture = ctx->Texture(ctx->TextureBinding());
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2185
			GLES_ASSERT(texture != NULL);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2186
			texture->GenerateMipmap();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2187
		}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2188
	}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2189
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2190
	GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2191
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2192
GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2193
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2194
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2195
    ctx->DGL().glTranslatef (X_TO_F(x), X_TO_F(y), X_TO_F(z));
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2196
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2197
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2198
GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2199
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2200
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2201
    GLES_ERROR_IF(size != 2 && size != 3 && size != 4, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2202
    GLES_ERROR_IF(type != GL_BYTE && type != GL_SHORT && type != GL_FIXED && type != GL_FLOAT, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2203
    GLES_ERROR_IF(stride < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2204
    ctx->SetVertexArray(size, type, stride, pointer);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2205
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2206
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2207
GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2208
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2209
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2210
    ctx->DGL().glViewport (x, y, width, height);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2211
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2212
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2213
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2214
#ifdef GL_OES_point_size_array
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2215
GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer)
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2216
{
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2217
    GLES_ENTER();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2218
    GLES_ERROR_IF(type != GL_FIXED && type != GL_FLOAT, GL_INVALID_ENUM);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2219
    GLES_ERROR_IF(stride < 0, GL_INVALID_VALUE);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2220
    ctx->SetPointerSizeArray(type, stride, pointer);
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2221
    GLES_LEAVE();
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2222
}
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2223
#endif
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2224
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2225
#ifdef __cplusplus
c2ef9095503a Copy code from the holdingarea into the target locations.
Matt Plumtree <matt.plumtree@nokia.com>
parents:
diff changeset
  2226
}
68
8d4efe9fa1cf Add a new FLM for building the host side DLLs (based on the x86build FLM).
Matt Plumtree <matt.plumtree@nokia.com>
parents: 53
diff changeset
  2227
#endif