Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C++ wrappers for OpenGL?

Reply
Thread Tools

C++ wrappers for OpenGL?

 
 
Rune Allnor
Guest
Posts: n/a
 
      12-10-2009
Hi all.

I am messing around with some OpenGL code, and am
starting to get fed up with the hungarian notation.

Are there any decent C++ wrappers out there?

Rune
 
Reply With Quote
 
 
 
 
Hamiral
Guest
Posts: n/a
 
      12-10-2009
Rune Allnor wrote:
> Hi all.
>
> I am messing around with some OpenGL code, and am
> starting to get fed up with the hungarian notation.
>
> Are there any decent C++ wrappers out there?


Why do you need a C++ wrapper for OpenGL ? There is no hungarian
notation in OpenGL, so I'm quite curious where you found it...

Ham
 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      12-10-2009
Hamiral wrote:
> Rune Allnor wrote:
>> Hi all.
>>
>> I am messing around with some OpenGL code, and am
>> starting to get fed up with the hungarian notation.
>>
>> Are there any decent C++ wrappers out there?

>
> Why do you need a C++ wrapper for OpenGL ? There is no hungarian
> notation in OpenGL, so I'm quite curious where you found it...


Perhaps Rune refers to the suffixes (4ub, 3f, etc.) on functions that
could/would be simply overloaded in C++...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
 
Reply With Quote
 
Rune Allnor
Guest
Posts: n/a
 
      12-10-2009
On 10 Des, 17:47, Victor Bazarov <v.Abaza...@comAcast.net> wrote:
> Hamiral wrote:
> > Rune Allnor wrote:
> >> Hi all.

>
> >> I am messing around with some OpenGL code, and am
> >> starting to get fed up with the hungarian notation.

>
> >> Are there any decent C++ wrappers out there?

>
> > Why do you need a C++ wrapper for OpenGL ? There is no hungarian
> > notation in OpenGL, so I'm quite curious where you found it...

>
> Perhaps Rune refers to the suffixes (4ub, 3f, etc.)


I am indeed...

> on functions that
> could/would be simply overloaded in C++...


....which is why I am pretty sure somebody already have
made these kinds of wrappers.

Rune
 
Reply With Quote
 
Hamiral
Guest
Posts: n/a
 
      12-10-2009
Victor Bazarov wrote:
> Hamiral wrote:
>> Rune Allnor wrote:
>>> Hi all.
>>>
>>> I am messing around with some OpenGL code, and am
>>> starting to get fed up with the hungarian notation.
>>>
>>> Are there any decent C++ wrappers out there?

>>
>> Why do you need a C++ wrapper for OpenGL ? There is no hungarian
>> notation in OpenGL, so I'm quite curious where you found it...

>
> Perhaps Rune refers to the suffixes (4ub, 3f, etc.) on functions that
> could/would be simply overloaded in C++...


Oh ok.
I'm so used to them that I just didn't notice they could pose problems
to C++ programmers

Ham
 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      12-10-2009
Rune Allnor wrote:
> On 10 Des, 17:47, Victor Bazarov <v.Abaza...@comAcast.net> wrote:
>> Hamiral wrote:
>>> Rune Allnor wrote:
>>>> Hi all.
>>>> I am messing around with some OpenGL code, and am
>>>> starting to get fed up with the hungarian notation.
>>>> Are there any decent C++ wrappers out there?
>>> Why do you need a C++ wrapper for OpenGL ? There is no hungarian
>>> notation in OpenGL, so I'm quite curious where you found it...

>> Perhaps Rune refers to the suffixes (4ub, 3f, etc.)

>
> I am indeed...
>
>> on functions that
>> could/would be simply overloaded in C++...

>
> ...which is why I am pretty sure somebody already have
> made these kinds of wrappers.


I honestly doubt that. OpenGL programmers are pretty hard-core and they
just shrug those suffixes off, unlike those soft and mellow C++
object-oriented folk, who shudder even from a thought of using a C API
without a wrapper.

What you are most likely going to see is a whole framework around OpenGL
or DirectX (or both), abstracting not only color or matrix setting but
also the entire scene graph, providing caching, and so forth. There is
no sense doing only the first step by simply wrapping OpenGL in C++
overloaded functions.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
 
Reply With Quote
 
Victor Bazarov
Guest
Posts: n/a
 
      12-10-2009
Hamiral wrote:
> Victor Bazarov wrote:
>> Hamiral wrote:
>>> Rune Allnor wrote:
>>>> Hi all.
>>>>
>>>> I am messing around with some OpenGL code, and am
>>>> starting to get fed up with the hungarian notation.
>>>>
>>>> Are there any decent C++ wrappers out there?
>>>
>>> Why do you need a C++ wrapper for OpenGL ? There is no hungarian
>>> notation in OpenGL, so I'm quite curious where you found it...

>>
>> Perhaps Rune refers to the suffixes (4ub, 3f, etc.) on functions that
>> could/would be simply overloaded in C++...

>
> Oh ok.
> I'm so used to them that I just didn't notice they could pose problems
> to C++ programmers


They don't, really. No offense intended, but only the programmer who
*has nothing better to do* would think about introducing a wrapper just
to get rid of some suffixes in C API. So, if somebody at some point had
nothing to do, and made such a wrapper library, Rune might be able to
reuse that. I can see why - there is no sense in wasting time for that.
But herein lies the conundrum (and Rune understands that, I hope)
that if it's not worth Rune's time to create such code, then it is not
worth anybody else's. That's why thin wrappers like that just don't exist.

Bite the bullet, Rune. Either keep using OpenGL API as is (like we all
do) with all the unpleasant and annoying suffixes (that you need to get
right or it doesn't compile!), or write the wrapper yourself. Maybe if
you write one, I would reuse it... Nah. We're beyond using OpenGL or
DirectX, we have a whole abstracting framework for our stuff, which is
what I recommend you use as well.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
 
Reply With Quote
 
Robert Hairgrove
Guest
Posts: n/a
 
      12-10-2009
Rune Allnor wrote:
> Hi all.
>
> I am messing around with some OpenGL code, and am
> starting to get fed up with the hungarian notation.
>
> Are there any decent C++ wrappers out there?
>
> Rune


Have you had a look at the Qt libraries yet?
 
Reply With Quote
 
Rune Allnor
Guest
Posts: n/a
 
      12-10-2009
On 10 Des, 21:31, Robert Hairgrove <rhairgr...@bigfoot.com> wrote:
> Rune Allnor wrote:
> > Hi all.

>
> > I am messing around with some OpenGL code, and am
> > starting to get fed up with the hungarian notation.

>
> > Are there any decent C++ wrappers out there?

>
> > Rune

>
> Have you had a look at the Qt libraries yet?


I'm using it. Qt provides everything down to the
point where to actually draw the scene. Then you
need to get down to OpenGL functions.

Rune
 
Reply With Quote
 
Hamiral
Guest
Posts: n/a
 
      12-10-2009
Victor Bazarov wrote:
> Bite the bullet, Rune. Either keep using OpenGL API as is (like we all
> do) with all the unpleasant and annoying suffixes (that you need to get
> right or it doesn't compile!), or write the wrapper yourself. Maybe if
> you write one, I would reuse it... Nah. We're beyond using OpenGL or
> DirectX, we have a whole abstracting framework for our stuff, which is
> what I recommend you use as well.


I'd add that most of OpenGL functions are commands for which speed is
particularly critical, so adding an OOP overlay on top of the
specialized functions like glVertex3f or glTexCoord2f (1) and alike,
would be a significant overhead, as these functions can get called
millions of times each frame (so more than 70 million times per second).
So, as they must execute the fastest possible, even a 0.001ms (2)
overhead for each call would be a very noticeable performance hit.

(1) If Rune is concerned with the suffixes, I consider he uses immediate
mode, so no vertex arrays (which would by the way add a bit of
performance and of abstraction, which would be interesting in his
particular case).
(2) I don't know how much time would it take, but usually OpenGL
programmers are dealing with lots of lots of vertices and polygons, and
thus function calls, so any tiny amount of time per call would rapidly
get noticeable.

Ham
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.Net 2.0 and the annoying <div> wrappers =?Utf-8?B?UGF0cmljaw==?= ASP .Net 8 04-25-2005 02:28 PM
Should resource wrappers auto cleanup on destruct? Julie C++ 4 01-28-2005 02:20 AM
How to lower warning level? [header wrappers, GCC] Maciej Pilichowski C++ 3 01-09-2005 02:51 AM
Managed wrappers in ASP.NET Session mirek ASP .Net 5 10-21-2003 04:52 AM
Use Collection classes or create wrappers for them? Lucas White Java 5 10-15-2003 03:39 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57