Jump to content
  • Advertisement
NihilPointer

OpenGL BarebonesGL, OpenGL rendering without helper libraries

Recommended Posts

Imagine you are Valve or ID or Dice, and your team is going to create a new engine to run your company's main titles for the next decade. You want an engine that is innovative and flexible, can knock socks off next year and still impress gamers 5 years down the road. 

Would someone in this position use helper libraries like GLUT aor GLFW or GLM or would they create their own libraries for their project and do the win API stuff manually?

Share this post


Link to post
Share on other sites
Advertisement

It all depends. GLUT is ancient and irrelevant, but several other foundational libraries are perfectly viable as long as they're open source. The real issue nowadays is that graphics APIs are changing, platforms are coming and going, and professional studios need to be buffered against all of those changes. A math library needs to be flexibly ported to different CPU architectures with different SIMD instruction sets. Windowing libraries need to be expandable to handle platforms that may not even be publicly announced. You can't very well have MS come to you for an Xbox 4 demo and not be able to adapt to the platform.

For those reasons, these core libraries can act as very short term gains, but in the long view it's more beneficial to control the underpinnings yourself.

Share this post


Link to post
Share on other sites

I don't think so. The open source libraries will usually not work for consoles, because those are using their own proprietary APIs. And the big studios can just put some coders onto implementing a platform specific API. I think it is also much easier than to worry about open source licenses. Plus in the end they will have a better customizable and optimizable solution.

Then there are also big well known helper libraries, which usually cost money, like Havoc physics, Simplygon, Fmod, etc... Big studios usually prefer these as they are not ambiguously licensed and well tested in a professional environment and come with support.

Share this post


Link to post
Share on other sites
Posted (edited)
1 hour ago, NihilPointer said:

Would someone in this position use helper libraries like GLUT aor GLFW or GLM or would they create their own libraries for their project and do the win API stuff manually?

Main problem of GL is library loader. Anything else very similar to DX. But it require a huge code to load a full set of functions. I has experimented with self-made loader. With safety-stubs for absent functions and extensions not supported by actual hardware, it require no less then 20k lines of code to implement. Fortuantely it can be done by parsing opengl extensions header file and generate required code by algo.

Edited by Fulcrum.013

Share this post


Link to post
Share on other sites

That's what I thought. I figured these libraries that every YouTube tutorial ever tells you to install before you can make your first rainbow colored triangle, are just convenience's and learning aids. Actually taking on a professional product is going to require a lot more customization and is probably a large reason many games from many developers tend to license well established engines like Unreal and Frostbite, and then go on to focus on content creation etc. 

With that in mind, does anyone know of any good resources for learning how to interface with the OGL API directly through c++? Things like context creation through Win32 API or creating and compiling shaders without using those ever so convenient wrappers the toolkits provide?

Share this post


Link to post
Share on other sites
3 minutes ago, NihilPointer said:

With that in mind, does anyone know of any good resources for learning how to interface with the OGL API directly through c++? Things like context creation through Win32 API or creating and compiling shaders without using those ever so convenient wrappers the toolkits provide?

https://www.khronos.org/registry/OpenGL-Refpages/gl4/

Under windows it just require to cretae 1.1 context, get GL-specific loader proc (wglGetProcAddress under windows), that similar to GetProcAdress, and load required functions from driver. After obtain loader proc, that can be platform-specific, loading of functions works same for any platform. Really OGL 4.5 with extensions have over 5k functions with different signatures to load. Hardest part is to handle a set of pointers to functions, list of functions to load , stubs and warp-arounds with matching signatures.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!