The Android Open Source Project | 7c1b96a | 2008-10-21 07:00:00 -0700 | [diff] [blame^] | 1 | /* |
| 2 | ** Copyright 2007, The Android Open Source Project |
| 3 | ** |
| 4 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | ** you may not use this file except in compliance with the License. |
| 6 | ** You may obtain a copy of the License at |
| 7 | ** |
| 8 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | ** |
| 10 | ** Unless required by applicable law or agreed to in writing, software |
| 11 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | ** See the License for the specific language governing permissions and |
| 14 | ** limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #define LOG_TAG "GLLogger" |
| 18 | |
| 19 | #include <ctype.h> |
| 20 | #include <string.h> |
| 21 | #include <errno.h> |
| 22 | #include <dlfcn.h> |
| 23 | |
| 24 | #include <sys/ioctl.h> |
| 25 | |
| 26 | #include <GLES/egl.h> |
| 27 | |
| 28 | #include <cutils/log.h> |
| 29 | #include <cutils/atomic.h> |
| 30 | #include <cutils/properties.h> |
| 31 | |
| 32 | #include <utils/String8.h> |
| 33 | |
| 34 | #include "gl_logger.h" |
| 35 | |
| 36 | // ---------------------------------------------------------------------------- |
| 37 | namespace android { |
| 38 | // ---------------------------------------------------------------------------- |
| 39 | |
| 40 | #undef NELEM |
| 41 | #define NELEM(x) (sizeof(x)/sizeof(*(x))) |
| 42 | |
| 43 | template<typename T> |
| 44 | static int binarySearch(T const sortedArray[], int first, int last, EGLint key) |
| 45 | { |
| 46 | while (first <= last) { |
| 47 | int mid = (first + last) / 2; |
| 48 | if (key > sortedArray[mid].key) { |
| 49 | first = mid + 1; |
| 50 | } else if (key < sortedArray[mid].key) { |
| 51 | last = mid - 1; |
| 52 | } else { |
| 53 | return mid; |
| 54 | } |
| 55 | } |
| 56 | return -1; |
| 57 | } |
| 58 | |
| 59 | struct pair_t { |
| 60 | const char* name; |
| 61 | int key; |
| 62 | }; |
| 63 | |
| 64 | static const pair_t gEnumMap[] = { |
| 65 | #define GLENUM(NAME, VALUE) { #NAME, VALUE }, |
| 66 | #include "gl_enums.in" |
| 67 | #undef GLENUM |
| 68 | }; |
| 69 | |
| 70 | // ---------------------------------------------------------------------------- |
| 71 | |
| 72 | template<typename TYPE> |
| 73 | class GLLogValue { |
| 74 | public: |
| 75 | GLLogValue(TYPE value) : mValue(value) { } |
| 76 | const TYPE& getValue() const { return mValue; } |
| 77 | String8 toString() const { |
| 78 | return convertToString(mValue); |
| 79 | } |
| 80 | private: |
| 81 | const TYPE& mValue; |
| 82 | String8 convertToString(unsigned int v) const { |
| 83 | char buf[16]; |
| 84 | snprintf(buf, 16, "%u", v); |
| 85 | return String8(buf); |
| 86 | } |
| 87 | String8 convertToString(unsigned long v) const { |
| 88 | char buf[16]; |
| 89 | snprintf(buf, 16, "%lu", v); |
| 90 | return String8(buf); |
| 91 | } |
| 92 | String8 convertToString(int v) const { |
| 93 | char buf[16]; |
| 94 | snprintf(buf, 16, "%d", v); |
| 95 | return String8(buf); |
| 96 | } |
| 97 | String8 convertToString(long v) const { |
| 98 | char buf[16]; |
| 99 | snprintf(buf, 16, "%ld", v); |
| 100 | return String8(buf); |
| 101 | } |
| 102 | String8 convertToString(float v) const { |
| 103 | char buf[16]; |
| 104 | snprintf(buf, 16, "%f", v); |
| 105 | return String8(buf); |
| 106 | } |
| 107 | String8 convertToString(void const* v) const { |
| 108 | char buf[16]; |
| 109 | snprintf(buf, 16, "%p", v); |
| 110 | return String8(buf); |
| 111 | } |
| 112 | }; |
| 113 | |
| 114 | class GLLogEnum : public GLLogValue<GLenum> { |
| 115 | public: |
| 116 | GLLogEnum(GLenum v) : GLLogValue<GLenum>(v) { } |
| 117 | String8 toString() const { |
| 118 | GLenum v = getValue(); |
| 119 | int i = binarySearch<pair_t>(gEnumMap, 0, NELEM(gEnumMap)-1, v); |
| 120 | if (i >= 0) { |
| 121 | return String8(gEnumMap[i].name); |
| 122 | } else { |
| 123 | char buf[16]; |
| 124 | snprintf(buf, 16, "0x%04x", v); |
| 125 | return String8(buf); |
| 126 | } |
| 127 | } |
| 128 | }; |
| 129 | |
| 130 | class GLLogClearBitfield : public GLLogValue<GLbitfield> { |
| 131 | public: |
| 132 | GLLogClearBitfield(GLbitfield v) : GLLogValue<GLbitfield>(v) { } |
| 133 | String8 toString() const { |
| 134 | char buf[16]; |
| 135 | snprintf(buf, 16, "0x%08x", getValue()); |
| 136 | return String8(buf); |
| 137 | } |
| 138 | }; |
| 139 | |
| 140 | class GLLogBool : public GLLogValue<GLboolean> { |
| 141 | public: |
| 142 | GLLogBool(GLboolean v) : GLLogValue<GLboolean>(v) { } |
| 143 | String8 toString() const { |
| 144 | GLboolean v = getValue(); |
| 145 | if (v == GL_TRUE) return String8("GL_TRUE"); |
| 146 | if (v == GL_FALSE) return String8("GL_FALSE"); |
| 147 | return GLLogValue<GLboolean>::toString(); |
| 148 | } |
| 149 | }; |
| 150 | |
| 151 | class GLLogFixed : public GLLogValue<GLfixed> { |
| 152 | public: |
| 153 | GLLogFixed(GLfixed v) : GLLogValue<GLfixed>(v) { } |
| 154 | String8 toString() const { |
| 155 | char buf[16]; |
| 156 | snprintf(buf, 16, "0x%08x", getValue()); |
| 157 | return String8(buf); |
| 158 | } |
| 159 | }; |
| 160 | |
| 161 | |
| 162 | template <typename TYPE> |
| 163 | class GLLogBuffer : public GLLogValue<TYPE *> { |
| 164 | public: |
| 165 | GLLogBuffer(TYPE* buffer, size_t count = -1) |
| 166 | : GLLogValue<TYPE*>(buffer) |
| 167 | { // output buffer |
| 168 | } |
| 169 | GLLogBuffer(TYPE const* buffer, size_t count = -1) |
| 170 | : GLLogValue<TYPE*>(const_cast<TYPE*>(buffer)) |
| 171 | { // input buffer |
| 172 | } |
| 173 | }; |
| 174 | |
| 175 | class GLLog |
| 176 | { |
| 177 | public: |
| 178 | GLLog(const char* name) : mNumParams(0) { |
| 179 | mString.append(name); |
| 180 | mString.append("("); |
| 181 | } |
| 182 | |
| 183 | ~GLLog() { |
| 184 | LOGD("%s);", mString.string()); |
| 185 | } |
| 186 | |
| 187 | GLLog& operator << (unsigned char v) { |
| 188 | return *this << GLLogValue<unsigned int>(v); |
| 189 | } |
| 190 | GLLog& operator << (short v) { |
| 191 | return *this << GLLogValue<unsigned int>(v); |
| 192 | } |
| 193 | GLLog& operator << (unsigned int v) { |
| 194 | return *this << GLLogValue<unsigned int>(v); |
| 195 | } |
| 196 | GLLog& operator << (int v) { |
| 197 | return *this << GLLogValue<int>(v); |
| 198 | } |
| 199 | GLLog& operator << (long v) { |
| 200 | return *this << GLLogValue<long>(v); |
| 201 | } |
| 202 | GLLog& operator << (unsigned long v) { |
| 203 | return *this << GLLogValue<unsigned long>(v); |
| 204 | } |
| 205 | GLLog& operator << (float v) { |
| 206 | return *this << GLLogValue<float>(v); |
| 207 | } |
| 208 | GLLog& operator << (const void* v) { |
| 209 | return *this << GLLogValue<const void* >(v); |
| 210 | } |
| 211 | |
| 212 | template <typename TYPE> |
| 213 | GLLog& operator << (const TYPE& rhs) { |
| 214 | if (mNumParams > 0) |
| 215 | mString.append(", "); |
| 216 | mString.append(rhs.toString()); |
| 217 | mNumParams++; |
| 218 | return *this; |
| 219 | } |
| 220 | |
| 221 | const String8& string() const { return mString; } |
| 222 | private: |
| 223 | GLLog(const GLLog&); |
| 224 | |
| 225 | String8 mString; |
| 226 | int mNumParams; |
| 227 | }; |
| 228 | |
| 229 | // ---------------------------------------------------------------------------- |
| 230 | }; // namespace android |
| 231 | // ---------------------------------------------------------------------------- |
| 232 | |
| 233 | using namespace android; |
| 234 | |
| 235 | #define API_ENTRY(api) log_##api |
| 236 | #define CALL_GL_API(_x, ...) |
| 237 | #define CALL_GL_API_RETURN(_x, ...) return(0); |
| 238 | |
| 239 | void API_ENTRY(glActiveTexture)(GLenum texture) { |
| 240 | CALL_GL_API(glActiveTexture, texture); |
| 241 | GLLog("glActiveTexture") << GLLogEnum(texture); |
| 242 | } |
| 243 | |
| 244 | void API_ENTRY(glAlphaFunc)(GLenum func, GLclampf ref) { |
| 245 | CALL_GL_API(glAlphaFunc, func, ref); |
| 246 | GLLog("glAlphaFunc") << GLLogEnum(func) << ref; |
| 247 | } |
| 248 | |
| 249 | void API_ENTRY(glAlphaFuncx)(GLenum func, GLclampx ref) { |
| 250 | CALL_GL_API(glAlphaFuncx, func, ref); |
| 251 | GLLog("glAlphaFuncx") << GLLogEnum(func) << GLLogFixed(ref); |
| 252 | } |
| 253 | |
| 254 | void API_ENTRY(glBindTexture)(GLenum target, GLuint texture) { |
| 255 | CALL_GL_API(glBindTexture, target, texture); |
| 256 | GLLog("glBindTexture") << GLLogEnum(target) << texture; |
| 257 | } |
| 258 | |
| 259 | void API_ENTRY(glBlendFunc)(GLenum sfactor, GLenum dfactor) { |
| 260 | CALL_GL_API(glBlendFunc, sfactor, dfactor); |
| 261 | GLLog("glBlendFunc") << GLLogEnum(sfactor) << GLLogEnum(dfactor); |
| 262 | } |
| 263 | |
| 264 | void API_ENTRY(glClear)(GLbitfield mask) { |
| 265 | CALL_GL_API(glClear, mask); |
| 266 | GLLog("glClear") << GLLogClearBitfield(mask); |
| 267 | } |
| 268 | |
| 269 | void API_ENTRY(glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { |
| 270 | CALL_GL_API(glClearColor, red, green, blue, alpha); |
| 271 | GLLog("glClearColor") << red << green << blue << alpha; |
| 272 | } |
| 273 | |
| 274 | void API_ENTRY(glClearColorx)(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) { |
| 275 | CALL_GL_API(glClearColorx, red, green, blue, alpha); |
| 276 | GLLog("glClearColorx") << GLLogFixed(red) << GLLogFixed(green) << GLLogFixed(blue) << GLLogFixed(alpha); |
| 277 | } |
| 278 | |
| 279 | void API_ENTRY(glClearDepthf)(GLclampf depth) { |
| 280 | CALL_GL_API(glClearDepthf, depth); |
| 281 | GLLog("glClearDepthf") << depth; |
| 282 | } |
| 283 | |
| 284 | void API_ENTRY(glClearDepthx)(GLclampx depth) { |
| 285 | CALL_GL_API(glClearDepthx, depth); |
| 286 | GLLog("glClearDepthx") << GLLogFixed(depth); |
| 287 | } |
| 288 | |
| 289 | void API_ENTRY(glClearStencil)(GLint s) { |
| 290 | CALL_GL_API(glClearStencil, s); |
| 291 | GLLog("glClearStencil") << s; |
| 292 | } |
| 293 | |
| 294 | void API_ENTRY(glClientActiveTexture)(GLenum texture) { |
| 295 | CALL_GL_API(glClientActiveTexture, texture); |
| 296 | GLLog("glClientActiveTexture") << GLLogEnum(texture); |
| 297 | } |
| 298 | |
| 299 | void API_ENTRY(glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { |
| 300 | CALL_GL_API(glColor4f, red, green, blue, alpha); |
| 301 | GLLog("glColor4f") << red << green << blue << alpha; |
| 302 | } |
| 303 | |
| 304 | void API_ENTRY(glColor4x)(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) { |
| 305 | CALL_GL_API(glColor4x, red, green, blue, alpha); |
| 306 | GLLog("glColor4x") << GLLogFixed(red) << GLLogFixed(green) << GLLogFixed(blue) << GLLogFixed(alpha); |
| 307 | } |
| 308 | |
| 309 | void API_ENTRY(glColorMask)(GLboolean r, GLboolean g, GLboolean b, GLboolean a) { |
| 310 | CALL_GL_API(glColorMask, r, g, b, a); |
| 311 | GLLog("glColorMask") << GLLogBool(r) << GLLogBool(g) << GLLogBool(b) << GLLogBool(a); |
| 312 | } |
| 313 | |
| 314 | void API_ENTRY(glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) |
| 315 | { |
| 316 | CALL_GL_API(glColorPointer, size, type, stride, ptr); |
| 317 | GLLog("glColorPointer") << size << GLLogEnum(type) << stride << ptr; |
| 318 | } |
| 319 | |
| 320 | void API_ENTRY(glCompressedTexImage2D)(GLenum target, GLint level, GLenum internalformat, |
| 321 | GLsizei width, GLsizei height, GLint border, |
| 322 | GLsizei imageSize, const GLvoid *data) { |
| 323 | CALL_GL_API(glCompressedTexImage2D, target, level, internalformat, |
| 324 | width, height, border, imageSize, data); |
| 325 | GLLog("glCompressedTexImage2D") |
| 326 | << GLLogEnum(target) << level << GLLogEnum(internalformat) |
| 327 | << width << height << border << imageSize << data; |
| 328 | } |
| 329 | |
| 330 | void API_ENTRY(glCompressedTexSubImage2D)( GLenum target, GLint level, GLint xoffset, |
| 331 | GLint yoffset, GLsizei width, GLsizei height, |
| 332 | GLenum format, GLsizei imageSize, |
| 333 | const GLvoid *data) { |
| 334 | CALL_GL_API(glCompressedTexSubImage2D, target, level, xoffset, yoffset, |
| 335 | width, height, format, imageSize, data); |
| 336 | GLLog("glCompressedTexSubImage2D") |
| 337 | << GLLogEnum(target) << level << xoffset << yoffset |
| 338 | << width << height << GLLogEnum(format) << imageSize << data; |
| 339 | } |
| 340 | |
| 341 | void API_ENTRY(glCopyTexImage2D)( GLenum target, GLint level, GLenum internalformat, |
| 342 | GLint x, GLint y, GLsizei width, GLsizei height, |
| 343 | GLint border) { |
| 344 | CALL_GL_API(glCopyTexImage2D, target, level, internalformat, x, y, |
| 345 | width, height, border); |
| 346 | GLLog("glCopyTexImage2D") |
| 347 | << GLLogEnum(target) << level << GLLogEnum(internalformat) |
| 348 | << x << y << width << height << border; |
| 349 | } |
| 350 | |
| 351 | void API_ENTRY(glCopyTexSubImage2D)( GLenum target, GLint level, GLint xoffset, |
| 352 | GLint yoffset, GLint x, GLint y, GLsizei width, |
| 353 | GLsizei height) { |
| 354 | CALL_GL_API(glCopyTexSubImage2D, target, level, xoffset, yoffset, x, y, |
| 355 | width, height); |
| 356 | GLLog("glCopyTexSubImage2D") |
| 357 | << GLLogEnum(target) << level << xoffset << yoffset |
| 358 | << x << y << width << height; |
| 359 | } |
| 360 | |
| 361 | void API_ENTRY(glCullFace)(GLenum mode) { |
| 362 | CALL_GL_API(glCullFace, mode); |
| 363 | GLLog("glCullFace") << GLLogEnum(mode); |
| 364 | } |
| 365 | |
| 366 | void API_ENTRY(glDeleteTextures)(GLsizei n, const GLuint *textures) { |
| 367 | CALL_GL_API(glDeleteTextures, n, textures); |
| 368 | GLLog("glDeleteTextures") << n << GLLogBuffer<GLuint>(textures, n); |
| 369 | } |
| 370 | |
| 371 | void API_ENTRY(glDepthFunc)(GLenum func) { |
| 372 | CALL_GL_API(glDepthFunc, func); |
| 373 | GLLog("glDepthFunc") << GLLogEnum(func); |
| 374 | } |
| 375 | |
| 376 | void API_ENTRY(glDepthMask)(GLboolean flag) { |
| 377 | CALL_GL_API(glDepthMask, flag); |
| 378 | GLLog("glDepthMask") << GLLogBool(flag); |
| 379 | } |
| 380 | |
| 381 | void API_ENTRY(glDepthRangef)(GLclampf zNear, GLclampf zFar) { |
| 382 | CALL_GL_API(glDepthRangef, zNear, zFar); |
| 383 | GLLog("glDepthRangef") << zNear << zFar; |
| 384 | } |
| 385 | |
| 386 | void API_ENTRY(glDepthRangex)(GLclampx zNear, GLclampx zFar) { |
| 387 | CALL_GL_API(glDepthRangex, zNear, zFar); |
| 388 | GLLog("glDepthRangex") << GLLogFixed(zNear) << GLLogFixed(zFar); |
| 389 | } |
| 390 | |
| 391 | void API_ENTRY(glDisable)(GLenum cap) { |
| 392 | CALL_GL_API(glDisable, cap); |
| 393 | GLLog("glDisable") << GLLogEnum(cap); |
| 394 | } |
| 395 | |
| 396 | void API_ENTRY(glDisableClientState)(GLenum array) { |
| 397 | CALL_GL_API(glDisableClientState, array); |
| 398 | GLLog("glDisableClientState") << GLLogEnum(array); |
| 399 | } |
| 400 | |
| 401 | void API_ENTRY(glDrawArrays)(GLenum mode, GLint first, GLsizei count) { |
| 402 | CALL_GL_API(glDrawArrays, mode, first, count); |
| 403 | GLLog("glDrawArrays") << GLLogEnum(mode) << first << count; |
| 404 | } |
| 405 | |
| 406 | void API_ENTRY(glDrawElements)(GLenum mode, GLsizei count, |
| 407 | GLenum type, const GLvoid *indices) { |
| 408 | CALL_GL_API(glDrawElements, mode, count, type, indices); |
| 409 | GLLog log("glDrawElements"); |
| 410 | log << GLLogEnum(mode) << count << GLLogEnum(type); |
| 411 | if (type == GL_UNSIGNED_BYTE) { |
| 412 | log << GLLogBuffer<GLubyte>(static_cast<const GLubyte*>(indices), count); |
| 413 | } else { |
| 414 | log << GLLogBuffer<GLushort>(static_cast<const GLushort*>(indices), count); |
| 415 | } |
| 416 | log; |
| 417 | } |
| 418 | |
| 419 | void API_ENTRY(glEnable)(GLenum cap) { |
| 420 | CALL_GL_API(glEnable, cap); |
| 421 | GLLog("glEnable") << GLLogEnum(cap); |
| 422 | } |
| 423 | |
| 424 | void API_ENTRY(glEnableClientState)(GLenum array) { |
| 425 | CALL_GL_API(glEnableClientState, array); |
| 426 | GLLog("glEnableClientState") << GLLogEnum(array); |
| 427 | } |
| 428 | |
| 429 | void API_ENTRY(glFinish)(void) { |
| 430 | CALL_GL_API(glFinish); |
| 431 | GLLog("glFinish"); |
| 432 | } |
| 433 | |
| 434 | void API_ENTRY(glFlush)(void) { |
| 435 | CALL_GL_API(glFlush); |
| 436 | GLLog("glFlush"); |
| 437 | } |
| 438 | |
| 439 | void API_ENTRY(glFogf)(GLenum pname, GLfloat param) { |
| 440 | CALL_GL_API(glFogf, pname, param); |
| 441 | GLLog("glFogf") << GLLogEnum(pname) << param; |
| 442 | } |
| 443 | |
| 444 | void API_ENTRY(glFogfv)(GLenum pname, const GLfloat *params) { |
| 445 | CALL_GL_API(glFogfv, pname, params); |
| 446 | // XXX: we need to compute the size of this buffer |
| 447 | GLLog("glFogfv") << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 448 | } |
| 449 | |
| 450 | void API_ENTRY(glFogx)(GLenum pname, GLfixed param) { |
| 451 | CALL_GL_API(glFogx, pname, param); |
| 452 | GLLog("glFogx") << GLLogEnum(pname) << GLLogFixed(param); |
| 453 | } |
| 454 | |
| 455 | void API_ENTRY(glFogxv)(GLenum pname, const GLfixed *params) { |
| 456 | CALL_GL_API(glFogxv, pname, params); |
| 457 | // XXX: we need to compute the size of this buffer |
| 458 | GLLog("glFogfx") << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 459 | } |
| 460 | |
| 461 | void API_ENTRY(glFrontFace)(GLenum mode) { |
| 462 | CALL_GL_API(glFrontFace, mode); |
| 463 | GLLog("glFrontFace") << GLLogEnum(mode); |
| 464 | } |
| 465 | |
| 466 | void API_ENTRY(glFrustumf)(GLfloat left, GLfloat right, |
| 467 | GLfloat bottom, GLfloat top, |
| 468 | GLfloat zNear, GLfloat zFar) { |
| 469 | CALL_GL_API(glFrustumf, left, right, bottom, top, zNear, zFar); |
| 470 | GLLog("glFrustumf") << left << right << bottom << top << zNear << zFar; |
| 471 | } |
| 472 | |
| 473 | void API_ENTRY(glFrustumx)(GLfixed left, GLfixed right, |
| 474 | GLfixed bottom, GLfixed top, |
| 475 | GLfixed zNear, GLfixed zFar) { |
| 476 | CALL_GL_API(glFrustumx, left, right, bottom, top, zNear, zFar); |
| 477 | GLLog("glFrustumx") |
| 478 | << GLLogFixed(left) << GLLogFixed(right) |
| 479 | << GLLogFixed(bottom) << GLLogFixed(top) |
| 480 | << GLLogFixed(zNear) << GLLogFixed(zFar); |
| 481 | } |
| 482 | |
| 483 | void API_ENTRY(glGenTextures)(GLsizei n, GLuint *textures) { |
| 484 | CALL_GL_API(glGenTextures, n, textures); |
| 485 | GLLog("glGenTextures") << n << GLLogBuffer<GLuint>(textures, n); |
| 486 | } |
| 487 | |
| 488 | GLenum API_ENTRY(glGetError)(void) { |
| 489 | GLLog("glGetError"); |
| 490 | CALL_GL_API_RETURN(glGetError); |
| 491 | } |
| 492 | |
| 493 | void API_ENTRY(glGetIntegerv)(GLenum pname, GLint *params) { |
| 494 | CALL_GL_API(glGetIntegerv, pname, params); |
| 495 | // XXX: we need to compute the size of this buffer |
| 496 | GLLog("glGetIntegerv") << GLLogEnum(pname) << GLLogBuffer<GLint>(params); |
| 497 | } |
| 498 | |
| 499 | const GLubyte * API_ENTRY(glGetString)(GLenum name) { |
| 500 | GLLog("glGetString") << GLLogEnum(name); |
| 501 | CALL_GL_API_RETURN(glGetString, name); |
| 502 | } |
| 503 | |
| 504 | void API_ENTRY(glHint)(GLenum target, GLenum mode) { |
| 505 | CALL_GL_API(glHint, target, mode); |
| 506 | GLLog("GLenum") << GLLogEnum(target) << GLLogEnum(mode); |
| 507 | } |
| 508 | |
| 509 | void API_ENTRY(glLightModelf)(GLenum pname, GLfloat param) { |
| 510 | CALL_GL_API(glLightModelf, pname, param); |
| 511 | GLLog("glLightModelf") << GLLogEnum(pname) << param; |
| 512 | } |
| 513 | |
| 514 | void API_ENTRY(glLightModelfv)(GLenum pname, const GLfloat *params) { |
| 515 | CALL_GL_API(glLightModelfv, pname, params); |
| 516 | // XXX: we need to compute the size of this buffer |
| 517 | GLLog("glLightModelfv") << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 518 | } |
| 519 | |
| 520 | void API_ENTRY(glLightModelx)(GLenum pname, GLfixed param) { |
| 521 | CALL_GL_API(glLightModelx, pname, param); |
| 522 | GLLog("glLightModelx") << GLLogEnum(pname) << GLLogFixed(param); |
| 523 | } |
| 524 | |
| 525 | void API_ENTRY(glLightModelxv)(GLenum pname, const GLfixed *params) { |
| 526 | CALL_GL_API(glLightModelxv, pname, params); |
| 527 | // XXX: we need to compute the size of this buffer |
| 528 | GLLog("glLightModelxv") << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 529 | } |
| 530 | |
| 531 | void API_ENTRY(glLightf)(GLenum light, GLenum pname, GLfloat param) { |
| 532 | CALL_GL_API(glLightf, light, pname, param); |
| 533 | GLLog("glLightf") << GLLogEnum(light) << GLLogEnum(pname) << param; |
| 534 | } |
| 535 | |
| 536 | void API_ENTRY(glLightfv)(GLenum light, GLenum pname, const GLfloat *params) { |
| 537 | CALL_GL_API(glLightfv, light, pname, params); |
| 538 | // XXX: we need to compute the size of this buffer |
| 539 | GLLog("glLightfv") << GLLogEnum(light) << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 540 | } |
| 541 | |
| 542 | void API_ENTRY(glLightx)(GLenum light, GLenum pname, GLfixed param) { |
| 543 | CALL_GL_API(glLightx, light, pname, param); |
| 544 | GLLog("glLightx") << GLLogEnum(light) << GLLogEnum(pname) << GLLogFixed(param); |
| 545 | } |
| 546 | |
| 547 | void API_ENTRY(glLightxv)(GLenum light, GLenum pname, const GLfixed *params) { |
| 548 | CALL_GL_API(glLightxv, light, pname, params); |
| 549 | // XXX: we need to compute the size of this buffer |
| 550 | GLLog("glLightxv") << GLLogEnum(light) << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 551 | } |
| 552 | |
| 553 | void API_ENTRY(glLineWidth)(GLfloat width) { |
| 554 | CALL_GL_API(glLineWidth, width); |
| 555 | GLLog("glLineWidth") << width; |
| 556 | } |
| 557 | |
| 558 | void API_ENTRY(glLineWidthx)(GLfixed width) { |
| 559 | CALL_GL_API(glLineWidthx, width); |
| 560 | GLLog("glLineWidth") << GLLogFixed(width); |
| 561 | } |
| 562 | |
| 563 | void API_ENTRY(glLoadIdentity)(void) { |
| 564 | CALL_GL_API(glLoadIdentity); |
| 565 | GLLog("glLoadIdentity"); |
| 566 | } |
| 567 | |
| 568 | void API_ENTRY(glLoadMatrixf)(const GLfloat *m) { |
| 569 | CALL_GL_API(glLoadMatrixf, m); |
| 570 | GLLog("glLoadMatrixf") << GLLogBuffer<GLfloat>(m, 16); |
| 571 | } |
| 572 | |
| 573 | void API_ENTRY(glLoadMatrixx)(const GLfixed *m) { |
| 574 | CALL_GL_API(glLoadMatrixx, m); |
| 575 | GLLog("glLoadMatrixx") << GLLogBuffer<GLfixed>(m, 16); |
| 576 | } |
| 577 | |
| 578 | void API_ENTRY(glLogicOp)(GLenum opcode) { |
| 579 | CALL_GL_API(glLogicOp, opcode); |
| 580 | GLLog("glLogicOp") << GLLogEnum(opcode); |
| 581 | } |
| 582 | |
| 583 | void API_ENTRY(glMaterialf)(GLenum face, GLenum pname, GLfloat param) { |
| 584 | CALL_GL_API(glMaterialf, face, pname, param); |
| 585 | GLLog("glMaterialf") << GLLogEnum(face) << GLLogEnum(pname) << param; |
| 586 | } |
| 587 | |
| 588 | void API_ENTRY(glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params) { |
| 589 | CALL_GL_API(glMaterialfv, face, pname, params); |
| 590 | // XXX: we need to compute the size of this buffer |
| 591 | GLLog("glMaterialfv") << GLLogEnum(face) << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 592 | } |
| 593 | |
| 594 | void API_ENTRY(glMaterialx)(GLenum face, GLenum pname, GLfixed param) { |
| 595 | CALL_GL_API(glMaterialx, face, pname, param); |
| 596 | GLLog("glMaterialx") << GLLogEnum(face) << GLLogEnum(pname) << GLLogFixed(param); |
| 597 | } |
| 598 | |
| 599 | void API_ENTRY(glMaterialxv)(GLenum face, GLenum pname, const GLfixed *params) { |
| 600 | CALL_GL_API(glMaterialxv, face, pname, params); |
| 601 | // XXX: we need to compute the size of this buffer |
| 602 | GLLog("glMaterialxv") << GLLogEnum(face) << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 603 | } |
| 604 | |
| 605 | void API_ENTRY(glMatrixMode)(GLenum mode) { |
| 606 | CALL_GL_API(glMatrixMode, mode); |
| 607 | GLLog("glMatrixMode") << GLLogEnum(mode); |
| 608 | } |
| 609 | |
| 610 | void API_ENTRY(glMultMatrixf)(const GLfloat *m) { |
| 611 | CALL_GL_API(glMultMatrixf, m); |
| 612 | GLLog("glMultMatrixf") << GLLogBuffer<GLfloat>(m, 16); |
| 613 | } |
| 614 | |
| 615 | void API_ENTRY(glMultMatrixx)(const GLfixed *m) { |
| 616 | CALL_GL_API(glMultMatrixx, m); |
| 617 | GLLog("glMultMatrixx") << GLLogBuffer<GLfixed>(m, 16); |
| 618 | } |
| 619 | |
| 620 | void API_ENTRY(glMultiTexCoord4f)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) { |
| 621 | CALL_GL_API(glMultiTexCoord4f, target, s, t, r, q); |
| 622 | GLLog("glMultiTexCoord4f") << GLLogEnum(target) << s << t << r << q; |
| 623 | } |
| 624 | |
| 625 | void API_ENTRY(glMultiTexCoord4x)(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) { |
| 626 | CALL_GL_API(glMultiTexCoord4x, target, s, t, r, q); |
| 627 | GLLog("glMultiTexCoord4x") << GLLogEnum(target) |
| 628 | << GLLogFixed(s) << GLLogFixed(t) << GLLogFixed(r) << GLLogFixed(q); |
| 629 | } |
| 630 | |
| 631 | void API_ENTRY(glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz) { |
| 632 | CALL_GL_API(glNormal3f, nx, ny, nz); |
| 633 | GLLog("glNormal3f") << nx << ny << nz; |
| 634 | } |
| 635 | |
| 636 | void API_ENTRY(glNormal3x)(GLfixed nx, GLfixed ny, GLfixed nz) { |
| 637 | CALL_GL_API(glNormal3x, nx, ny, nz); |
| 638 | GLLog("glNormal3x") << GLLogFixed(nx) << GLLogFixed(ny) << GLLogFixed(nz); |
| 639 | } |
| 640 | |
| 641 | void API_ENTRY(glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer) { |
| 642 | CALL_GL_API(glNormalPointer, type, stride, pointer); |
| 643 | GLLog("glNormalPointer") << GLLogEnum(type) << stride << pointer; |
| 644 | } |
| 645 | |
| 646 | void API_ENTRY(glOrthof)( GLfloat left, GLfloat right, |
| 647 | GLfloat bottom, GLfloat top, |
| 648 | GLfloat zNear, GLfloat zFar) { |
| 649 | CALL_GL_API(glOrthof, left, right, bottom, top, zNear, zFar); |
| 650 | GLLog("glOrthof") << left << right << bottom << top << zNear << zFar; |
| 651 | } |
| 652 | |
| 653 | void API_ENTRY(glOrthox)( GLfixed left, GLfixed right, |
| 654 | GLfixed bottom, GLfixed top, |
| 655 | GLfixed zNear, GLfixed zFar) { |
| 656 | CALL_GL_API(glOrthox, left, right, bottom, top, zNear, zFar); |
| 657 | GLLog("glOrthox") << GLLogFixed(left) << GLLogFixed(right) |
| 658 | << GLLogFixed(bottom) << GLLogFixed(top) |
| 659 | << GLLogFixed(zNear) << GLLogFixed(zFar); |
| 660 | } |
| 661 | |
| 662 | void API_ENTRY(glPixelStorei)(GLenum pname, GLint param) { |
| 663 | CALL_GL_API(glPixelStorei, pname, param); |
| 664 | GLLog("glPixelStorei") << GLLogEnum(pname) << param; |
| 665 | } |
| 666 | |
| 667 | void API_ENTRY(glPointSize)(GLfloat size) { |
| 668 | CALL_GL_API(glPointSize, size); |
| 669 | GLLog("glPointSize") << size; |
| 670 | } |
| 671 | |
| 672 | void API_ENTRY(glPointSizex)(GLfixed size) { |
| 673 | CALL_GL_API(glPointSizex, size); |
| 674 | GLLog("glPointSizex") << GLLogFixed(size); |
| 675 | } |
| 676 | |
| 677 | void API_ENTRY(glPolygonOffset)(GLfloat factor, GLfloat units) { |
| 678 | CALL_GL_API(glPolygonOffset, factor, units); |
| 679 | GLLog("glPolygonOffset") << factor << units; |
| 680 | } |
| 681 | |
| 682 | void API_ENTRY(glPolygonOffsetx)(GLfixed factor, GLfixed units) { |
| 683 | CALL_GL_API(glPolygonOffsetx, factor, units); |
| 684 | GLLog("glPolygonOffsetx") << GLLogFixed(factor) << GLLogFixed(units); |
| 685 | } |
| 686 | |
| 687 | void API_ENTRY(glPopMatrix)(void) { |
| 688 | CALL_GL_API(glPopMatrix); |
| 689 | GLLog("glPopMatrix"); |
| 690 | } |
| 691 | |
| 692 | void API_ENTRY(glPushMatrix)(void) { |
| 693 | CALL_GL_API(glPushMatrix); |
| 694 | GLLog("glPushMatrix"); |
| 695 | } |
| 696 | |
| 697 | void API_ENTRY(glReadPixels)( GLint x, GLint y, GLsizei width, GLsizei height, |
| 698 | GLenum format, GLenum type, GLvoid *pixels) { |
| 699 | CALL_GL_API(glReadPixels, x, y, width, height, format, type, pixels); |
| 700 | // XXX: we need to compute the size of this buffer |
| 701 | GLLog("glReadPixels") << x << y << width << height << GLLogEnum(format) << GLLogEnum(type) |
| 702 | << GLLogBuffer<unsigned char>(static_cast<unsigned char *>(pixels)); |
| 703 | } |
| 704 | |
| 705 | void API_ENTRY(glRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { |
| 706 | CALL_GL_API(glRotatef, angle, x, y, z); |
| 707 | GLLog("glRotatef") << angle << x << y << z; |
| 708 | } |
| 709 | |
| 710 | void API_ENTRY(glRotatex)(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) { |
| 711 | CALL_GL_API(glRotatex, angle, x, y, z); |
| 712 | GLLog("glRotatex") << GLLogFixed(angle) << GLLogFixed(x) << GLLogFixed(y) << GLLogFixed(z); |
| 713 | } |
| 714 | |
| 715 | void API_ENTRY(glSampleCoverage)(GLclampf value, GLboolean invert) { |
| 716 | CALL_GL_API(glSampleCoverage, value, invert); |
| 717 | GLLog("glSampleCoverage") << value << GLLogBool(invert); |
| 718 | } |
| 719 | |
| 720 | void API_ENTRY(glSampleCoveragex)(GLclampx value, GLboolean invert) { |
| 721 | CALL_GL_API(glSampleCoveragex, value, invert); |
| 722 | GLLog("glSampleCoveragex") << GLLogFixed(value) << GLLogBool(invert); |
| 723 | } |
| 724 | |
| 725 | void API_ENTRY(glScalef)(GLfloat x, GLfloat y, GLfloat z) { |
| 726 | CALL_GL_API(glScalef, x, y, z); |
| 727 | GLLog("glScalef") << x << y << z; |
| 728 | } |
| 729 | |
| 730 | void API_ENTRY(glScalex)(GLfixed x, GLfixed y, GLfixed z) { |
| 731 | CALL_GL_API(glScalex, x, y, z); |
| 732 | GLLog("glScalex") << GLLogFixed(x) << GLLogFixed(y) << GLLogFixed(z); |
| 733 | } |
| 734 | |
| 735 | void API_ENTRY(glScissor)(GLint x, GLint y, GLsizei width, GLsizei height) { |
| 736 | CALL_GL_API(glScissor, x, y, width, height); |
| 737 | GLLog("glScissor") << x << y << width << height; |
| 738 | } |
| 739 | |
| 740 | void API_ENTRY(glShadeModel)(GLenum mode) { |
| 741 | CALL_GL_API(glShadeModel, mode); |
| 742 | GLLog("glShadeModel") << GLLogEnum(mode); |
| 743 | } |
| 744 | |
| 745 | void API_ENTRY(glStencilFunc)(GLenum func, GLint ref, GLuint mask) { |
| 746 | CALL_GL_API(glStencilFunc, func, ref, mask); |
| 747 | GLLog("glStencilFunc") << GLLogEnum(func) << ref << mask; |
| 748 | } |
| 749 | |
| 750 | void API_ENTRY(glStencilMask)(GLuint mask) { |
| 751 | CALL_GL_API(glStencilMask, mask); |
| 752 | GLLog("glStencilMask") << mask; |
| 753 | } |
| 754 | |
| 755 | void API_ENTRY(glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass) { |
| 756 | CALL_GL_API(glStencilOp, fail, zfail, zpass); |
| 757 | GLLog("glStencilOp") << GLLogEnum(fail) << GLLogEnum(zfail) << GLLogEnum(zpass); |
| 758 | } |
| 759 | |
| 760 | void API_ENTRY(glTexCoordPointer)( GLint size, GLenum type, |
| 761 | GLsizei stride, const GLvoid *pointer) { |
| 762 | CALL_GL_API(glTexCoordPointer, size, type, stride, pointer); |
| 763 | GLLog("glTexCoordPointer") << size << GLLogEnum(type) << stride << pointer; |
| 764 | } |
| 765 | |
| 766 | void API_ENTRY(glTexEnvf)(GLenum target, GLenum pname, GLfloat param) { |
| 767 | CALL_GL_API(glTexEnvf, target, pname, param); |
| 768 | GLLog("glTexEnvf") << GLLogEnum(target) << GLLogEnum(pname) << param; |
| 769 | } |
| 770 | |
| 771 | void API_ENTRY(glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params) { |
| 772 | CALL_GL_API(glTexEnvfv, target, pname, params); |
| 773 | // XXX: we need to compute the size of this buffer |
| 774 | GLLog("glTexEnvx") << GLLogEnum(target) << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 775 | } |
| 776 | |
| 777 | void API_ENTRY(glTexEnvx)(GLenum target, GLenum pname, GLfixed param) { |
| 778 | CALL_GL_API(glTexEnvx, target, pname, param); |
| 779 | GLLog("glTexEnvx") << GLLogEnum(target) << GLLogEnum(pname) << GLLogFixed(param); |
| 780 | } |
| 781 | |
| 782 | void API_ENTRY(glTexEnvxv)(GLenum target, GLenum pname, const GLfixed *params) { |
| 783 | CALL_GL_API(glTexEnvxv, target, pname, params); |
| 784 | // XXX: we need to compute the size of this buffer |
| 785 | GLLog("glTexEnvxv") << GLLogEnum(target) << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 786 | } |
| 787 | |
| 788 | void API_ENTRY(glTexImage2D)( GLenum target, GLint level, GLenum internalformat, |
| 789 | GLsizei width, GLsizei height, GLint border, GLenum format, |
| 790 | GLenum type, const GLvoid *pixels) { |
| 791 | CALL_GL_API(glTexImage2D, target, level, internalformat, width, height, |
| 792 | border, format, type, pixels); |
| 793 | GLLog("glTexImage2D") << GLLogEnum(target) << level << GLLogEnum(internalformat) |
| 794 | << width << height << border << GLLogEnum(format) << GLLogEnum(type) |
| 795 | << GLLogBuffer<unsigned char>( static_cast<const unsigned char *>(pixels)); |
| 796 | } |
| 797 | |
| 798 | void API_ENTRY(glTexParameterf)(GLenum target, GLenum pname, GLfloat param) { |
| 799 | CALL_GL_API(glTexParameterf, target, pname, param); |
| 800 | GLLog("glTexParameterf") << GLLogEnum(target) << GLLogEnum(pname) << param; |
| 801 | } |
| 802 | |
| 803 | void API_ENTRY(glTexParameterx)(GLenum target, GLenum pname, GLfixed param) { |
| 804 | CALL_GL_API(glTexParameterx, target, pname, param); |
| 805 | GLLog("glTexParameterx") << GLLogEnum(target) << GLLogEnum(pname) << GLLogFixed(param); |
| 806 | } |
| 807 | |
| 808 | void API_ENTRY(glTexSubImage2D)( GLenum target, GLint level, GLint xoffset, |
| 809 | GLint yoffset, GLsizei width, GLsizei height, |
| 810 | GLenum format, GLenum type, const GLvoid *pixels) { |
| 811 | CALL_GL_API(glTexSubImage2D, target, level, xoffset, yoffset, |
| 812 | width, height, format, type, pixels); |
| 813 | GLLog("glTexSubImage2D") << GLLogEnum(target) << level << xoffset << yoffset |
| 814 | << width << height << GLLogEnum(format) << GLLogEnum(type) |
| 815 | << GLLogBuffer<unsigned char>( static_cast<const unsigned char *>(pixels)); |
| 816 | } |
| 817 | |
| 818 | void API_ENTRY(glTranslatef)(GLfloat x, GLfloat y, GLfloat z) { |
| 819 | CALL_GL_API(glTranslatef, x, y, z); |
| 820 | GLLog("glTranslatef") << x << y << z; |
| 821 | } |
| 822 | |
| 823 | void API_ENTRY(glTranslatex)(GLfixed x, GLfixed y, GLfixed z) { |
| 824 | CALL_GL_API(glTranslatex, x, y, z); |
| 825 | GLLog("glTranslatex") << GLLogFixed(x) << GLLogFixed(y) << GLLogFixed(z); |
| 826 | } |
| 827 | |
| 828 | void API_ENTRY(glVertexPointer)( GLint size, GLenum type, |
| 829 | GLsizei stride, const GLvoid *pointer) { |
| 830 | CALL_GL_API(glVertexPointer, size, type, stride, pointer); |
| 831 | GLLog("glVertexPointer") << size << GLLogEnum(type) << stride << pointer; |
| 832 | } |
| 833 | |
| 834 | void API_ENTRY(glViewport)(GLint x, GLint y, GLsizei width, GLsizei height) { |
| 835 | CALL_GL_API(glViewport, x, y, width, height); |
| 836 | GLLog("glViewport") << x << y << width << height; |
| 837 | } |
| 838 | |
| 839 | // ES 1.1 |
| 840 | void API_ENTRY(glClipPlanef)(GLenum plane, const GLfloat *equation) { |
| 841 | CALL_GL_API(glClipPlanef, plane, equation); |
| 842 | GLLog("glClipPlanef") << GLLogEnum(plane) << GLLogBuffer<GLfloat>(equation, 4); |
| 843 | } |
| 844 | void API_ENTRY(glClipPlanex)(GLenum plane, const GLfixed *equation) { |
| 845 | CALL_GL_API(glClipPlanex, plane, equation); |
| 846 | GLLog("glClipPlanex") << GLLogEnum(plane) << GLLogBuffer<GLfixed>(equation, 4); |
| 847 | } |
| 848 | void API_ENTRY(glBindBuffer)(GLenum target, GLuint buffer) { |
| 849 | CALL_GL_API(glBindBuffer, target, buffer); |
| 850 | GLLog("glBindBuffer") << GLLogEnum(target) << buffer; |
| 851 | } |
| 852 | void API_ENTRY(glBufferData)(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) { |
| 853 | CALL_GL_API(glBufferData, target, size, data, usage); |
| 854 | GLLog("glBufferData") << GLLogEnum(target) << size |
| 855 | << GLLogBuffer<unsigned char>(static_cast<const unsigned char*>(data), size); |
| 856 | } |
| 857 | void API_ENTRY(glBufferSubData)(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data) { |
| 858 | CALL_GL_API(glBufferSubData, target, offset, size, data); |
| 859 | GLLog("glBufferSubData") << GLLogEnum(target) << offset << size |
| 860 | << GLLogBuffer<unsigned char>(static_cast<const unsigned char*>(data), size); |
| 861 | } |
| 862 | void API_ENTRY(glDeleteBuffers)(GLsizei n, const GLuint* buffers) { |
| 863 | CALL_GL_API(glDeleteBuffers, n, buffers); |
| 864 | GLLog("glDeleteBuffers") << n << GLLogBuffer<GLuint>(buffers, n); |
| 865 | } |
| 866 | void API_ENTRY(glGenBuffers)(GLsizei n, GLuint* buffers) { |
| 867 | CALL_GL_API(glGenBuffers, n, buffers); |
| 868 | GLLog("glGenBuffers") << n << GLLogBuffer<GLuint>(buffers, n); |
| 869 | } |
| 870 | void API_ENTRY(glGetBooleanv)(GLenum pname, GLboolean *params) { |
| 871 | CALL_GL_API(glGetBooleanv, pname, params); |
| 872 | // XXX: we need to compute the size of this buffer |
| 873 | GLLog("glGetBooleanv") << GLLogEnum(pname) << GLLogBuffer<GLboolean>(params); |
| 874 | } |
| 875 | void API_ENTRY(glGetFixedv)(GLenum pname, GLfixed *params) { |
| 876 | CALL_GL_API(glGetFixedv, pname, params); |
| 877 | // XXX: we need to compute the size of this buffer |
| 878 | GLLog("glGetFixedv") << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 879 | } |
| 880 | void API_ENTRY(glGetFloatv)(GLenum pname, GLfloat *params) { |
| 881 | CALL_GL_API(glGetFloatv, pname, params); |
| 882 | // XXX: we need to compute the size of this buffer |
| 883 | GLLog("glGetFloatv") << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 884 | } |
| 885 | void API_ENTRY(glGetPointerv)(GLenum pname, void **params) { |
| 886 | CALL_GL_API(glGetPointerv, pname, params); |
| 887 | // XXX: we need to compute the size of this buffer |
| 888 | GLLog("glGetPointerv") << GLLogEnum(pname) << GLLogBuffer<void*>(params); |
| 889 | } |
| 890 | void API_ENTRY(glGetBufferParameteriv)(GLenum target, GLenum pname, GLint *params) { |
| 891 | // XXX: we need to compute the size of this buffer |
| 892 | CALL_GL_API(glGetBufferParameteriv, target, pname, params); |
| 893 | GLLog("glGetBufferParameteriv") << GLLogEnum(target) << GLLogEnum(pname) << GLLogBuffer<GLint>(params); |
| 894 | } |
| 895 | void API_ENTRY(glGetClipPlanef)(GLenum pname, GLfloat eqn[4]) { |
| 896 | CALL_GL_API(glGetClipPlanef, pname, eqn); |
| 897 | GLLog("glGetClipPlanef") << GLLogEnum(pname) << GLLogBuffer<GLfloat>(eqn, 4); |
| 898 | } |
| 899 | void API_ENTRY(glGetClipPlanex)(GLenum pname, GLfixed eqn[4]) { |
| 900 | CALL_GL_API(glGetClipPlanex, pname, eqn); |
| 901 | GLLog("glGetClipPlanex") << GLLogEnum(pname) << GLLogBuffer<GLfixed>(eqn, 4); |
| 902 | } |
| 903 | void API_ENTRY(glGetLightxv)(GLenum light, GLenum pname, GLfixed *params) { |
| 904 | CALL_GL_API(glGetLightxv, light, pname, params); |
| 905 | // XXX: we need to compute the size of this buffer |
| 906 | GLLog("glGetLightxv") << GLLogEnum(light) << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 907 | } |
| 908 | void API_ENTRY(glGetLightfv)(GLenum light, GLenum pname, GLfloat *params) { |
| 909 | CALL_GL_API(glGetLightfv, light, pname, params); |
| 910 | // XXX: we need to compute the size of this buffer |
| 911 | GLLog("glGetLightfv") << GLLogEnum(light) << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 912 | } |
| 913 | void API_ENTRY(glGetMaterialxv)(GLenum face, GLenum pname, GLfixed *params) { |
| 914 | CALL_GL_API(glGetMaterialxv, face, pname, params); |
| 915 | // XXX: we need to compute the size of this buffer |
| 916 | GLLog("glGetMaterialxv") << GLLogEnum(face) << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 917 | } |
| 918 | void API_ENTRY(glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params) { |
| 919 | CALL_GL_API(glGetMaterialfv, face, pname, params); |
| 920 | // XXX: we need to compute the size of this buffer |
| 921 | GLLog("glGetMaterialfv") << GLLogEnum(face) << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 922 | } |
| 923 | void API_ENTRY(glGetTexEnvfv)(GLenum env, GLenum pname, GLfloat *params) { |
| 924 | CALL_GL_API(glGetTexEnvfv, env, pname, params); |
| 925 | // XXX: we need to compute the size of this buffer |
| 926 | GLLog("glGetTexEnvfv") << GLLogEnum(env) << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 927 | } |
| 928 | void API_ENTRY(glGetTexEnviv)(GLenum env, GLenum pname, GLint *params) { |
| 929 | CALL_GL_API(glGetTexEnviv, env, pname, params); |
| 930 | // XXX: we need to compute the size of this buffer |
| 931 | GLLog("glGetTexEnviv") << GLLogEnum(env) << GLLogEnum(pname) << GLLogBuffer<GLint>(params); |
| 932 | } |
| 933 | void API_ENTRY(glGetTexEnvxv)(GLenum env, GLenum pname, GLfixed *params) { |
| 934 | CALL_GL_API(glGetTexEnvxv, env, pname, params); |
| 935 | // XXX: we need to compute the size of this buffer |
| 936 | GLLog("glGetTexEnvxv") << GLLogEnum(env) << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 937 | } |
| 938 | void API_ENTRY(glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params) { |
| 939 | CALL_GL_API(glGetTexParameterfv, target, pname, params); |
| 940 | // XXX: we need to compute the size of this buffer |
| 941 | GLLog("glGetTexParameterfv") << GLLogEnum(target) << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 942 | } |
| 943 | void API_ENTRY(glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params) { |
| 944 | CALL_GL_API(glGetTexParameteriv, target, pname, params); |
| 945 | // XXX: we need to compute the size of this buffer |
| 946 | GLLog("glGetTexParameteriv") << GLLogEnum(target) << GLLogEnum(pname) << GLLogBuffer<GLint>(params); |
| 947 | } |
| 948 | void API_ENTRY(glGetTexParameterxv)(GLenum target, GLenum pname, GLfixed *params) { |
| 949 | CALL_GL_API(glGetTexParameterxv, target, pname, params); |
| 950 | // XXX: we need to compute the size of this buffer |
| 951 | GLLog("glGetTexParameterxv") << GLLogEnum(target) << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 952 | } |
| 953 | GLboolean API_ENTRY(glIsBuffer)(GLuint buffer) { |
| 954 | GLLog("glIsBuffer") << buffer; |
| 955 | CALL_GL_API_RETURN(glIsBuffer, buffer); |
| 956 | } |
| 957 | GLboolean API_ENTRY(glIsEnabled)(GLenum cap) { |
| 958 | GLLog("glIsEnabled") << GLLogEnum(cap); |
| 959 | CALL_GL_API_RETURN(glIsEnabled, cap); |
| 960 | } |
| 961 | GLboolean API_ENTRY(glIsTexture)(GLuint texture) { |
| 962 | GLLog("glIsTexture") << texture; |
| 963 | CALL_GL_API_RETURN(glIsTexture, texture); |
| 964 | } |
| 965 | void API_ENTRY(glPointParameterf)(GLenum pname, GLfloat param) { |
| 966 | CALL_GL_API(glPointParameterf, pname, param); |
| 967 | GLLog("glPointParameterf") << GLLogEnum(pname) << param; |
| 968 | } |
| 969 | void API_ENTRY(glPointParameterfv)(GLenum pname, const GLfloat *params) { |
| 970 | CALL_GL_API(glPointParameterfv, pname, params); |
| 971 | // XXX: we need to compute the size of this buffer |
| 972 | GLLog("glPointParameterfv") << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 973 | } |
| 974 | void API_ENTRY(glPointParameterx)(GLenum pname, GLfixed param) { |
| 975 | CALL_GL_API(glPointParameterx, pname, param); |
| 976 | GLLog("glPointParameterx") << GLLogEnum(pname) << GLLogFixed(param); |
| 977 | } |
| 978 | void API_ENTRY(glPointParameterxv)(GLenum pname, const GLfixed *params) { |
| 979 | CALL_GL_API(glPointParameterxv, pname, params); |
| 980 | // XXX: we need to compute the size of this buffer |
| 981 | GLLog("glPointParameterxv") << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 982 | } |
| 983 | void API_ENTRY(glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) { |
| 984 | CALL_GL_API(glColor4ub, red, green, blue, alpha); |
| 985 | GLLog("glColor4ub") << red << green << blue << alpha; |
| 986 | } |
| 987 | void API_ENTRY(glTexEnvi)(GLenum target, GLenum pname, GLint param) { |
| 988 | CALL_GL_API(glTexEnvi, target, pname, param); |
| 989 | GLLog("glTexEnvi") << GLLogEnum(target) << GLLogEnum(pname) << param; |
| 990 | } |
| 991 | void API_ENTRY(glTexEnviv)(GLenum target, GLenum pname, const GLint *params) { |
| 992 | CALL_GL_API(glTexEnviv, target, pname, params); |
| 993 | // XXX: we need to compute the size of this buffer |
| 994 | GLLog("glTexEnviv") << GLLogEnum(target) << GLLogEnum(pname) << GLLogBuffer<GLint>(params); |
| 995 | } |
| 996 | |
| 997 | void API_ENTRY(glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params) { |
| 998 | CALL_GL_API(glTexParameterfv, target, pname, params); |
| 999 | // XXX: we need to compute the size of this buffer |
| 1000 | GLLog("glTexParameterfv") << GLLogEnum(target) << GLLogEnum(pname) << GLLogBuffer<GLfloat>(params); |
| 1001 | } |
| 1002 | |
| 1003 | void API_ENTRY(glTexParameteriv)(GLenum target, GLenum pname, const GLint *params) { |
| 1004 | CALL_GL_API(glTexParameteriv, target, pname, params); |
| 1005 | // XXX: we need to compute the size of this buffer |
| 1006 | GLLog("glTexParameteriv") << GLLogEnum(target) << GLLogEnum(pname) << GLLogBuffer<GLint>(params); |
| 1007 | } |
| 1008 | |
| 1009 | void API_ENTRY(glTexParameteri)(GLenum target, GLenum pname, GLint param) { |
| 1010 | CALL_GL_API(glTexParameteri, target, pname, param); |
| 1011 | GLLog("glTexParameteri") << GLLogEnum(target) << GLLogEnum(pname) << param; |
| 1012 | } |
| 1013 | void API_ENTRY(glTexParameterxv)(GLenum target, GLenum pname, const GLfixed *params) { |
| 1014 | CALL_GL_API(glTexParameterxv, target, pname, params); |
| 1015 | // XXX: we need to compute the size of this buffer |
| 1016 | GLLog("glTexParameterxv") << GLLogEnum(target) << GLLogEnum(pname) << GLLogBuffer<GLfixed>(params); |
| 1017 | } |
| 1018 | void API_ENTRY(glPointSizePointerOES)(GLenum type, GLsizei stride, const GLvoid *pointer) { |
| 1019 | CALL_GL_API(glPointSizePointerOES, type, stride, pointer); |
| 1020 | GLLog("glPointSizePointerOES") << GLLogEnum(type) << stride << pointer; |
| 1021 | } |
| 1022 | |
| 1023 | // Extensions |
| 1024 | void API_ENTRY(glDrawTexsOES)(GLshort x , GLshort y, GLshort z, GLshort w, GLshort h) { |
| 1025 | CALL_GL_API(glDrawTexsOES, x, y, z, w, h); |
| 1026 | GLLog("glDrawTexsOES") << x << y << z << w << h; |
| 1027 | } |
| 1028 | void API_ENTRY(glDrawTexiOES)(GLint x, GLint y, GLint z, GLint w, GLint h) { |
| 1029 | CALL_GL_API(glDrawTexiOES, x, y, z, w, h); |
| 1030 | GLLog("glDrawTexiOES") << x << y << z << w << h; |
| 1031 | } |
| 1032 | void API_ENTRY(glDrawTexfOES)(GLfloat x, GLfloat y, GLfloat z, GLfloat w, GLfloat h) { |
| 1033 | CALL_GL_API(glDrawTexfOES, x, y, z, w, h); |
| 1034 | GLLog("glDrawTexfOES") << x << y << z << w << h; |
| 1035 | } |
| 1036 | void API_ENTRY(glDrawTexxOES)(GLfixed x, GLfixed y, GLfixed z, GLfixed w, GLfixed h) { |
| 1037 | CALL_GL_API(glDrawTexxOES, x, y, z, w, h); |
| 1038 | GLLog("glDrawTexfOES") << GLLogFixed(x) << GLLogFixed(y) << GLLogFixed(z) << GLLogFixed(w) << GLLogFixed(h); |
| 1039 | } |
| 1040 | void API_ENTRY(glDrawTexsvOES)(const GLshort* coords) { |
| 1041 | CALL_GL_API(glDrawTexsvOES, coords); |
| 1042 | GLLog("glDrawTexsvOES") << GLLogBuffer<GLshort>(coords, 5); |
| 1043 | } |
| 1044 | void API_ENTRY(glDrawTexivOES)(const GLint* coords) { |
| 1045 | CALL_GL_API(glDrawTexivOES, coords); |
| 1046 | GLLog("glDrawTexivOES") << GLLogBuffer<GLint>(coords, 5); |
| 1047 | } |
| 1048 | void API_ENTRY(glDrawTexfvOES)(const GLfloat* coords) { |
| 1049 | CALL_GL_API(glDrawTexfvOES, coords); |
| 1050 | GLLog("glDrawTexfvOES") << GLLogBuffer<GLfloat>(coords, 5); |
| 1051 | } |
| 1052 | void API_ENTRY(glDrawTexxvOES)(const GLfixed* coords) { |
| 1053 | CALL_GL_API(glDrawTexxvOES, coords); |
| 1054 | GLLog("glDrawTexxvOES") << GLLogBuffer<GLfixed>(coords, 5); |
| 1055 | } |
| 1056 | GLbitfield API_ENTRY(glQueryMatrixxOES)(GLfixed* mantissa, GLint* exponent) { |
| 1057 | GLLog("glQueryMatrixxOES") << GLLogBuffer<GLfixed>(mantissa, 16) << GLLogBuffer<GLfixed>(exponent, 16); |
| 1058 | CALL_GL_API_RETURN(glQueryMatrixxOES, mantissa, exponent); |
| 1059 | } |