Changeset 20411 in vbox
- Timestamp:
- Jun 8, 2009 2:38:19 PM (16 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu.h
r20084 r20411 41 41 GLint serverCtx; /* context ID returned by server */ 42 42 char glVersion[100]; /* GL_VERSION string */ 43 char pszRealVendor[100]; 44 char pszRealVersion[100]; 45 char pszRealRenderer[100]; 43 46 }; 44 47 -
trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_getstring.c
r20401 r20411 60 60 } 61 61 62 static void GetString(GLenum name, char *pszStr) 63 { 64 GET_THREAD(thread); 65 int writeback = 1; 66 67 if (pack_spu.swap) 68 crPackGetStringSWAP(name, pszStr, &writeback); 69 else 70 crPackGetString(name, pszStr, &writeback); 71 packspuFlush( (void *) thread ); 72 73 while (writeback) 74 crNetRecv(); 75 } 62 76 63 77 static GLfloat … … 65 79 { 66 80 GLubyte return_value[100]; 67 GET_THREAD(thread);68 81 int writeback = 1; 69 82 GLfloat version; 70 83 71 if (pack_spu.swap) 72 crPackGetStringSWAP( GL_VERSION, return_value, &writeback ); 73 else 74 crPackGetString( GL_VERSION, return_value, &writeback ); 75 packspuFlush( (void *) thread ); 76 77 while (writeback) 78 crNetRecv(); 79 84 GetString(GL_VERSION, return_value); 80 85 CRASSERT(crStrlen((char *)return_value) < 100); 81 86 … … 86 91 } 87 92 93 #ifdef WINDOWS 94 static bool packspuRunningUnderWine(void) 95 { 96 return NULL != GetModuleHandle("wined3d.dll"); 97 } 98 #endif 99 88 100 const GLubyte * PACKSPU_APIENTRY packspu_GetString( GLenum name ) 89 101 { 90 102 GET_CONTEXT(ctx); 91 103 92 if (name == GL_EXTENSIONS)104 switch(name) 93 105 { 94 return GetExtensions(); 95 } 96 else if (name == GL_VERSION) 97 { 98 float version = GetVersionString(); 99 sprintf(ctx->glVersion, "%.1f Chromium %s", version, CR_VERSION_STRING); 100 return (const GLubyte *) ctx->glVersion; 101 } 106 case GL_EXTENSIONS: 107 return GetExtensions(); 108 case GL_VERSION: 109 #ifdef WINDOWS 110 if (packspuRunningUnderWine()) 111 { 112 GetString(GL_REAL_VERSION, ctx->pszRealVersion); 113 return (const GLubyte*) ctx->pszRealVersion; 114 } 115 else 116 #endif 117 { 118 float version = GetVersionString(); 119 sprintf(ctx->glVersion, "%.1f Chromium %s", version, CR_VERSION_STRING); 120 return (const GLubyte *) ctx->glVersion; 121 } 122 case GL_VENDOR: 123 #ifdef WINDOWS 124 if (packspuRunningUnderWine()) 125 { 126 GetString(GL_REAL_VENDOR, ctx->pszRealVendor); 127 return (const GLubyte*) ctx->pszRealVendor; 128 } 129 else 130 #endif 131 { 132 return crStateGetString(name); 133 } 134 case GL_RENDERER: 135 #ifdef WINDOWS 136 if (packspuRunningUnderWine()) 137 { 138 GetString(GL_REAL_RENDERER, ctx->pszRealRenderer); 139 return (const GLubyte*) ctx->pszRealRenderer; 140 } 141 else 142 #endif 143 { 144 return crStateGetString(name); 145 } 146 102 147 #ifdef CR_OPENGL_VERSION_2_0 103 else if (name == GL_SHADING_LANGUAGE_VERSION) 104 { 105 GET_THREAD(thread); 106 int writeback = 1; 107 108 crPackGetString(GL_SHADING_LANGUAGE_VERSION, gpszShadingVersion, &writeback); 109 packspuFlush( (void *) thread ); 110 111 while (writeback) 112 crNetRecv(); 113 114 return gpszShadingVersion; 115 } 148 case GL_SHADING_LANGUAGE_VERSION: 149 GetString(GL_SHADING_LANGUAGE_VERSION, gpszShadingVersion); 150 return gpszShadingVersion; 116 151 #endif 117 else 118 { 119 return crStateGetString(name); 152 #ifdef GL_CR_real_vendor_strings 153 case GL_REAL_VENDOR: 154 GetString(GL_REAL_VENDOR, ctx->pszRealVendor); 155 return (const GLubyte*) ctx->pszRealVendor; 156 case GL_REAL_VERSION: 157 GetString(GL_REAL_VERSION, ctx->pszRealVersion); 158 return (const GLubyte*) ctx->pszRealVersion; 159 case GL_REAL_RENDERER: 160 GetString(GL_REAL_RENDERER, ctx->pszRealRenderer); 161 return (const GLubyte*) ctx->pszRealRenderer; 162 #endif 163 default: 164 return crStateGetString(name); 120 165 } 121 166 } -
trunk/src/VBox/GuestHost/OpenGL/include/chromium.h
r15532 r20411 545 545 #endif /* GL_CR_zpix */ 546 546 547 /*Allow to use glGetString to query real host GPU info*/ 548 #ifndef GL_CR_real_vendor_strings 549 #define GL_CR_real_vendor_strings 1 550 #define GL_REAL_VENDOR 0x8B23 551 #define GL_REAL_VERSION 0x8B24 552 #define GL_REAL_RENDERER 0x8B25 553 #endif 554 547 555 548 556 /**********************************************************************/ … … 618 626 #endif 619 627 620 621 628 #ifdef __cplusplus 622 629 } -
trunk/src/VBox/HostServices/SharedOpenGL/render/renderspu.c
r20392 r20411 1000 1000 return render_spu.ws.glGetString(GL_SHADING_LANGUAGE_VERSION); 1001 1001 #endif 1002 #ifdef GL_CR_real_vendor_strings 1003 else if (pname == GL_REAL_VENDOR) 1004 return render_spu.ws.glGetString(GL_VENDOR); 1005 else if (pname == GL_REAL_VERSION) 1006 return render_spu.ws.glGetString(GL_VERSION); 1007 else if (pname == GL_REAL_RENDERER) 1008 return render_spu.ws.glGetString(GL_RENDERER); 1009 #endif 1002 1010 else 1003 1011 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.