PDA

View Full Version : C++ wrappers for GL functions?



mcspanky
11-23-2001, 09:57 AM
Hi all,

In C++, typing "3f" or "3fv" after "glVector" is just silly. What are my options for C++ wrappers to OpenGL? I'm working under Win32, Visual C++ if that matters.

Thanks,
Spanky

pythagoras
11-23-2001, 10:16 AM
You could write your own http://www.opengl.org/discussion_boards/ubb/smile.gif

mcspanky
11-23-2001, 10:19 AM
You don't know how many times I've done that for other APIs...

...or how much I loved programming under BeOS, where the API to the OS is C++.

UrbanLedgend
11-23-2001, 10:34 AM
Well OpenGL is a C API not C++ so get over it.

If you hate typing that much then write your own rappers.

For me I prefer the way it is, because I know I'm using the correct function for what I want.

mcspanky
11-23-2001, 11:41 AM
> Well OpenGL is a C API not C++ so get over it.

Actually, OpenGL is a binary API. You can write wrappers/headers for it in any language. As the spec points out.

Ashtray_W
11-23-2001, 11:47 AM
Alright! Let's do the COBOL API! How about a PL/1 or AS/400 API? (Hehehehe.... now THAT would be fun :-) )

jmg
11-23-2001, 03:03 PM
'Panky,

I don't really know beans about this, but I think that part of the beauty of OGL is that it fits so nicely into your own methods of your own classes. I mean, nobody looks at my MyBGLView::drawX() but me... Inside there, I don't really mind mucking around with the 3f's or 3fv's because they're contained.

UrbanLedgend
11-23-2001, 07:16 PM
"Actually, OpenGL is a binary API. You can write wrappers/headers for it in any language. As the spec points out."

It's still a C API that is distributed in a binary form (normally), the exposed interface is C exposed via the headers.

Bob
11-24-2001, 11:28 AM
What about OpenGL for other languages then, like BASIC, FORTRAN? Binding for several languages exists, including C. C just happen to be one of the more used languages.