[SDL] C++ and SDL
Orin K. Tresnjak-Smith
lancekt at wam.umd.edu
Mon Jun 26 08:28:40 PDT 2000
On Mon, 26 Jun 2000, Garrett Banuk wrote:
> SDL isn't designed in an OO fashion though. With SDL you basically call
> a function when you need it. There's no interaction between anything that
> could be formed into an object. Maybe you could fake an object by
> associating surface manipulating functions with the surface you have
> created for example, but SDL's data is almost all internal with function
> calls to access and change stuff. Basically your going to end up with
> objects that can be simplified into function calls.
All true, but it's more of a matter of OOP philosophy and elegance of
design...it would make it easier/prettier for those of us who prefer to
use classes. It's just a wrapper...sort of by definition "faking" it for
the programmer's sake. I don't believe we are talking about rewriting SDL
from scratch with C++ or anything. ;)
> At 08:32 AM 6/26/00 -0400, you wrote:
> >> May i ask- whats the point? Are you considering to use another
> >The point is to allow true Object Oriented design to be possible with SDL.
> >> graphics\audio library in future than sdl? If no, then i see no point of
> >> wrapping those functions. Because SDL is multi platform in its nature,
> >> there is no point to consider portability to other unsupported platforms.
> >This is not for cross-platform capability. We want to have a class
> >structure for events complete with the encapsulation that C++ provides.
> >> And in general, I believe it is useless to write c++ wrapper which just
> >> calls c functions. If there is some additional functionality just then it
> >> might be reasonable.
> >The additional functionality is nothing more than a programming paradigm.
> >I want to do true OOD. C++ wrapper classes that encapsulate the underlying
> >C functions make design easier for someone who wants to do OOD.
> >If you don't use OOD then this whole idea would seem useless. I
> >understand and anticipated this sort of reaction from hard-core C
> >I follow the philosophy of Bjarne Stroustrup when it comes to defending
> >C++ and just say that it is a tool that when used properly can be quite
> >useful. In a phrase C++ gives developers many options but it dangerous
> >when you don't know what you are doing (code bloat, weird design).
> >In essence, you have "Enough rope to shoot yourself in the foot."
> >> Kovacs
> >> On Fri, 23 Jun 2000, Dave wrote:
> >> > I have been using C++ almost exclusively with SDL and I was wondering if
> >> > anyone is working on an SDL class structure for all SDL functionality?
> >> >
> >> > I am wondering if it is possible to organize the library into an Object
> >> > Oriented hierarchy.
> >> >
> >> > I'd like to work on such a project. It would probably be mostly wrappers
> >> > to the C functions and other such abstractions.
> >> >
> >> > Dave
> >> >
> -Garrett, http://www.wpi.edu/~mongoose/
> "Do not go where the path may lead, go instead where there is no path and
> leave a trail."
> -Ralph Waldo Emerson
More information about the SDL