Better yet, use Pascal! (was Re: Stop porting C code to C++)

:wink:
RK.

Patrick Kooman wrote:>Maybe off-topic butā€¦,

although I am a C++ programmer for years, I have something against porting C
code to C++ code. Because something was originally written in C, means that
it was designed from a procedural point of view. It you wrap a class around
it, does NOT make it proper OOP. Because most APIā€™s have some kind of
initialize method, like SDL_Init for example. Using OOP you cannot call this
function from a constructor, because then it would be called every time. So,
in the end youā€™ll end up with some static methods (read: functions) and
static members (read: global-variables). As a result you get:

  1. probably more code
  2. unnecessary complexity
  3. Unnatural feeling

Donā€™t get me wrong, this was NOT a flame! Iā€™m just ā€˜warningā€™ you. For
example: I used to have some singletons in my project, a Video object, a
Soundsystem object and some resource-management objects. I ā€˜strippedā€™ the
class-code and made them APIā€™s, and guess what? It feels so much natural
(sorry, second time) when calling a function. So, I made myself a new
"rule": when I only need one instance, I donā€™t make a class, just a set of
functions. I use objects though, for my game objects like tiles, animations,
enemies and such. Because those kind of object makes you think in objects,
so that in feels very comfortable and logic to do soā€¦

Kind regards (I mean it),

Patrick.

----- Original Message -----
From: ā€œKai Blinā€ <kai.blin at med.uni-tuebingen.de>
To:
Sent: Thursday, August 15, 2002 6:31 AM
Subject: Re: [SDL] Howto dipslay a text with SDL?

On Wednesday 14 August 2002 23:29, Jacek Pop?awski wrote:

On Wed, Aug 14, 2002 at 02:41:47PM +0200, Jean wrote:

I mean how can I write a text in my sdl window?

Please seach for ā€œSfontā€.

If youā€™re doing C++, you might want to have a look at SoFont, too. Itā€™s

not

quite up to date, and I canā€™t seem to reach the developers, but Iā€™m just
trying to port SFont to C++ again, and SoFont is a great help. (Not that

the

source was documented or something :wink:

Cheers, Kai

ā€“
Kai Blin Linux system administrator Tel: Ring-86592
Allgemeine Chirurgie Universitaetsklinikum Tuebingen

Baseball is a skilled game. Itā€™s Americaā€™s game - it, and high taxes.
ā€“ The Best of Will Rogers