Help my feeble brain

Sam,
I have been looking at SDL for a while now, and like I said before I have a
group of programmers together, and we want to write a game. Most of us are
not very experienced, but you have to start somewhere. Anyway, I wrote to the
list a yesterday, but no one replied, I suspect because my question is so
basic, and shows my lack of experience. I haven’t ever really used straight
C, so I am unfamiliar with how it integrates with C++. I really don’t know
how much C++ specific stuff we will be using anyway, but C++ is what most of
the people in my group are familiar with. From the demos in SDL, it looks
like using C++ won’t be a problem, what do you think?

The game we are planning will be GPLed, and is an overhead tile-based kill
everything game.

			Josef Wells_

Program (pro’gram), n. A magical spell cast over a computer that turns
one’s input into error messages. v. To engage in an activity similar to
banging one’s head into a wall, but with less opportunity for reward.

Wise words from Josef Wells .aka. Scrub .aka. MadMan, for more, write
jwells at ece.utexas.edu

Anyway, I wrote to the
list a yesterday, but no one replied, I suspect because my question is so
basic, and shows my lack of experience.

Or perhaps many of them haven’t used C++ with SDL

I haven’t ever really used straight
C, so I am unfamiliar with how it integrates with C++. I really don’t know
how much C++ specific stuff we will be using anyway, but C++ is what most of
the people in my group are familiar with. From the demos in SDL, it looks
like using C++ won’t be a problem, what do you think?

Using C++ will not be a problem. One of the tricks you have to know is all
C++ files end in .cc …so if you want your test demo to compile, you have
to rename the source file from say… test.c to test.cc

The game we are planning will be GPLed, and is an overhead tile-based kill
everything game.

Sounds fun! Let me know when it’s available!

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Using C++ will not be a problem. One of the tricks you have to know is all
C++ files end in .cc …so if you want your test demo to compile, you have
to rename the source file from say… test.c to test.cc

I also have to add to the makefiles so that c++ files get the same flags
as C files… by adding lines like CPPFLAGS = blah, where there is a
CFLAGS = blah. I also need to instruct the Makefile to compile using c++
by replacing $(CC) by $(CXX):

test$(EXE): test.o $(SDLLIB)
$(CXX) -o $@ test.o $(WINLIBS)

Right??

Sounds fun! Let me know when it’s available!

Don’t worry, I will. Thanks for the great library and advice, it
certainly makes the task seem less daunting.
JosefOn Thu, 6 Aug 1998, Sam Lantinga wrote:
_
Program (pro’gram), n. A magical spell cast over a computer that turns
one’s input into error messages. v. To engage in an activity similar to
banging one’s head into a wall, but with less opportunity for reward.

Wise words from Josef Wells .aka. Scrub .aka. MadMan, for more, write
@Josef_Wesley_Wells

I’ll be building BeOS 3.2 Intel and PPC in the next few days,
and I will try again at the sdldoom.

Best Regards,
David Sowsy

I also have to add to the makefiles so that c++ files get the same flags
as C files… by adding lines like CPPFLAGS = blah, where there is a
CFLAGS = blah. I also need to instruct the Makefile to compile using c++
by replacing $(CC) by $(CXX):

test$(EXE): test.o $(SDLLIB)
$(CXX) -o $@ test.o $(WINLIBS)

Right??

Yup! That’s right! :slight_smile:

You might also check out the projects in
http://www.devolution.com/~slouken/SDL/SDL-demos.tar.gz

There are a few C++ demos in there that use a common Makefile format.

Don’t worry, I will. Thanks for the great library and advice, it
certainly makes the task seem less daunting.

I’m glad. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/