Changeset 98139 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video
- Timestamp:
- Jan 19, 2023 1:50:46 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 155310
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/ogltest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/ogltest/Makefile.kmk
r98103 r98139 34 34 ogltest-x86 35 35 36 ogltest_TEMPLATE = VB OXR3STATIC36 ogltest_TEMPLATE = VBoxR3Static 37 37 ogltest_INCS = \ 38 38 $(PATH_ROOT)/src/VBox/Devices/Graphics/vmsvga_glext -
trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/ogltest/ogltest.cpp
r98103 r98139 27 27 28 28 #include "oglrender.h" 29 #include <iprt/string.h> 29 30 30 31 PFNGLBINDBUFFERPROC glBindBuffer; … … 60 61 ~OGLTest(); 61 62 62 HRESULT Init(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow);63 HRESULT Init(HINSTANCE hInstance, int argc, char **argv, int nCmdShow); 63 64 int Run(); 64 65 … … 66 67 HRESULT initWindow(HINSTANCE hInstance, int nCmdShow); 67 68 HRESULT initOGL(); 68 void parseCmdLine( LPSTR lpCmdLine);69 void parseCmdLine(int argc, char **argv); 69 70 static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); 70 71 … … 257 258 } 258 259 259 void OGLTest::parseCmdLine( LPSTR lpCmdLine)260 void OGLTest::parseCmdLine(int argc, char **argv) 260 261 { 261 262 /* Very simple: test number followed by step flag. 262 263 * Default is test 0, step mode: 1 263 264 */ 264 if (!lpCmdLine)265 return;266 267 char *p = lpCmdLine;268 269 while (*p == ' ')270 ++p;271 272 if (!*p)273 return;274 265 275 266 /* First number is the render id. */ 276 miRenderId = atoi(p); 277 278 while (*p == ' ' || ('0' <= *p && *p <= '9')) 279 ++p; 280 281 if (!*p) 282 return; 267 if (argc >= 2) 268 miRenderId = RTStrToInt32(argv[1]); 283 269 284 270 /* Second number is the step mode. */ 285 miRenderStep = atoi(p); 286 } 287 288 HRESULT OGLTest::Init(HINSTANCE hInstance, 289 LPSTR lpCmdLine, 290 int nCmdShow) 291 { 292 parseCmdLine(lpCmdLine); 271 if (argc >= 3) 272 miRenderStep = RTStrToInt32(argv[2]); 273 } 274 275 HRESULT OGLTest::Init(HINSTANCE hInstance, int argc, char **argv, int nCmdShow) 276 { 277 parseCmdLine(argc, argv); 293 278 294 279 HRESULT hr = initWindow(hInstance, nCmdShow); … … 381 366 } 382 367 383 int WINAPI WinMain(HINSTANCE hInstance, 384 HINSTANCE hPrevInstance, 385 LPSTR lpCmdLine, 386 int nCmdShow) 387 { 388 (void)hPrevInstance; 389 390 int result = 0; 368 int main(int argc, char **argv) 369 { 370 int rcExit = RTEXITCODE_FAILURE; 371 391 372 OGLTest test; 392 393 HRESULT hr = test.Init(hInstance, lpCmdLine, nCmdShow); 373 HRESULT hr = test.Init(GetModuleHandleW(NULL), argc, argv, SW_SHOWDEFAULT); 394 374 if (SUCCEEDED(hr)) 395 { 396 result = test.Run(); 397 } 398 399 return result; 400 } 375 rcExit = test.Run(); 376 377 return rcExit; 378 }
Note:
See TracChangeset
for help on using the changeset viewer.