Changeset 20499 in vbox for trunk/src/VBox/Main/generic
- Timestamp:
- Jun 12, 2009 11:27:00 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/generic/OpenGLTest.cpp
r20300 r20499 1 1 /* $Id$ */ 2 3 2 /** @file 4 * VBox host opengl support test 3 * VBox host opengl support test - generic implementation. 5 4 */ 6 5 … … 13 12 14 13 #include <VBox/err.h> 14 #include <iprt/assert.h> 15 #include <iprt/env.h> 16 #include <iprt/param.h> 17 #include <iprt/path.h> 15 18 #include <iprt/process.h> 16 #include <iprt/path.h> 17 #include <iprt/param.h> 18 #include <iprt/env.h> 19 #include <iprt/thread.h> 20 #include <string.h> 21 #include <stdio.h> 19 #include <iprt/string.h> 20 #include <iprt/time.h> 22 21 23 22 bool is3DAccelerationSupported() 24 23 { 25 24 static char pszVBoxPath[RTPATH_MAX]; 26 const char *p Args[2] = {"-test", NULL};25 const char *papszArgs[3] = { NULL, "-test", NULL}; 27 26 int rc; 28 27 RTPROCESS Process; 29 28 RTPROCSTATUS ProcStatus; 30 RTTIMESPEC Start; 31 RTTIMESPEC Now; 29 uint64_t StartTS; 32 30 33 RTProcGetExecutableName(pszVBoxPath, RTPATH_MAX);34 RTPathStripFilename(pszVBoxPath); 35 strcat(pszVBoxPath,"/VBoxTestOGL");36 # ifdef RT_OS_WINDOWS37 strcat(pszVBoxPath,".exe");31 rc = RTPathExecDir(pszVBoxPath, RTPATH_MAX); AssertRCReturn(rc, false); 32 #if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2) 33 rc = RTPathAppend(pszVBoxPath, RTPATH_MAX, "VBoxTestOGL"); 34 #else 35 rc = RTPathAppend(pszVBoxPath, RTPATH_MAX, "VBoxTestOGL.exe"); 38 36 #endif 37 AssertRCReturn(rc, false); 38 papszArgs[0] = pszVBoxPath; /* argv[0] */ 39 39 40 rc = RTProcCreate(pszVBoxPath, pArgs, RTENV_DEFAULT, 0, &Process); 41 if (RT_FAILURE(rc)) return false; 40 rc = RTProcCreate(pszVBoxPath, papszArgs, RTENV_DEFAULT, 0, &Process); 41 if (RT_FAILURE(rc)) 42 return false; 42 43 43 RTTimeNow(&Start);44 StartTS = RTTimeMilliTS(); 44 45 45 46 while (1) … … 49 50 break; 50 51 51 if (RTTime SpecGetMilli(RTTimeSpecSub(RTTimeNow(&Now), &Start))> 30*1000 /* 30 sec */)52 if (RTTimeMilliTS() - StartTS > 30*1000 /* 30 sec */) 52 53 { 53 54 RTProcTerminate(Process); … … 69 70 return false; 70 71 } 72
Note:
See TracChangeset
for help on using the changeset viewer.