Forum Discussion

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

C++ OpenGL/Kinect/Bullet Physics example project

Apologies for cross posting. I had to make a few forum replies before being allowed to post a new topic.

I spent a lot of the summer working on a demo in C++ for Windows that uses OpenGL3/GLM/GLEW/Kinect/Bullet Physics/FMOD/Oculus Rift. The code is up on GitHub (with all the dependencies also checked in), so hopefully might be useful to someone somewhere. :)

https://github.com/skooter500/BGE

Pull requests and suggested improvements etc welcome.

And a youtube video here:


This will form the basis of a course Im teaching on Game Engines programming in the Dublin Institute of Technology starting in September. The students will also use the code as the basis of their assignments and this year the theme will be "Magic", so hopefully stuff like force powers, levetation, magic spells etc. - Bryan

15 Replies

  • Thats amazing mate, did you have to write it in C++ or was that a choice?
  • Don't bother with C#, it's easily TWICE as overcomplicated as C++.

    Instead, start with C. It's easy, simple, robust and extremely powerful, and it has the biggest library collection of all languages if you want just reuse someone else's code instead of inventing your own wheels. After you learn C, going to C++ would be a matter of learning some OO techniques. Just starting with C++ is hell and is very likely to result in poor coding skills and very slow learning.

    You can always use C-code to program a C++ app, although C is not entirely compatible with C++ (C++ is completely incompatible with C).
  • elect's avatar
    elect
    Honored Guest
    "Naru" wrote:
    Biggest difference in OpenGL 4 is the removal of the fixed function pipeline.


    Same on OpenGL 3.3
  • stolk's avatar
    stolk
    Honored Guest
    Hi Bryan,

    That's a lot of tech getting integrated. Well done.
    I've been studying the code, and have a question.

    So you are using SDL2, and from what I gather from the code, is that you do the following steps:

    * Connect to the HMD
    * Initialize SDL
    * Create an SDL window
    * Create an SDL OpenGL context
    * Create a framebuffer with glGenFramebuffers()
    * Create a renderbuffer
    * ovrHmd_AttachToWindow()

    I am puzzled by the fact that there is both an SDL window and a manually created framebuffer.
    Is this so that you can render the scene three times?
    Once for desktop monitor.
    Once for HMD left eye
    Once for HMD right eye

    Do I need to create an SDL window at all?
    Isn't rendering into the texture twice enough?
    Or does libOVR depend on SDL creating a window for it?

    Thanks!

    Bram