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:
- probably more code
- unnecessary complexity
- 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 thatthe
source was documented or something
Cheers, Kai
ā
Kai Blin Linux system administrator Tel: Ring-86592
Allgemeine Chirurgie Universitaetsklinikum TuebingenBaseball is a skilled game. Itās Americaās game - it, and high taxes.
ā The Best of Will Rogers