VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_getstring.c@ 37775

Last change on this file since 37775 was 15532, checked in by vboxsync, 16 years ago

crOpenGL: export to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#include "cr_error.h"
8#include "cr_version.h"
9#include "state.h"
10#include "state/cr_statetypes.h"
11#include "cr_extstring.h"
12#include "cr_mem.h"
13#include "cr_string.h"
14
15
16const GLubyte * STATE_APIENTRY crStateGetString( GLenum name )
17{
18 CRContext *g = GetCurrentContext();
19 if (!g)
20 return NULL;
21
22 switch( name )
23 {
24 case GL_VENDOR:
25 return (const GLubyte *) CR_VENDOR;
26 case GL_RENDERER:
27 return (const GLubyte *) CR_RENDERER;
28 case GL_VERSION:
29 return (const GLubyte *) CR_OPENGL_VERSION_STRING " Chromium " CR_VERSION_STRING;
30 case GL_EXTENSIONS:
31 /* This shouldn't normally be queried - the relevant SPU should
32 * catch this query and do all the extension string merging/mucking.
33 */
34 {
35 static char *extensions = NULL;
36 if (!extensions) {
37 extensions = crAlloc(crStrlen(crExtensions) + crStrlen(crChromiumExtensions) + 2);
38 crStrcpy(extensions, crExtensions);
39 crStrcpy(extensions, " ");
40 crStrcat(extensions, crChromiumExtensions);
41 }
42 return (const GLubyte *) extensions;
43 }
44#if defined(CR_ARB_vertex_program) || defined(CR_ARB_fragment_program)
45 case GL_PROGRAM_ERROR_STRING_ARB:
46 return g->program.errorString;
47#endif
48 default:
49 crStateError( __LINE__, __FILE__, GL_INVALID_ENUM,
50 "calling glGetString() with invalid name" );
51 return NULL;
52 }
53
54 (void) crAppOnlyExtensions; /* silence warnings */
55}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette