Skip to main content
Up and Coming
September 13, 2013

Some sample code for basic Oculus support with SDL 2.

Pretty trivial atm, but some may find it useful. ;)

http://pastebin.com/2qdG5kRj

All righty, back to work!

    4 replies

    obzenAuthor
    Up and Coming
    September 16, 2013
    For anyone looking for a 'simple' C++ code sample.

    Finally got my head around using GLSL shaders, so added the distortion filter. That means it's 1,000 line of code now, with the extra necessary stuff (frame buffer, shaders, and VBO's).

    http://pastebin.com/2VEasjbu
    DK1 FREAK ...
    Participant
    January 7, 2014
    Did anyone get to make this linux-able? I attempted a conversion and it segfaulted.

    This is what I came up with: http://paste.debian.net/74838/


    I did it! http://pastebin.com/P1z8GLVC
    Up and Coming
    February 19, 2014
    Hi, I cant compile your code

    1>------ Rebuild All started: Project: MinimalOculus, Configuration: Debug Win32 ------
    1> Main.cpp
    1>c:\users\gbarbieri\documents\visual studio 2010\projects\minimaloculus\minimaloculus\main.cpp(35): error C2664: 'OutputDebugStringW' : cannot convert parameter 1 from 'char [1024]' to 'LPCWSTR'
    1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>c:\users\gbarbieri\documents\visual studio 2010\projects\minimaloculus\minimaloculus\main.cpp(36): error C2664: 'OutputDebugStringW' : cannot convert parameter 1 from 'const char [2]' to 'LPCWSTR'
    1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


    I included all the necessary paths/libraries

    Win7 64b, VS2010 Express
    New Participant
    October 15, 2014
    "elect" wrote:
    Hi, I cant compile your code

    1>------ Rebuild All started: Project: MinimalOculus, Configuration: Debug Win32 ------
    1> Main.cpp
    1>c:\users\gbarbieri\documents\visual studio 2010\projects\minimaloculus\minimaloculus\main.cpp(35): error C2664: 'OutputDebugStringW' : cannot convert parameter 1 from 'char [1024]' to 'LPCWSTR'
    1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    1>c:\users\gbarbieri\documents\visual studio 2010\projects\minimaloculus\minimaloculus\main.cpp(36): error C2664: 'OutputDebugStringW' : cannot convert parameter 1 from 'const char [2]' to 'LPCWSTR'
    1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


    I included all the necessary paths/libraries

    Win7 64b, VS2010 Express


    You need to go into project configuration and change your project to multibyte :D