Kenneth Waters | 1545e11 | 2010-01-14 13:20:44 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2009 The Chromium OS 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. */ |
| 4 | |
| 5 | #include "gles2_stub.h" |
| 6 | |
| 7 | #include <GLES2/gl2.h> |
| 8 | |
| 9 | static const char* kExtensions = ""; |
| 10 | static const char* kRenderer = "OpenGL-ES 2.0 stub"; |
| 11 | static const char* kShadingLanguageVersion = "OpenGL ES GLSL ES 1.0"; |
| 12 | static const char* kVendor = "Chromium OS"; |
| 13 | static const char* kVersion = "OpenGL ES 2.0"; |
| 14 | |
| 15 | #define GL_CONTEXT() (&glContext) |
| 16 | |
| 17 | static GlContext glContext = {1}; |
| 18 | |
| 19 | GLuint glCreateProgram() { |
| 20 | GlContext* gl = GL_CONTEXT(); |
| 21 | return gl->next_name_++; |
| 22 | } |
| 23 | |
| 24 | GLuint glCreateShader(GLenum type) { |
| 25 | GlContext* gl = GL_CONTEXT(); |
| 26 | return gl->next_name_++; |
| 27 | } |
| 28 | |
| 29 | GLenum glGetError() { |
| 30 | return GL_NO_ERROR; |
| 31 | } |
| 32 | |
| 33 | const GLubyte* glGetString(GLenum name) { |
| 34 | switch (name) { |
| 35 | case GL_EXTENSIONS: |
| 36 | return (GLubyte*)kExtensions; |
| 37 | case GL_RENDERER: |
| 38 | return (GLubyte*)kRenderer; |
| 39 | case GL_SHADING_LANGUAGE_VERSION: |
| 40 | return (GLubyte*)kShadingLanguageVersion; |
| 41 | case GL_VENDOR: |
| 42 | return (GLubyte*)kVendor; |
| 43 | case GL_VERSION: |
| 44 | return (GLubyte*)kVersion; |
| 45 | default: |
| 46 | return (GLubyte*)""; |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | /* Auto-Generated Entry Points */ |
| 51 | $AutoStubs |
| 52 | |