OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file is here so other GLES2 related files can have a common set of | 5 // This file is here so other GLES2 related files can have a common set of |
6 // includes where appropriate. | 6 // includes where appropriate. |
7 | 7 |
8 #include <GLES2/gl2.h> | 8 #include <GLES2/gl2.h> |
9 #include "gpu/command_buffer/client/gles2_demo_cc.h" | 9 #include "gpu/command_buffer/client/gles2_demo_cc.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 int g_width = 512; | |
14 int g_height = 512; | |
15 GLuint g_texture = 0; | 13 GLuint g_texture = 0; |
16 int g_textureLoc = -1; | 14 int g_textureLoc = -1; |
17 GLuint g_programObject = 0; | 15 GLuint g_programObject = 0; |
18 GLuint g_vbo = 0; | 16 GLuint g_vbo = 0; |
19 GLsizei g_texCoordOffset = 0; | 17 GLsizei g_texCoordOffset = 0; |
20 | 18 |
21 void CheckGLError() { | 19 void CheckGLError() { |
22 GLenum error = glGetError(); | 20 GLenum error = glGetError(); |
23 if (error != GL_NO_ERROR) { | 21 if (error != GL_NO_ERROR) { |
24 DLOG(ERROR) << "GL Error: " << error; | 22 DLOG(ERROR) << "GL Error: " << error; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } // anonymous namespace. | 180 } // anonymous namespace. |
183 | 181 |
184 void GLFromCPPTestFunction() { | 182 void GLFromCPPTestFunction() { |
185 static bool initialized = false; | 183 static bool initialized = false; |
186 if (!initialized) { | 184 if (!initialized) { |
187 initialized = true; | 185 initialized = true; |
188 Init(); | 186 Init(); |
189 } | 187 } |
190 Draw(); | 188 Draw(); |
191 } | 189 } |
192 | |
193 | |
194 | |
OLD | NEW |