Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Anonymous's avatar
Anonymous
8 years ago

Problems with app being launched via Oculus home - how can I know this happened ?

Hi,
this may sound pretty silly but it's quite a nightmare for me now.

I have an app I am working that should go on Steam ( that's part of the problem in the sense that OR 'recognizes' it as such ) and before it gets launched ( from Windows desktop ) may open a couple of Dialog Boxes showing some info/offering some options ( one of which is "start in VR" ).

However, because they are Windows Modal Dialog Boxes they DO NOT APPEAR within OR home and such, I could easily "avoid to launch them" IF i'd know that the program been launched from Oculus Home ( i.e. "Recents" ) but HOW CAN I KNOW THAT ?

All this happens well before I even decide "I am running in VR" and call ovr_initalize() and all the rest, I would be sufficient for me to know that the app is been actually luanned via Oculus Home but how to know that ?

I am taking CPP code wrote in Windows (10).

Thanks in advance.

Ivan Z.

2 Replies

  • Anonymous's avatar
    Anonymous


    Hi,

    What is this "OR" you reference in this post?

    I'm not exactly sure this is a development problem, but rather something on your end in your operating environment that is setup incorrectly.

    What does this mean in the context of this issue:

    I am taking CPP code wrote in Windows (10).





    Ok, suppose I have a "Standard Windows 32/64 bits app wrote in CPP running on Windows 10"

    This app is developed using the Windows Oculus SDK but is designed to work WITH or WITHOUT Oculus, when it starts it does a thing like this :

        // New addition, the dialog box at start
        DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG2), hWnd, PCStartupScreen::StarupDlgProc);

        PRINTF("wantToStartVR = %d\n", wantToStartVR);

    Which opens a Windows Dialog box which among various things has two buttons one saying "Start Normal" and another saying "Start in VR".

    When "Start in VR" is selected, it put that wantToStartVR to true at that point other things happens like it will call ovr_Initialize() and if successfull will continue to do other things and allow the game to play in VR otherwise it tells you "Sorry can not initialise Oculus" and continues to play the game in standard 2D mode.

    The problem is all this works PERFECTLY IFF the game is launched via Window Desktop because it's opening a window DialogBox that is visible on the desktop and all is fine.

    BUT, the problem is, you do this once, "someway I don't know how" Oculus Home will make me find my app in "Recents" and at that point someone that starts with Oculus already initialised can go in Oculus Home and click the app from the "Recents".

    What happens at that point the application starts, from Oculus Home, BUT "it's stuck in that DialogBox" that appears on the window destkop BUT NOT inside Oculus Home and because it waits for the user to press one of the two buttons ( in reality that's a "Startup Screen" with various options that can be chosen ) so it appears that everything is "stuck" in reality there's a windows on the desktop that the user wearing Oculus Rift can not see that is waiting for a button press.

    And all this happens BEFORE I can even call ovr_Initialize() at all effect my code has ABSOLUTELY NO KNOWLEDGE that "it's been launched from the Oculus Home" and it does not even know at this point that "the user wants to play in VR".

    If I would know "oh it's been launched from Oculus Home and the user is already wearing oculus" I could easy say "Ok don't even launch that dialog box go directly in VR mode" literally I could make a code like :

    if ( Something_Tells_Me_Been_Launched_From_Oculus_Home() == true )
     {
      wantToStartVr = true;
    }
    else
    {
        DialogBox(hInstance, MAKEINTRESOURCE(IDD_DIALOG2), hWnd, PCStartupScreen::StarupDlgProc);
    }

    As simple as that .. BUT as far as I know "there's no way to know this is happening".

    Or better, there kinda is, but "feels a bit like a dirty hack" I did try to implement that thing that Kojack above mentions, it does work, could allow me to know "what's the process that launched my app" but .. it's "not the best way to do" I suppose.

    All this is because I'd like to AVOID to have to create "one version of my game for Oculus Rift ONLY" and "one version for Windows non-vr only" and so on, I think that "given all the sort of things your SDK already does" a function like Something_Tells_Me_Been_Launched_From_Oculus_Home() should possibly be not a hard thing to implement/have ( feature request ).

    I hope this explains better the point/reasons.

    Cheers.