[email protected] | 1bee398 | 2009-12-17 23:15:28 | [diff] [blame] | 1 | // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
[email protected] | 96449d2c | 2009-11-25 00:01:32 | [diff] [blame] | 4 | |
5 | // This file includes all the necessary GL headers and implements some useful | ||||
6 | // utilities. | ||||
7 | |||||
8 | #ifndef GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ | ||||
9 | #define GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ | ||||
10 | |||||
[email protected] | 69d80ae | 2009-12-23 08:57:42 | [diff] [blame^] | 11 | #if defined(UNIT_TEST) |
12 | #include "gpu/command_buffer/service/gl_mock.h" | ||||
13 | #else | ||||
[email protected] | 96449d2c | 2009-11-25 00:01:32 | [diff] [blame] | 14 | #include <GL/glew.h> |
15 | #if defined(OS_WIN) | ||||
16 | #include <GL/wglew.h> | ||||
17 | #endif | ||||
18 | #include <build/build_config.h> | ||||
[email protected] | 69d80ae | 2009-12-23 08:57:42 | [diff] [blame^] | 19 | #endif |
[email protected] | 96449d2c | 2009-11-25 00:01:32 | [diff] [blame] | 20 | |
[email protected] | c3d7d60 | 2009-12-10 22:42:00 | [diff] [blame] | 21 | #define GL_GLEXT_PROTOTYPES 1 |
[email protected] | 96449d2c | 2009-11-25 00:01:32 | [diff] [blame] | 22 | |
23 | // Define this for extra GL error debugging (slower). | ||||
24 | // #define GL_ERROR_DEBUGGING | ||||
25 | #ifdef GL_ERROR_DEBUGGING | ||||
26 | #define CHECK_GL_ERROR() do { \ | ||||
27 | GLenum gl_error = glGetError(); \ | ||||
28 | LOG_IF(ERROR, gl_error != GL_NO_ERROR) << "GL Error :" << gl_error; \ | ||||
29 | } while (0) | ||||
30 | #else // GL_ERROR_DEBUGGING | ||||
31 | #define CHECK_GL_ERROR() void(0) | ||||
32 | #endif // GL_ERROR_DEBUGGING | ||||
33 | |||||
34 | #endif // GPU_COMMAND_BUFFER_SERVICE_GL_UTILS_H_ |