Forum Discussion

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

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

  • obzen's avatar
    obzen
    Expert Protege
    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
  • elect's avatar
    elect
    Honored Guest
    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
  • Jowcey's avatar
    Jowcey
    Honored Guest
    "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