epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 10 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 11 | #ifndef GrGLInterface_DEFINED |
| 12 | #define GrGLInterface_DEFINED |
| 13 | |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 14 | #include "GrGLConfig.h" |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 15 | #include "GrRefCnt.h" |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 16 | |
| 17 | #if !defined(GR_GL_FUNCTION_TYPE) |
| 18 | #define GR_GL_FUNCTION_TYPE |
| 19 | #endif |
| 20 | |
| 21 | //////////////////////////////////////////////////////////////////////////////// |
| 22 | |
| 23 | /** |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 24 | * Classifies GL contexts (currently as Desktop vs. ES2). This is a bitfield. |
| 25 | * A GrGLInterface (defined below) may support multiple bindings. |
| 26 | */ |
| 27 | enum GrGLBinding { |
| 28 | kNone_GrGLBinding = 0x0, |
| 29 | |
| 30 | kDesktop_GrGLBinding = 0x01, |
| 31 | kES2_GrGLBinding = 0x02, |
| 32 | |
| 33 | // for iteration of GrGLBindings |
bsalomon@google.com | b447d21 | 2012-02-10 20:25:36 +0000 | [diff] [blame] | 34 | kFirstGrGLBinding = kDesktop_GrGLBinding, |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 35 | kLastGrGLBinding = kES2_GrGLBinding |
| 36 | }; |
| 37 | |
| 38 | //////////////////////////////////////////////////////////////////////////////// |
| 39 | |
| 40 | /** |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 41 | * Helpers for glGetString() |
| 42 | */ |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 43 | |
bsalomon@google.com | 4d06214 | 2011-09-22 14:31:24 +0000 | [diff] [blame] | 44 | typedef uint32_t GrGLVersion; |
bsalomon@google.com | edfe1aa | 2011-09-29 14:40:26 +0000 | [diff] [blame] | 45 | typedef uint32_t GrGLSLVersion; |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 46 | |
bsalomon@google.com | edfe1aa | 2011-09-29 14:40:26 +0000 | [diff] [blame] | 47 | #define GR_GL_VER(major, minor) ((static_cast<int>(major) << 16) | \ |
| 48 | static_cast<int>(minor)) |
| 49 | #define GR_GLSL_VER(major, minor) ((static_cast<int>(major) << 16) | \ |
| 50 | static_cast<int>(minor)) |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 51 | |
bsalomon@google.com | 2c17fcd | 2011-07-06 17:47:02 +0000 | [diff] [blame] | 52 | // these variants assume caller already has a string from glGetString() |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 53 | GrGLVersion GrGLGetVersionFromString(const char* versionString); |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 54 | GrGLBinding GrGLGetBindingInUseFromString(const char* versionString); |
bsalomon@google.com | edfe1aa | 2011-09-29 14:40:26 +0000 | [diff] [blame] | 55 | GrGLSLVersion GrGLGetGLSLVersionFromString(const char* versionString); |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 56 | bool GrGLHasExtensionFromString(const char* ext, const char* extensionString); |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 57 | |
bsalomon@google.com | 2c17fcd | 2011-07-06 17:47:02 +0000 | [diff] [blame] | 58 | // these variants call glGetString() |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 59 | bool GrGLHasExtension(const GrGLInterface*, const char* ext); |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 60 | GrGLBinding GrGLGetBindingInUse(const GrGLInterface*); |
bsalomon@google.com | c82b889 | 2011-09-22 14:10:33 +0000 | [diff] [blame] | 61 | GrGLVersion GrGLGetVersion(const GrGLInterface*); |
bsalomon@google.com | edfe1aa | 2011-09-29 14:40:26 +0000 | [diff] [blame] | 62 | GrGLSLVersion GrGLGetGLSLVersion(const GrGLInterface*); |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 63 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 64 | //////////////////////////////////////////////////////////////////////////////// |
| 65 | |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 66 | /** |
| 67 | * Rather than depend on platform-specific GL headers and libraries, we require |
| 68 | * the client to provide a struct of GL function pointers. This struct can be |
| 69 | * specified per-GrContext as a parameter to GrContext::Create. If NULL is |
| 70 | * passed to Create then the "default" GL interface is used. If the default is |
| 71 | * also NULL GrContext creation will fail. |
| 72 | * |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 73 | * The default interface is returned by GrGLDefaultInterface. This function's |
robertphillips@google.com | 0da3719 | 2012-03-19 14:42:13 +0000 | [diff] [blame^] | 74 | * implementation is platform-specific. Several have been provided, along with |
| 75 | * an implementation that simply returns NULL. It is implementation-specific |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 76 | * whether the same GrGLInterface is returned or whether a new one is created |
| 77 | * at each call. Some platforms may not be able to use a single GrGLInterface |
| 78 | * because extension function ptrs vary across contexts. Note that GrGLInterface |
| 79 | * is ref-counted. So if the same object is returned by multiple calls to |
| 80 | * GrGLDefaultInterface, each should bump the ref count. |
bsalomon@google.com | 56bfc5a | 2011-09-01 13:28:16 +0000 | [diff] [blame] | 81 | * |
| 82 | * By defining GR_GL_PER_GL_CALL_IFACE_CALLBACK to 1 the client can specify a |
| 83 | * callback function that will be called prior to each GL function call. See |
| 84 | * comments in GrGLConfig.h |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 85 | */ |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 86 | |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 87 | struct GrGLInterface; |
| 88 | |
bsalomon@google.com | 6fb736f | 2011-09-16 18:51:57 +0000 | [diff] [blame] | 89 | const GrGLInterface* GrGLDefaultInterface(); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 90 | |
bsalomon@google.com | 57f5d98 | 2011-10-24 21:17:53 +0000 | [diff] [blame] | 91 | /** |
| 92 | * Creates a GrGLInterface for a "native" GL context (e.g. WGL on windows, |
| 93 | * GLX on linux, AGL on Mac). On platforms that have context-specific function |
| 94 | * pointers for GL extensions (e.g. windows) the returned interface is only |
| 95 | * valid for the context that was current at creation. |
| 96 | */ |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 97 | const GrGLInterface* GrGLCreateNativeInterface(); |
| 98 | |
bsalomon@google.com | 57f5d98 | 2011-10-24 21:17:53 +0000 | [diff] [blame] | 99 | /** |
| 100 | * Creates a GrGLInterface for an OSMesa context. |
| 101 | */ |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 102 | const GrGLInterface* GrGLCreateMesaInterface(); |
| 103 | |
bsalomon@google.com | 7491372 | 2011-10-27 20:44:19 +0000 | [diff] [blame] | 104 | /** |
| 105 | * Creates a null GrGLInterface that doesn't draw anything. Used for measuring |
| 106 | * CPU overhead. |
| 107 | */ |
| 108 | const GrGLInterface* GrGLCreateNullInterface(); |
| 109 | |
robertphillips@google.com | 0da3719 | 2012-03-19 14:42:13 +0000 | [diff] [blame^] | 110 | /** |
| 111 | * Creates a debugging GrGLInterface that doesn't draw anything. Used for |
| 112 | * finding memory leaks and invalid memory accesses. |
| 113 | */ |
| 114 | const GrGLInterface* GrGLCreateDebugInterface(); |
| 115 | |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 116 | typedef unsigned int GrGLenum; |
| 117 | typedef unsigned char GrGLboolean; |
| 118 | typedef unsigned int GrGLbitfield; |
| 119 | typedef signed char GrGLbyte; |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 120 | typedef char GrGLchar; |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 121 | typedef short GrGLshort; |
| 122 | typedef int GrGLint; |
| 123 | typedef int GrGLsizei; |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 124 | typedef int64_t GrGLint64; |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 125 | typedef unsigned char GrGLubyte; |
| 126 | typedef unsigned short GrGLushort; |
| 127 | typedef unsigned int GrGLuint; |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 128 | typedef uint64_t GrGLuint64; |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 129 | typedef float GrGLfloat; |
| 130 | typedef float GrGLclampf; |
| 131 | typedef double GrGLdouble; |
| 132 | typedef double GrGLclampd; |
| 133 | typedef void GrGLvoid; |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 134 | typedef long GrGLintptr; |
| 135 | typedef long GrGLsizeiptr; |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 136 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 137 | extern "C" { |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 138 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLActiveTextureProc)(GrGLenum texture); |
| 139 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLAttachShaderProc)(GrGLuint program, GrGLuint shader); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 140 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBeginQueryProc)(GrGLenum target, GrGLuint id); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 141 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindAttribLocationProc)(GrGLuint program, GrGLuint index, const char* name); |
| 142 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindBufferProc)(GrGLenum target, GrGLuint buffer); |
| 143 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindTextureProc)(GrGLenum target, GrGLuint texture); |
| 144 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendColorProc)(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha); |
bsalomon@google.com | bc5cf51 | 2011-09-21 16:21:07 +0000 | [diff] [blame] | 145 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindFragDataLocationProc)(GrGLuint program, GrGLuint colorNumber, const GrGLchar* name); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 146 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlendFuncProc)(GrGLenum sfactor, GrGLenum dfactor); |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 147 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBufferDataProc)(GrGLenum target, GrGLsizeiptr size, const GrGLvoid* data, GrGLenum usage); |
| 148 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBufferSubDataProc)(GrGLenum target, GrGLintptr offset, GrGLsizeiptr size, const GrGLvoid* data); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 149 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearProc)(GrGLbitfield mask); |
| 150 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearColorProc)(GrGLclampf red, GrGLclampf green, GrGLclampf blue, GrGLclampf alpha); |
| 151 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLClearStencilProc)(GrGLint s); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 152 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColorMaskProc)(GrGLboolean red, GrGLboolean green, GrGLboolean blue, GrGLboolean alpha); |
| 153 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLColorPointerProc)(GrGLint size, GrGLenum type, GrGLsizei stride, const GrGLvoid* pointer); |
| 154 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCompileShaderProc)(GrGLuint shader); |
| 155 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCompressedTexImage2DProc)(GrGLenum target, GrGLint level, GrGLenum internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLsizei imageSize, const GrGLvoid* data); |
| 156 | typedef GrGLuint (GR_GL_FUNCTION_TYPE *GrGLCreateProgramProc)(void); |
| 157 | typedef GrGLuint (GR_GL_FUNCTION_TYPE *GrGLCreateShaderProc)(GrGLenum type); |
| 158 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLCullFaceProc)(GrGLenum mode); |
| 159 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteBuffersProc)(GrGLsizei n, const GrGLuint* buffers); |
| 160 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteProgramProc)(GrGLuint program); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 161 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteQueriesProc)(GrGLsizei n, const GrGLuint *ids); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 162 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteShaderProc)(GrGLuint shader); |
| 163 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteTexturesProc)(GrGLsizei n, const GrGLuint* textures); |
| 164 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDepthMaskProc)(GrGLboolean flag); |
| 165 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableProc)(GrGLenum cap); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 166 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDisableVertexAttribArrayProc)(GrGLuint index); |
| 167 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawArraysProc)(GrGLenum mode, GrGLint first, GrGLsizei count); |
bsalomon@google.com | d32c5f5 | 2011-08-02 19:29:03 +0000 | [diff] [blame] | 168 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawBufferProc)(GrGLenum mode); |
| 169 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawBuffersProc)(GrGLsizei n, const GrGLenum* bufs); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 170 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDrawElementsProc)(GrGLenum mode, GrGLsizei count, GrGLenum type, const GrGLvoid* indices); |
| 171 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableProc)(GrGLenum cap); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 172 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEnableVertexAttribArrayProc)(GrGLuint index); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 173 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLEndQueryProc)(GrGLenum target); |
| 174 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFinishProc)(); |
| 175 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFlushProc)(); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 176 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFrontFaceProc)(GrGLenum mode); |
| 177 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenBuffersProc)(GrGLsizei n, GrGLuint* buffers); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 178 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenQueriesProc)(GrGLsizei n, GrGLuint *ids); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 179 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenTexturesProc)(GrGLsizei n, GrGLuint* textures); |
| 180 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetBufferParameterivProc)(GrGLenum target, GrGLenum pname, GrGLint* params); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 181 | typedef GrGLenum (GR_GL_FUNCTION_TYPE *GrGLGetErrorProc)(); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 182 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetIntegervProc)(GrGLenum pname, GrGLint* params); |
| 183 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetProgramInfoLogProc)(GrGLuint program, GrGLsizei bufsize, GrGLsizei* length, char* infolog); |
| 184 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetProgramivProc)(GrGLuint program, GrGLenum pname, GrGLint* params); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 185 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetQueryivProc)(GrGLenum GLtarget, GrGLenum pname, GrGLint *params); |
| 186 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetQueryObjecti64vProc)(GrGLuint id, GrGLenum pname, GrGLint64 *params); |
| 187 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetQueryObjectivProc)(GrGLuint id, GrGLenum pname, GrGLint *params); |
| 188 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetQueryObjectui64vProc)(GrGLuint id, GrGLenum pname, GrGLuint64 *params); |
| 189 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetQueryObjectuivProc)(GrGLuint id, GrGLenum pname, GrGLuint *params); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 190 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetShaderInfoLogProc)(GrGLuint shader, GrGLsizei bufsize, GrGLsizei* length, char* infolog); |
| 191 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetShaderivProc)(GrGLuint shader, GrGLenum pname, GrGLint* params); |
| 192 | typedef const GrGLubyte* (GR_GL_FUNCTION_TYPE *GrGLGetStringProc)(GrGLenum name); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 193 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetTexLevelParameterivProc)(GrGLenum target, GrGLint level, GrGLenum pname, GrGLint* params); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 194 | typedef GrGLint (GR_GL_FUNCTION_TYPE *GrGLGetUniformLocationProc)(GrGLuint program, const char* name); |
| 195 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLineWidthProc)(GrGLfloat width); |
| 196 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLLinkProgramProc)(GrGLuint program); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 197 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLPixelStoreiProc)(GrGLenum pname, GrGLint param); |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 198 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLQueryCounterProc)(GrGLuint id, GrGLenum target); |
bsalomon@google.com | c49d66b | 2011-08-03 14:22:30 +0000 | [diff] [blame] | 199 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLReadBufferProc)(GrGLenum src); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 200 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLReadPixelsProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, GrGLvoid* pixels); |
| 201 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLScissorProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 202 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLShaderSourceProc)(GrGLuint shader, GrGLsizei count, const char** str, const GrGLint* length); |
| 203 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilFuncProc)(GrGLenum func, GrGLint ref, GrGLuint mask); |
| 204 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilFuncSeparateProc)(GrGLenum face, GrGLenum func, GrGLint ref, GrGLuint mask); |
| 205 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilMaskProc)(GrGLuint mask); |
| 206 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilMaskSeparateProc)(GrGLenum face, GrGLuint mask); |
| 207 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilOpProc)(GrGLenum fail, GrGLenum zfail, GrGLenum zpass); |
| 208 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLStencilOpSeparateProc)(GrGLenum face, GrGLenum fail, GrGLenum zfail, GrGLenum zpass); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 209 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexImage2DProc)(GrGLenum target, GrGLint level, GrGLint internalformat, GrGLsizei width, GrGLsizei height, GrGLint border, GrGLenum format, GrGLenum type, const GrGLvoid* pixels); |
| 210 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexParameteriProc)(GrGLenum target, GrGLenum pname, GrGLint param); |
bsalomon@google.com | 280e99f | 2012-01-05 16:17:38 +0000 | [diff] [blame] | 211 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexStorage2DProc)(GrGLenum target, GrGLsizei levels, GrGLenum internalformat, GrGLsizei width, GrGLsizei height); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 212 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLTexSubImage2DProc)(GrGLenum target, GrGLint level, GrGLint xoffset, GrGLint yoffset, GrGLsizei width, GrGLsizei height, GrGLenum format, GrGLenum type, const GrGLvoid* pixels); |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 213 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1fProc)(GrGLint location, GrGLfloat v0); |
| 214 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1iProc)(GrGLint location, GrGLint v0); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 215 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v); |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 216 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform1ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v); |
| 217 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1); |
| 218 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2iProc)(GrGLint location, GrGLint v0, GrGLint v1); |
| 219 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v); |
| 220 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform2ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v); |
| 221 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2); |
| 222 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3iProc)(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2); |
| 223 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v); |
| 224 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform3ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v); |
| 225 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4fProc)(GrGLint location, GrGLfloat v0, GrGLfloat v1, GrGLfloat v2, GrGLfloat v3); |
| 226 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4iProc)(GrGLint location, GrGLint v0, GrGLint v1, GrGLint v2, GrGLint v3); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 227 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4fvProc)(GrGLint location, GrGLsizei count, const GrGLfloat* v); |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 228 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniform4ivProc)(GrGLint location, GrGLsizei count, const GrGLint* v); |
| 229 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix2fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 230 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix3fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value); |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 231 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUniformMatrix4fvProc)(GrGLint location, GrGLsizei count, GrGLboolean transpose, const GrGLfloat* value); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 232 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLUseProgramProc)(GrGLuint program); |
| 233 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttrib4fvProc)(GrGLuint indx, const GrGLfloat* values); |
| 234 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLVertexAttribPointerProc)(GrGLuint indx, GrGLint size, GrGLenum type, GrGLboolean normalized, GrGLsizei stride, const GrGLvoid* ptr); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 235 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLViewportProc)(GrGLint x, GrGLint y, GrGLsizei width, GrGLsizei height); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 236 | |
| 237 | // FBO Extension Functions |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 238 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindFramebufferProc)(GrGLenum target, GrGLuint framebuffer); |
| 239 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindRenderbufferProc)(GrGLenum target, GrGLuint renderbuffer); |
| 240 | typedef GrGLenum (GR_GL_FUNCTION_TYPE *GrGLCheckFramebufferStatusProc)(GrGLenum target); |
| 241 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteFramebuffersProc)(GrGLsizei n, const GrGLuint *framebuffers); |
| 242 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLDeleteRenderbuffersProc)(GrGLsizei n, const GrGLuint *renderbuffers); |
| 243 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFramebufferRenderbufferProc)(GrGLenum target, GrGLenum attachment, GrGLenum renderbuffertarget, GrGLuint renderbuffer); |
| 244 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFramebufferTexture2DProc)(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level); |
| 245 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenFramebuffersProc)(GrGLsizei n, GrGLuint *framebuffers); |
| 246 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGenRenderbuffersProc)(GrGLsizei n, GrGLuint *renderbuffers); |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 247 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetFramebufferAttachmentParameterivProc)(GrGLenum target, GrGLenum attachment, GrGLenum pname, GrGLint* params); |
| 248 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLGetRenderbufferParameterivProc)(GrGLenum target, GrGLenum pname, GrGLint* params); |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 249 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLRenderbufferStorageProc)(GrGLenum target, GrGLenum internalformat, GrGLsizei width, GrGLsizei height); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 250 | |
| 251 | // Multisampling Extension Functions |
| 252 | // same prototype for ARB_FBO, EXT_FBO, GL 3.0, & Apple ES extension |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 253 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLRenderbufferStorageMultisampleProc)(GrGLenum target, GrGLsizei samples, GrGLenum internalformat, GrGLsizei width, GrGLsizei height); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 254 | // desktop: ext_fbo_blit, arb_fbo, gl 3.0 |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 255 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBlitFramebufferProc)(GrGLint srcX0, GrGLint srcY0, GrGLint srcX1, GrGLint srcY1, GrGLint dstX0, GrGLint dstY0, GrGLint dstX1, GrGLint dstY1, GrGLbitfield mask, GrGLenum filter); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 256 | // apple's es extension |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 257 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLResolveMultisampleFramebufferProc)(); |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 258 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 259 | // Buffer mapping (extension in ES). |
twiz@google.com | 0f31ca7 | 2011-03-18 17:38:11 +0000 | [diff] [blame] | 260 | typedef GrGLvoid* (GR_GL_FUNCTION_TYPE *GrGLMapBufferProc)(GrGLenum target, GrGLenum access); |
| 261 | typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLUnmapBufferProc)(GrGLenum target); |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 262 | |
| 263 | // Dual source blending |
| 264 | typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLBindFragDataLocationIndexedProc)(GrGLuint program, GrGLuint colorNumber, GrGLuint index, const GrGLchar * name); |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 265 | } // extern "C" |
| 266 | |
bsalomon@google.com | 56bfc5a | 2011-09-01 13:28:16 +0000 | [diff] [blame] | 267 | #if GR_GL_PER_GL_FUNC_CALLBACK |
| 268 | typedef void (*GrGLInterfaceCallbackProc)(const GrGLInterface*); |
| 269 | typedef intptr_t GrGLInterfaceCallbackData; |
| 270 | #endif |
| 271 | |
| 272 | |
tomhudson@google.com | e67bd3f | 2011-06-16 14:08:04 +0000 | [diff] [blame] | 273 | enum GrGLCapability { |
| 274 | kProbe_GrGLCapability = -1 |
tomhudson@google.com | 30e4bb6 | 2011-06-15 19:41:46 +0000 | [diff] [blame] | 275 | }; |
| 276 | |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 277 | /* |
| 278 | * The following interface exports the OpenGL entry points used by the system. |
| 279 | * Use of OpenGL calls is disallowed. All calls should be invoked through |
| 280 | * the global instance of this struct, defined above. |
| 281 | * |
| 282 | * IMPORTANT NOTE: The OpenGL entry points exposed here include both core GL |
| 283 | * functions, and extensions. The system assumes that the address of the |
| 284 | * extension pointer will be valid across contexts. |
| 285 | */ |
bsalomon@google.com | 0b77d68 | 2011-08-19 13:28:54 +0000 | [diff] [blame] | 286 | struct GR_API GrGLInterface : public GrRefCnt { |
| 287 | |
| 288 | GrGLInterface(); |
| 289 | |
bsalomon@google.com | 89ec61e | 2012-02-10 20:05:18 +0000 | [diff] [blame] | 290 | // Validates that the GrGLInterface supports a binding. This means that |
| 291 | // the GrGLinterface advertises the binding in fBindingsExported and all |
| 292 | // the necessary function pointers have been initialized. |
| 293 | bool validate(GrGLBinding binding) const; |
| 294 | |
twiz@google.com | b65e0cb | 2011-03-18 20:41:44 +0000 | [diff] [blame] | 295 | // Indicator variable specifying the type of GL implementation |
| 296 | // exported: GLES{1|2} or Desktop. |
| 297 | GrGLBinding fBindingsExported; |
| 298 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 299 | GrGLActiveTextureProc fActiveTexture; |
| 300 | GrGLAttachShaderProc fAttachShader; |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 301 | GrGLBeginQueryProc fBeginQuery; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 302 | GrGLBindAttribLocationProc fBindAttribLocation; |
| 303 | GrGLBindBufferProc fBindBuffer; |
bsalomon@google.com | bc5cf51 | 2011-09-21 16:21:07 +0000 | [diff] [blame] | 304 | GrGLBindFragDataLocationProc fBindFragDataLocation; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 305 | GrGLBindTextureProc fBindTexture; |
bsalomon@google.com | 080773c | 2011-03-15 19:09:25 +0000 | [diff] [blame] | 306 | GrGLBlendColorProc fBlendColor; |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 307 | GrGLBlendFuncProc fBlendFunc; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 308 | GrGLBufferDataProc fBufferData; |
| 309 | GrGLBufferSubDataProc fBufferSubData; |
| 310 | GrGLClearProc fClear; |
| 311 | GrGLClearColorProc fClearColor; |
| 312 | GrGLClearStencilProc fClearStencil; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 313 | GrGLColorMaskProc fColorMask; |
| 314 | GrGLColorPointerProc fColorPointer; |
| 315 | GrGLCompileShaderProc fCompileShader; |
| 316 | GrGLCompressedTexImage2DProc fCompressedTexImage2D; |
| 317 | GrGLCreateProgramProc fCreateProgram; |
| 318 | GrGLCreateShaderProc fCreateShader; |
| 319 | GrGLCullFaceProc fCullFace; |
| 320 | GrGLDeleteBuffersProc fDeleteBuffers; |
| 321 | GrGLDeleteProgramProc fDeleteProgram; |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 322 | GrGLDeleteQueriesProc fDeleteQueries; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 323 | GrGLDeleteShaderProc fDeleteShader; |
| 324 | GrGLDeleteTexturesProc fDeleteTextures; |
| 325 | GrGLDepthMaskProc fDepthMask; |
| 326 | GrGLDisableProc fDisable; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 327 | GrGLDisableVertexAttribArrayProc fDisableVertexAttribArray; |
| 328 | GrGLDrawArraysProc fDrawArrays; |
bsalomon@google.com | d32c5f5 | 2011-08-02 19:29:03 +0000 | [diff] [blame] | 329 | GrGLDrawBufferProc fDrawBuffer; |
| 330 | GrGLDrawBuffersProc fDrawBuffers; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 331 | GrGLDrawElementsProc fDrawElements; |
| 332 | GrGLEnableProc fEnable; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 333 | GrGLEnableVertexAttribArrayProc fEnableVertexAttribArray; |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 334 | GrGLEndQueryProc fEndQuery; |
| 335 | GrGLFinishProc fFinish; |
| 336 | GrGLFlushProc fFlush; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 337 | GrGLFrontFaceProc fFrontFace; |
| 338 | GrGLGenBuffersProc fGenBuffers; |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 339 | GrGLGenQueriesProc fGenQueries; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 340 | GrGLGenTexturesProc fGenTextures; |
| 341 | GrGLGetBufferParameterivProc fGetBufferParameteriv; |
| 342 | GrGLGetErrorProc fGetError; |
| 343 | GrGLGetIntegervProc fGetIntegerv; |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 344 | GrGLGetQueryObjecti64vProc fGetQueryObjecti64v; |
| 345 | GrGLGetQueryObjectivProc fGetQueryObjectiv; |
| 346 | GrGLGetQueryObjectui64vProc fGetQueryObjectui64v; |
| 347 | GrGLGetQueryObjectuivProc fGetQueryObjectuiv; |
| 348 | GrGLGetQueryivProc fGetQueryiv; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 349 | GrGLGetProgramInfoLogProc fGetProgramInfoLog; |
| 350 | GrGLGetProgramivProc fGetProgramiv; |
| 351 | GrGLGetShaderInfoLogProc fGetShaderInfoLog; |
| 352 | GrGLGetShaderivProc fGetShaderiv; |
| 353 | GrGLGetStringProc fGetString; |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 354 | GrGLGetTexLevelParameterivProc fGetTexLevelParameteriv; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 355 | GrGLGetUniformLocationProc fGetUniformLocation; |
| 356 | GrGLLineWidthProc fLineWidth; |
| 357 | GrGLLinkProgramProc fLinkProgram; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 358 | GrGLPixelStoreiProc fPixelStorei; |
bsalomon@google.com | 373a663 | 2011-10-19 20:43:20 +0000 | [diff] [blame] | 359 | GrGLQueryCounterProc fQueryCounter; |
bsalomon@google.com | c49d66b | 2011-08-03 14:22:30 +0000 | [diff] [blame] | 360 | GrGLReadBufferProc fReadBuffer; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 361 | GrGLReadPixelsProc fReadPixels; |
| 362 | GrGLScissorProc fScissor; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 363 | GrGLShaderSourceProc fShaderSource; |
| 364 | GrGLStencilFuncProc fStencilFunc; |
| 365 | GrGLStencilFuncSeparateProc fStencilFuncSeparate; |
| 366 | GrGLStencilMaskProc fStencilMask; |
| 367 | GrGLStencilMaskSeparateProc fStencilMaskSeparate; |
| 368 | GrGLStencilOpProc fStencilOp; |
| 369 | GrGLStencilOpSeparateProc fStencilOpSeparate; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 370 | GrGLTexImage2DProc fTexImage2D; |
| 371 | GrGLTexParameteriProc fTexParameteri; |
| 372 | GrGLTexSubImage2DProc fTexSubImage2D; |
bsalomon@google.com | 280e99f | 2012-01-05 16:17:38 +0000 | [diff] [blame] | 373 | GrGLTexStorage2DProc fTexStorage2D; |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 374 | GrGLUniform1fProc fUniform1f; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 375 | GrGLUniform1iProc fUniform1i; |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 376 | GrGLUniform1fvProc fUniform1fv; |
| 377 | GrGLUniform1ivProc fUniform1iv; |
| 378 | GrGLUniform2fProc fUniform2f; |
| 379 | GrGLUniform2iProc fUniform2i; |
| 380 | GrGLUniform2fvProc fUniform2fv; |
| 381 | GrGLUniform2ivProc fUniform2iv; |
| 382 | GrGLUniform3fProc fUniform3f; |
| 383 | GrGLUniform3iProc fUniform3i; |
| 384 | GrGLUniform3fvProc fUniform3fv; |
| 385 | GrGLUniform3ivProc fUniform3iv; |
| 386 | GrGLUniform4fProc fUniform4f; |
| 387 | GrGLUniform4iProc fUniform4i; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 388 | GrGLUniform4fvProc fUniform4fv; |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 389 | GrGLUniform4ivProc fUniform4iv; |
| 390 | GrGLUniformMatrix2fvProc fUniformMatrix2fv; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 391 | GrGLUniformMatrix3fvProc fUniformMatrix3fv; |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 392 | GrGLUniformMatrix4fvProc fUniformMatrix4fv; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 393 | GrGLUseProgramProc fUseProgram; |
| 394 | GrGLVertexAttrib4fvProc fVertexAttrib4fv; |
| 395 | GrGLVertexAttribPointerProc fVertexAttribPointer; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 396 | GrGLViewportProc fViewport; |
| 397 | |
| 398 | // FBO Extension Functions |
| 399 | GrGLBindFramebufferProc fBindFramebuffer; |
| 400 | GrGLBindRenderbufferProc fBindRenderbuffer; |
| 401 | GrGLCheckFramebufferStatusProc fCheckFramebufferStatus; |
| 402 | GrGLDeleteFramebuffersProc fDeleteFramebuffers; |
| 403 | GrGLDeleteRenderbuffersProc fDeleteRenderbuffers; |
| 404 | GrGLFramebufferRenderbufferProc fFramebufferRenderbuffer; |
| 405 | GrGLFramebufferTexture2DProc fFramebufferTexture2D; |
| 406 | GrGLGenFramebuffersProc fGenFramebuffers; |
| 407 | GrGLGenRenderbuffersProc fGenRenderbuffers; |
bsalomon@google.com | cee661a | 2011-07-26 12:32:36 +0000 | [diff] [blame] | 408 | GrGLGetFramebufferAttachmentParameterivProc fGetFramebufferAttachmentParameteriv; |
| 409 | GrGLGetRenderbufferParameterivProc fGetRenderbufferParameteriv; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 410 | GrGLRenderbufferStorageProc fRenderbufferStorage; |
| 411 | |
| 412 | // Multisampling Extension Functions |
| 413 | // same prototype for ARB_FBO, EXT_FBO, GL 3.0, & Apple ES extension |
| 414 | GrGLRenderbufferStorageMultisampleProc fRenderbufferStorageMultisample; |
| 415 | // desktop: ext_fbo_blit, arb_fbo, gl 3.0 |
| 416 | GrGLBlitFramebufferProc fBlitFramebuffer; |
| 417 | // apple's es extension |
| 418 | GrGLResolveMultisampleFramebufferProc fResolveMultisampleFramebuffer; |
| 419 | |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 420 | // Buffer mapping (extension in ES). |
| 421 | GrGLMapBufferProc fMapBuffer; |
| 422 | GrGLUnmapBufferProc fUnmapBuffer; |
bsalomon@google.com | f987d1b | 2011-04-04 17:13:52 +0000 | [diff] [blame] | 423 | |
bsalomon@google.com | 271cffc | 2011-05-20 14:13:56 +0000 | [diff] [blame] | 424 | // Dual Source Blending |
| 425 | GrGLBindFragDataLocationIndexedProc fBindFragDataLocationIndexed; |
| 426 | |
bsalomon@google.com | 56bfc5a | 2011-09-01 13:28:16 +0000 | [diff] [blame] | 427 | // Per-GL func callback |
| 428 | #if GR_GL_PER_GL_FUNC_CALLBACK |
| 429 | GrGLInterfaceCallbackProc fCallback; |
| 430 | GrGLInterfaceCallbackData fCallbackData; |
| 431 | #endif |
| 432 | |
bsalomon@google.com | bf2a469 | 2011-05-04 12:35:39 +0000 | [diff] [blame] | 433 | }; |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame] | 434 | |
| 435 | #endif |