Forum Discussion

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

Why Win32+GL is blocked?

In Oculus SDK 0.2.4 + Render_GL_Win32_Device.cpp, cannot create RenderDevice because It return NULL!

// Implement static initializer function to create this class.
Render::RenderDevice* RenderDevice::CreateDevice(const RendererParams&, void* oswnd)
{
......
// return new RenderDevice(rp, hwnd, dc, context);
return 0;
}

after i modify some code like above, Win32+GL works!

I have question, oculus sdk win32+gl is work well, why block it?

4 Replies

  • I suspect because it requires additional setup. The GL headers for windows don't include glext.h in many instances. While DirectX is a known working solution, GL would require additional setup of going to the OpenGL website, downloading the appropriate header and putting it in the correct location. Anyone with the skills and understanding to do that will probably be able to figure out how to make the render device work as well.
  • Also, besides "glext.h" no longer being available amongst the Windows/DX SDK header files, Microsoft does not provide an "opengl.lib" file so that you can link against "opengl.dll" and resolve all the OpenGL function call symbols!
    You see, Microsoft does support OpenGL... they have for a long time... they've almost "had to"... but they seem discourage its use in favor of DirectX/3D.

    So to get Win32+GL to work: not only do you have to grab yourself a "glext.h" (like from opengl.org), you'll also need something like GLee.c/GLee.h -- which I highly recommend. The GLee project loads the GL DLL and establishes the linkages manually (e.g., by using GetProcAddress()), so it does all the work. Just be sure to #include "GLee.h" wherever necessary!

    It's awfully nice to be able to write code once that ports to multiple platforms. C++ and GL allow this. The Oculus guys have also done a bang-up job with their CommonSrc/Platform code. Nice going, guys!

    Tadd