C++ and SDL

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

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.

I’m also using C++. You could wrap it fairly easily, I was doing a
similar thing in GTK+ a few years ago. I haven’t bothered with SDL. I
just let my classes call the underlying C functions, and my classes are
OO enough that this remains at a low level, and use of my classes is
nice.–
Marc A. Lepage
Software Developer
Molecular Mining Corporation
http://www.molecularmining.com/

GTK-- is a nice package of GTK wrappers I believe.

Anyway. I am proposing something different. Instead of writing objects
for games that use public scope C functions you could have a class
SDL_SURFACE that has the functions Blit_Surface and other sort of things.

I am just thinking “out loud” right now but if anyone else thinks its a
good idea it could become a neat project.

For certain parts of SDL it may make more sense than others. I be the
event structure could be done nicely in a class as well. (SDL_Event).

What do you think?

(I know many people are afraid of C++ and some really hate it (bigotry and
other reasons) but it can be nice devel tool if you become friends with
it)

DaveOn Fri, 23 Jun 2000, Marc A. Lepage wrote:

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.

I’m also using C++. You could wrap it fairly easily, I was doing a
similar thing in GTK+ a few years ago. I haven’t bothered with SDL. I
just let my classes call the underlying C functions, and my classes are
OO enough that this remains at a low level, and use of my classes is
nice.


Marc A. Lepage
Software Developer
Molecular Mining Corporation
http://www.molecularmining.com/

Well, if a C++ SDL came around, I’d certainly be interested. I think
polling for events is the most nasty part. I wish I could have some
object that could be setup to receive SDL events, instead of saying “now
you poll and you stop polling”.

I guess the nice thing about the way SDL is now, is that it is very simple
and raw. You can take the basic C functions and build up from there.> ----- Original Message -----

From: owner-sdl@lokigames.com [mailto:owner-sdl at lokigames.com]On Behalf
Of Dave
Sent: Friday, June 23, 2000 2:13 PM
To: sdl at lokigames.com
Subject: Re: [SDL] C++ and SDL

GTK-- is a nice package of GTK wrappers I believe.

Anyway. I am proposing something different. Instead of writing objects
for games that use public scope C functions you could have a class
SDL_SURFACE that has the functions Blit_Surface and other sort of things.

I am just thinking “out loud” right now but if anyone else thinks its a
good idea it could become a neat project.

For certain parts of SDL it may make more sense than others. I be the
event structure could be done nicely in a class as well. (SDL_Event).

What do you think?

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

Very good idea. I wloud help you, if it turns to serious.

KuLT

Are you guys talking about rewriting the SDL library in C++?? It’s a
low level library, C++ won’t do anything useful for it other than create
alot of work for everyone, and if SDL is in C++ what happens to all the
projects written in C?

I thought we were re-writing it in LISP?

m.On Fri, Jun 23, 2000 at 08:15:08PM -0400, Garrett Robert Banuk wrote:

Are you guys talking about rewriting the SDL library in C++?? It’s a
low level library, C++ won’t do anything useful for it other than create
alot of work for everyone, and if SDL is in C++ what happens to all the
projects written in C?


Programmer “Ha ha.” “Ha ha.” "What are you laughing at?"
Loki Software "Just the horror of being alive."
http://lokigames.com/~briareos/ - Tony Millionaire

Michael Vance wrote:

Are you guys talking about rewriting the SDL library in C++?? It’s a
low level library, C++ won’t do anything useful for it other than create

I believe they were talking about writing a C++ wrapper for SDL.

alot of work for everyone, and if SDL is in C++ what happens to all the
projects written in C?

I thought we were re-writing it in LISP?

Yes, someone should write Scheme bindings for SDL ;-)> On Fri, Jun 23, 2000 at 08:15:08PM -0400, Garrett Robert Banuk wrote:


Daniel Vogel
Programmer
Loki Entertainment Software

I’d rather do my own wrappers. There is enough simplicity in the API. Let’s
not overdo it.

“Dave” wrote in message
news:Pine.GSO.4.10.10006231318330.2587-100000 at phoenix.lhup.edu…> 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

Are you guys talking about rewriting the SDL library in C++?? It’s a
low level library, C++ won’t do anything useful for it other than create
alot of work for everyone, and if SDL is in C++ what happens to all the
projects written in C?

no, they’re talking about writing a set of wrapper classes for it in
C++. My /bin/sh wrappers are almost done, but they’re not very OO.

I know you’re jealous.On Fri, 23 Jun 2000, Garrett Robert Banuk wrote:


Blue Lang Unix Systems Admin
QSP, Inc., 3200 Atlantic Ave, Ste 100, Raleigh, NC, 27604
Home: 919 835 1540 Work: 919 875 6994 Fax: 919 872 4015

I thought we were re-writing it in LISP?

Now we’re talking!

(I have seriously contemplated Dylan bindings, in fact…)

I thought we were re-writing it in LISP?

Yay, now for Lokisoft games in Emacs!–
“I know not with what weapons World War III will be fought, but I know
that World War IV will be four with sticks and stones.” — Einstein

Heh, don’t laugh. Look what happened when GTK got popular. Sheesh, we
could end up with Perl bindings for SDL, oh and don’t forget Ada, and
what’s that “new” language Microsoft came up with? Hmmm, maybe I should
just stick to c… :slight_smile:

Mike

Daniel Vogel wrote:> > I thought we were re-writing it in LISP?

Yes, someone should write Scheme bindings for SDL :wink:

Hello Guys,

I think it would be a very important piece in the SDL project. I

use C++ too, and I would love to see that SDLEvent class :slight_smile:

Eduardo.On Fri, 23 Jun 2000, Dave wrote:

GTK-- is a nice package of GTK wrappers I believe.

Anyway. I am proposing something different. Instead of writing objects
for games that use public scope C functions you could have a class
SDL_SURFACE that has the functions Blit_Surface and other sort of things.

I am just thinking “out loud” right now but if anyone else thinks its a
good idea it could become a neat project.

For certain parts of SDL it may make more sense than others. I be the
event structure could be done nicely in a class as well. (SDL_Event).

What do you think?

(I know many people are afraid of C++ and some really hate it (bigotry and
other reasons) but it can be nice devel tool if you become friends with
it)

Dave

On Fri, 23 Jun 2000, Marc A. Lepage wrote:

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.

I’m also using C++. You could wrap it fairly easily, I was doing a
similar thing in GTK+ a few years ago. I haven’t bothered with SDL. I
just let my classes call the underlying C functions, and my classes are
OO enough that this remains at a low level, and use of my classes is
nice.


Marc A. Lepage
Software Developer
Molecular Mining Corporation
http://www.molecularmining.com/

We aren’t saying “Lets do SDL in C++ and the C version won’t exist
anymore…” I don’t have the time or power or the authorization from Sam
to do that to his wonderful library.

All I am saying is I am a C++ programmer who would like to use an Object
Oriented Interface to SDL to make my program design better. I like C also
but I program mostly in C++. There is a difference to how things are
handled.

DaveOn Fri, 23 Jun 2000, Garrett Robert Banuk wrote:

Are you guys talking about rewriting the SDL library in C++?? It’s a
low level library, C++ won’t do anything useful for it other than create
alot of work for everyone, and if SDL is in C++ what happens to all the
projects written in C?

If you know how to bind stuff to LISP then you know more LISP than I. (I
actually like LISP, I know I am a massochist)

DaveOn Sat, 24 Jun 2000, Mattias Engdegard wrote:

I thought we were re-writing it in LISP?

Now we’re talking!

(I have seriously contemplated Dylan bindings, in fact…)

C# (C - sharp (Pound))
And there are python bindings for SDL.On Fri, 23 Jun 2000, Michael Vanecek wrote:

Heh, don’t laugh. Look what happened when GTK got popular. Sheesh, we
could end up with Perl bindings for SDL, oh and don’t forget Ada, and
what’s that “new” language Microsoft came up with? Hmmm, maybe I should
just stick to c… :slight_smile:

Mike

Daniel Vogel wrote:

I thought we were re-writing it in LISP?

Yes, someone should write Scheme bindings for SDL :wink:

Ok so it seems there is a mixed response to this idea but enough interest
to pursue it. I have a bunch of things I am doing right now in C++ with
SDL as it is. Perhaps I can get the group I am working with to help with
a set of wrappers for SDL in C++. I want to get this project finished
first and then work on SDL in C++.

If anyone else wants to start this project don’t feel that you are
stealing an idea. Please begin without me. I would like to catch up
with you later though! :slight_smile:

Many people seem to like this idea and it may indeed draw more academic
programmers to SDL. (Since all they teach at the school I went to is C++
and not some of the C details that can confuse a beginning C++
programmer).

Well thanks for all the responses.

DaveOn Sat, 24 Jun 2000, Eduardo B. Fonseca wrote:

Hello Guys,

I think it would be a very important piece in the SDL project. I
use C++ too, and I would love to see that SDLEvent class :slight_smile:

Eduardo.

On Fri, 23 Jun 2000, Dave wrote:

GTK-- is a nice package of GTK wrappers I believe.

Anyway. I am proposing something different. Instead of writing objects
for games that use public scope C functions you could have a class
SDL_SURFACE that has the functions Blit_Surface and other sort of things.

I am just thinking “out loud” right now but if anyone else thinks its a
good idea it could become a neat project.

For certain parts of SDL it may make more sense than others. I be the
event structure could be done nicely in a class as well. (SDL_Event).

What do you think?

(I know many people are afraid of C++ and some really hate it (bigotry and
other reasons) but it can be nice devel tool if you become friends with
it)

Dave

On Fri, 23 Jun 2000, Marc A. Lepage wrote:

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.

I’m also using C++. You could wrap it fairly easily, I was doing a
similar thing in GTK+ a few years ago. I haven’t bothered with SDL. I
just let my classes call the underlying C functions, and my classes are
OO enough that this remains at a low level, and use of my classes is
nice.


Marc A. Lepage
Software Developer
Molecular Mining Corporation
http://www.molecularmining.com/

I do my stuff in C++ also, and would love to have a better wrapper (than
my own feeble attempt).

Count me in for help!

/Thomas

Dave wrote:>

Ok so it seems there is a mixed response to this idea but enough interest
to pursue it. I have a bunch of things I am doing right now in C++ with
SDL as it is. Perhaps I can get the group I am working with to help with
a set of wrappers for SDL in C++. I want to get this project finished
first and then work on SDL in C++.

If anyone else wants to start this project don’t feel that you are
stealing an idea. Please begin without me. I would like to catch up
with you later though! :slight_smile:

Many people seem to like this idea and it may indeed draw more academic
programmers to SDL. (Since all they teach at the school I went to is C++
and not some of the C details that can confuse a beginning C++
programmer).

Well thanks for all the responses.

Dave

On Sat, 24 Jun 2000, Eduardo B. Fonseca wrote:

Hello Guys,

  I think it would be a very important piece in the SDL project. I

use C++ too, and I would love to see that SDLEvent class :slight_smile:

Eduardo.

On Fri, 23 Jun 2000, Dave wrote:

GTK-- is a nice package of GTK wrappers I believe.

Anyway. I am proposing something different. Instead of writing objects
for games that use public scope C functions you could have a class
SDL_SURFACE that has the functions Blit_Surface and other sort of things.

I am just thinking “out loud” right now but if anyone else thinks its a
good idea it could become a neat project.

For certain parts of SDL it may make more sense than others. I be the
event structure could be done nicely in a class as well. (SDL_Event).

What do you think?

(I know many people are afraid of C++ and some really hate it (bigotry and
other reasons) but it can be nice devel tool if you become friends with
it)

Dave

On Fri, 23 Jun 2000, Marc A. Lepage wrote:

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.

I’m also using C++. You could wrap it fairly easily, I was doing a
similar thing in GTK+ a few years ago. I haven’t bothered with SDL. I
just let my classes call the underlying C functions, and my classes are
OO enough that this remains at a low level, and use of my classes is
nice.


Marc A. Lepage
Software Developer
Molecular Mining Corporation
http://www.molecularmining.com/

Forgive me; this is kind of long. =)

I’m currently writing (well, mostly planning) a C++ library to facilitate
OOP game programming. You would use it by deriving classes specific to
your game from generic classes provided. (Kind of like Winblows MFC, I
guess?) A C++ wrapper for SDL would be very helpful for this, since I was
planning to build it on top of SDL. I’ll probably end up writing a
rudimentary one myself. (My Angel Wars game already uses a rudimentary
C++ wrapper for a lot of SDL functionality, actually, but it’s probably
too specialized to be of any real use.)

The library would provide base classes that could easily handle things
like list management, error reporting, etc. (In addition, of course, to
video, audio, input, and such.) I’m also planning to provide
a simple way to store and retrieve bitmap/sound data in memory, and some
other stuff to generally reduce the grunt work of writing
(simple) games. This would mainly, I suppose, be oriented toward
beginning programmers, to make this incredibly boring stuff relatively
easy. Elegance would thus be more important than efficiency, at least to
begin with. :slight_smile:

So, anyway…I’m writing this to:

(1) Put the idea into the open
(2) Ask for ideas/help/advice/flames :wink:
(2) Offer help with designing/writing a C++ SDL wrapper

  • lancekt

projects:
angel-wars.sourceforge.net
ooga.sourceforge.net