OOP GL
I''m trying to write my projects in C++ but, as you know, OpenGL doesn''t exactly follow the objects paradigm. Has anyone got any idea (or links) how opengl programs can be made to correspond with OOP (even if the objects involved are sightly unobject like if you see what I mean )?
Cheers
You should search for a wrapper class.
But why do you use C++ when you want to follow the OO rules that close. C++ isn''t a pure OO language.
But why do you use C++ when you want to follow the OO rules that close. C++ isn''t a pure OO language.
I''m not quite sure but isn''t there also an OO version of glut, if there is you could use it ??
May the force be with you
There is a OO version of GLUT called GLOW, but it isn''t the easiest thing in the world to use. You best bet is to wrap everything you need in your own classes and use them.
SgtBaker
SgtBaker
I have to agree, just write a wrapper, it will solve your problem, and it is not that hard.
OpenGL fit''s PERFECT into any object oriented program. D3D is ten times harder to encapsulate. The global state nature on OpenGL makes it very easy to encapsulate since the classes don''t need to get linked together. You don''t need to pass states to them or context/device pointers or so.
Tim
--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Tim
--------------------------
glvelocity.gamedev.net
www.gamedev.net/hosted/glvelocity
Tim--------------------------glvelocity.gamedev.netwww.gamedev.net/hosted/glvelocity
Yet again, I''ll try and plug my library ![](smile.gif)
PortaLib3D is a C++ OOP library that uses OpenGL. but what has already been said is right. You can just encapsulate the calls in your own classes. Just make sure you keep track of what changes which states - something I''ve been slack with, I admit
~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
![](smile.gif)
PortaLib3D is a C++ OOP library that uses OpenGL. but what has already been said is right. You can just encapsulate the calls in your own classes. Just make sure you keep track of what changes which states - something I''ve been slack with, I admit
![](sad.gif)
~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
~~~Cheers!Brett PorterPortaLib3D : A portable 3D game/demo libary for OpenGLCommunity Service Announcement: Read How to ask questions the smart way before posting!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement