Jump to content
  • Advertisement
Sign in to follow this  

OpenGL API and structures

Recommended Posts

This question is relative to OpenGL 1, and i suppose subsequent versions as well.

Is there a reason that OpenGL 1 doesn't expose any structures? It seems like the API went trough a lot of trouble to not define any standard structs. Is intentional for some reason like to mitigate for compiler quirks, or to not have to deal with structs being padded differently by compilers? Or is this just coincidence?

Share this post

Link to post
Share on other sites

Why OpenGL 1.x does not contain structures is not a question I have a direct answer for, but my assumption is that it would be better designed that way so driver developers can keep the most complex stuff internal and privatized in their driver code.

Not sure if you know this already, let's take a brief look at why OpenGL came about in the first place.  Before OpenGL was even thought of, there was an API called PHIGS back in 198x.  From what I've read, the main issue with PHIGS is that ultimately it didn't give the developers what they needed in many instances.  So SGI initially created Iris GL, which eventually became the basis for OpenGL in January 1992.  Unlike PHIGS, OpenGL had a simplified state machine and supported an "immediate mode" rendering component.  AFAIK, simplicity was the overall goal, while having a standard that graphics hardware could support via software or hardware all across the board and with little setbacks as possible. 

Prior to what we have today, programming graphics hardware was quite a task and all sorts of structs were everywhere.  I mean, if you take a look at how NVIDIA's gfx registers were laid out and accessed back in 199x (hello NV1 and Riva128), you'll see that each channel is just a series of structs.  OpenGL was meant to simplify graphics programming greatly.  Keep in mind that it was not originally designed for games, but for CAD, 3D simulations, and so forth.  Not that it really matters though...

This is just my two cents.  If I'm wrong about any of this, someone feel free to correct me.


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
Sign in to follow this  

  • 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!