Jump to content
  • Advertisement
Sign in to follow this  
mathematical

OpenGL API and structures

This topic is 424 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

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.

Shogun

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!