VirtualBox

Ignore:
Timestamp:
Jan 19, 2023 1:50:46 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155310
Message:

Add/WinNT: Made an disabled opengl test build again and use VBoxR3Static instead of VBOXR3STATIC. bugref:10348

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  
    3434        ogltest-x86
    3535
    36 ogltest_TEMPLATE = VBOXR3STATIC
     36ogltest_TEMPLATE = VBoxR3Static
    3737ogltest_INCS = \
    3838        $(PATH_ROOT)/src/VBox/Devices/Graphics/vmsvga_glext
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/disp/wddm/gallium/ogltest/ogltest.cpp

    r98103 r98139  
    2727
    2828#include "oglrender.h"
     29#include <iprt/string.h>
    2930
    3031PFNGLBINDBUFFERPROC                             glBindBuffer;
     
    6061    ~OGLTest();
    6162
    62     HRESULT Init(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow);
     63    HRESULT Init(HINSTANCE hInstance, int argc, char **argv, int nCmdShow);
    6364    int Run();
    6465
     
    6667    HRESULT initWindow(HINSTANCE hInstance, int nCmdShow);
    6768    HRESULT initOGL();
    68     void parseCmdLine(LPSTR lpCmdLine);
     69    void parseCmdLine(int argc, char **argv);
    6970    static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
    7071
     
    257258}
    258259
    259 void OGLTest::parseCmdLine(LPSTR lpCmdLine)
     260void OGLTest::parseCmdLine(int argc, char **argv)
    260261{
    261262    /* Very simple: test number followed by step flag.
    262263     * Default is test 0, step mode: 1
    263264     */
    264     if (!lpCmdLine)
    265         return;
    266 
    267     char *p = lpCmdLine;
    268 
    269     while (*p == ' ')
    270         ++p;
    271 
    272     if (!*p)
    273          return;
    274265
    275266    /* 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]);
    283269
    284270    /* 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
     275HRESULT OGLTest::Init(HINSTANCE hInstance, int argc, char **argv, int nCmdShow)
     276{
     277    parseCmdLine(argc, argv);
    293278
    294279    HRESULT hr = initWindow(hInstance, nCmdShow);
     
    381366}
    382367
    383 int WINAPI WinMain(HINSTANCE hInstance,
    384                    HINSTANCE hPrevInstance,
    385                    LPSTR lpCmdLine,
    386                    int nCmdShow)
    387 {
    388     (void)hPrevInstance;
    389 
    390     int result = 0;
     368int main(int argc, char **argv)
     369{
     370    int      rcExit = RTEXITCODE_FAILURE;
     371
    391372    OGLTest test;
    392 
    393     HRESULT hr = test.Init(hInstance, lpCmdLine, nCmdShow);
     373    HRESULT hr = test.Init(GetModuleHandleW(NULL), argc, argv, SW_SHOWDEFAULT);
    394374    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.

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