Skip to main content
Inspiring
March 5, 2013

Minimal Oculus Application Tutorial

Hey guys!

I put together this simple tutorial, showing the bare minimum code needed to work with the Oculus SDK.

https://developer.oculus.com/wiki/index.php?title=Minimal_Oculus_Application

It's basically just a console application that prints out some values from the headset. This could be a good place to start if you are confused about what is part of the SDK and what is just part of the demos. It also shows how simple it is to work with the SDK. Of course, it won't show how to handle stereo 3D, or distortion, or all the complex stuff. But it's a start.

Hope that helps,

- Andres

Updated tutorial for 0.3.x SDK:
https://developer.oculus.com/wiki/Minimal_Oculus_Application_0.3.x

    33 replies

    Inspiring
    June 11, 2014
    What IDE are you using? I believe I made the tutorial w/ VS 2010 and I didn't have to do that.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    New Participant
    June 11, 2014
    "cybereality" wrote:
    What IDE are you using? I believe I made the tutorial w/ VS 2010 and I didn't have to do that.


    I'm using VS2013, Oculus 0.3.2 and win32 as a build target. If found out which dependencies I was missing by pasting the config over from RoomTiny and then deleting until the linker failures showed up again.

    The specific failures are:
    "Error 1 error LNK2019: unresolved external symbol __imp__SwapBuffers@4 referenced in function "public: virtual void __thiscall OVR::CAPI::GL::DistortionRenderer::EndFrame(bool,unsigned char *,unsigned char *)" (?EndFrame@DistortionRenderer@GL@CAPI@OVR@@UAEX_NPAE1@Z) C:\Users\redacted\documents\visual studio 2013\Projects\MinimalOculus\MinimalOculus\libovrd.lib(CAPI_GL_DistortionRenderer.obj) MinimalOculus"

    when gdi32.lib is not added and:

    "Error 1 error LNK2019: unresolved external symbol __imp__SHGetFolderPathW@20 referenced in function "class OVR::String __cdecl OVR::GetBaseOVRPath(bool)" (?GetBaseOVRPath@OVR@@YA?AVString@1@_N@Z) C:\Users\redacted\documents\visual studio 2013\Projects\MinimalOculus\MinimalOculus\libovrd.lib(OVR_Profile.obj) MinimalOculus"

    when shell32.lib is not added.

    After those two additions it builds fine. OculusWorldDemo doesn't need either of them, but I'm guessing that is because RoomTiny already brings them in.
    New Participant
    September 28, 2014
    I'd be keen to check this out but unfortunately the wiki is 404.

    Any chance of updating this to the new SDK?

    thanks
    New Participant
    September 30, 2014
    I would also love to check out this wiki!

    What happened to it! :?
    New Participant
    October 7, 2014
    "fire2k" wrote:

    To get this to work I also have to explicitly link to "shell32.lib" and "gdi32.lib", even though they are totally in the inherited values. If I don't link those two specifically I get Linker failures.


    I had the exact same linker errors, and explicitly linking those libraries (even though they were inherited) fixed the errors! Thanks for posting.
    Inspiring
    October 7, 2014
    Sorry, the Wiki is down and will need to some work to be replaced. Not sure when it will be back.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    New Participant
    October 18, 2014
    Does this mean that there is some error with the github also?

    I cannot get it to work for some reason, the

    if (ts.StatusFlags & ovrStatus_OrientationTracked)


    statement is never true...
    Inspiring
    October 18, 2014
    I see the line as:

    if (ts.StatusFlags & (ovrStatus_OrientationTracked | ovrStatus_PositionTracked)) {


    Does that help?
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    New Participant
    November 7, 2014
    why can't I see any of these tutorials? I get redirected to the main dashboard page...

    is there any other location where I can see this code?
    Inspiring
    November 7, 2014
    The tutorials are gone now. I will speak with the team about bringing up something to replace them.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV