Changeset 20617 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jun 16, 2009 10:00:45 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_getstring.c
r20468 r20617 15 15 static GLubyte gpszShadingVersion[255]=""; 16 16 #endif 17 18 static void GetString(GLenum name, char *pszStr) 19 { 20 GET_THREAD(thread); 21 int writeback = 1; 22 23 if (pack_spu.swap) 24 crPackGetStringSWAP(name, pszStr, &writeback); 25 else 26 crPackGetString(name, pszStr, &writeback); 27 packspuFlush( (void *) thread ); 28 29 while (writeback) 30 crNetRecv(); 31 } 32 33 static GLfloat 34 GetVersionString(void) 35 { 36 GLubyte return_value[100]; 37 GLfloat version; 38 39 GetString(GL_VERSION, return_value); 40 CRASSERT(crStrlen((char *)return_value) < 100); 41 42 version = crStrToFloat((char *) return_value); 43 version = crStateComputeVersion(version); 44 45 return version; 46 } 17 47 18 48 static const GLubyte * … … 47 77 48 78 #ifdef CR_OPENGL_VERSION_2_0 49 /* @todo, check if host supports opengl 2.0 or this extension 50 * before exporting it. 79 /* @todo move to known extensions etc, for now just a hack. 51 80 */ 52 sprintf(gpszExtensions, "%sGL_ARB_shading_language_100 GL_ARB_shader_objects GL_ARB_vertex_shader GL_ARB_fragment_shader", ext); 81 { 82 GLfloat fversion = GetVersionString(); 83 if (fversion>=2.f) 84 { 85 sprintf(gpszExtensions, "%sGL_ARB_shading_language_100 GL_ARB_shader_objects GL_ARB_vertex_shader GL_ARB_fragment_shader", ext); 86 } 87 } 53 88 #else 54 89 sprintf(gpszExtensions, "%s", ext); … … 56 91 57 92 return gpszExtensions; 58 }59 60 static void GetString(GLenum name, char *pszStr)61 {62 GET_THREAD(thread);63 int writeback = 1;64 65 if (pack_spu.swap)66 crPackGetStringSWAP(name, pszStr, &writeback);67 else68 crPackGetString(name, pszStr, &writeback);69 packspuFlush( (void *) thread );70 71 while (writeback)72 crNetRecv();73 }74 75 static GLfloat76 GetVersionString(void)77 {78 GLubyte return_value[100];79 int writeback = 1;80 GLfloat version;81 82 GetString(GL_VERSION, return_value);83 CRASSERT(crStrlen((char *)return_value) < 100);84 85 version = crStrToFloat((char *) return_value);86 version = crStateComputeVersion(version);87 88 return version;89 93 } 90 94
Note:
See TracChangeset
for help on using the changeset viewer.