SDL_Layer

Hi,

I’ve created a space on google code where those interested can download the latest
header of SDL_Layer:

http://code.google.com/p/sdl-layer/downloads/list

(Choose the SDL_Layer.h file, not the other one)

I’m looking forward to receiving your precious advices and remarks.

Julien_____________________________________________________________________________
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr

Okay, here we go…

  • All names with two consecutive underscores or beginning with an underscore
    followed by a capital letter are reserved and you must not use them unless
    you are implementing C (or C++). SDL_LayeredDisplay_h and
    SDL_LayeredDisplay therefore make this code already invalid C, and that
    without the underscores adding anything IMHO.

  • There is no reason that a struct tag can’t have the same name as a
    typename, so “typedef struct SDL_LayeredDisplay SDL_LayeredDisplay;” could
    as well be “typedef struct SDL_LayeredDisplay SDL_LayeredDisplay;” or you
    could just as well spell out the ‘struct’ in the header at least and just
    abbreviate it in the implementation.

  • Use of SDL_ names further invades into the SDL namespace, which poses a
    risk for collisions. Unless you intend to make this part of SDL proper, I
    would suggest a different prefix.

  • “there’re” - typo, should be “they’re” or “they are”.

  • “Useful only when the display size is bigger than the display size.” -
    bigger than itself?

UliOn Sunday 15 June 2008 21:23:01 julien CLEMENT wrote:

http://code.google.com/p/sdl-layer/downloads/list

(Choose the SDL_Layer.h file, not the other one)

I’m looking forward to receiving your precious advices and remarks.

Ulrich,

Thank you for your remarks. I’ll see what I can do.
I didn’t really get you when you say:

“All names with two consecutive underscores or beginning with an underscore
followed by a capital letter are reserved and you must not use them unless
you are implementing C”

because I’m gonna implement this tool in C. I don’t know which function names
to choose because I want the prototypes being both clear and handy. I prefer
longer names which are clear rather than short ambiguous names.
As for the prefix stuff, I think about using “SDLayer” which would shorten
most of my function prototypes.

Sorry to do a bit of english here, but should I change:
“even if there’re pending dirty rectangles to update"
into
"even if they’re pending dirty rectangles to update”

as well ?

To finish, what’s your opinion about the utility of such an API ?

Thanks to you

Julien

----- Message d’origine ----De : Ulrich Eckhardt
? : sdl at lists.libsdl.org
Envoy? le : Mercredi, 18 Juin 2008, 7h27mn 29s
Objet : Re: [SDL] SDL_Layer

On Sunday 15 June 2008 21:23:01 julien CLEMENT wrote:

http://code.google.com/p/sdl-layer/downloads/list

(Choose the SDL_Layer.h file, not the other one)

I’m looking forward to receiving your precious advices and remarks.

Okay, here we go…

  • All names with two consecutive underscores or beginning with an underscore
    followed by a capital letter are reserved and you must not use them unless
    you are implementing C (or C++). SDL_LayeredDisplay_h and
    SDL_LayeredDisplay therefore make this code already invalid C, and that
    without the underscores adding anything IMHO.

  • There is no reason that a struct tag can’t have the same name as a
    typename, so “typedef struct SDL_LayeredDisplay SDL_LayeredDisplay;” could
    as well be “typedef struct SDL_LayeredDisplay SDL_LayeredDisplay;” or you
    could just as well spell out the ‘struct’ in the header at least and just
    abbreviate it in the implementation.

  • Use of SDL_ names further invades into the SDL namespace, which poses a
    risk for collisions. Unless you intend to make this part of SDL proper, I
    would suggest a different prefix.

  • “there’re” - typo, should be “they’re” or “they are”.

  • “Useful only when the display size is bigger than the display size.” -
    bigger than itself?

Uli


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

  _____________________________________________________________________________ 

Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr

julien CLEMENT wrote:

Ulrich,

Thank you for your remarks. I’ll see what I can do.
I didn’t really get you when you say:

“All names with two consecutive underscores or beginning with an underscore
followed by a capital letter are reserved and you must not use them unless
you are implementing C”

because I’m gonna implement this tool in C. I don’t know which function
names
to choose because I want the prototypes being both clear and handy. I prefer
longer names which are clear rather than short ambiguous names.
As for the prefix stuff, I think about using “SDLayer” which would shorten
most of my function prototypes.

Names like _foo or __foo are reserved for use of the C compiler or
system-level libraries. That’s why it’s okay to have _WIN32 but
it’s not okay for app-level libraries to intrude into this namespace.

[snip]
To finish, what’s your opinion about the utility of such an API ?

IMHO, let the market decide. If developers are interested and
start to adopt it, then you’d know you have a winner.> [snipped]

----- Message d’origine ----
De : Ulrich Eckhardt
? : sdl at lists.libsdl.org
Envoy? le : Mercredi, 18 Juin 2008, 7h27mn 29s
Objet : Re: [SDL] SDL_Layer
[snipped]


Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Names like _foo or __foo are reserved for use of the C compiler or
system-level libraries. That’s why it’s okay to have _WIN32 but it’s
not okay for app-level libraries to intrude into this namespace.

Quick correction: _Foo is reserved, _foo is not. Symbols (at file
scope, i.e. not exported) that start with an underscore followed by a
lowercase letter are guaranteed to NOT be used by the
implementation.

b

Brian Raiter wrote:

Names like _foo or __foo are reserved for use of the C compiler or
system-level libraries. That’s why it’s okay to have _WIN32 but it’s
not okay for app-level libraries to intrude into this namespace.

Quick correction: _Foo is reserved, _foo is not. Symbols (at file
scope, i.e. not exported) that start with an underscore followed by a
lowercase letter are guaranteed to NOT be used by the
implementation.

I think you are right. I apologize. I ain’t a language lawyer
anyway. N1256 says the following:

? All identifiers that begin with an underscore are always
reserved for use as identifiers with file scope in both
the ordinary and tag name spaces.

I guess that’s a bit terse and needs careful reading and careful
note taken of the context which it refers to. In any case, I would
still err on the side of caution and give them a wide berth
altogether. Underscore prefixes in app-level libraries is a rather
rare thing, I gather. Well, it’s getting OT and I will let the
experts clear the air. ;-)–
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

Hi again,

Thank you for your answers about multi-threads with SDL.
The reason for this post was to know if I had to provide
a thread-safe mechanism for my future library SDL_Layer.

By the way, some of you may have missed the messages I’ve sent
the last weeks, concerning SDL_Layer.

Let me remind the context of my message:
I’m planning to start the coding of a library called SDL_Layer,
whose purpose is to provide a layer mechanism to SDL, so that
a developer don’t have to take care of overlapping areas.
Also, it’ll provide support for “scrolling”, each layer having its own
scrolling factor. Global colorkey and per-layer alpha is supported too,
as well a possibility to hide/show a particular layer.

Here is the latest version of the SDL_Layer.h header:

http://code.google.com/p/sdl-layer/downloads/list

Again, comments, ideas, suggestions, critics, are all welcomed.

Best regards,
Julien._____________________________________________________________________________
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr

Here is the latest version of the SDL_Layer.h header:

http://code.google.com/p/sdl-layer/downloads/list

What’s the difference with the previous version? You really should
put it in Subversion (provided by Google Code!)…On Tue, Jun 24, 2008 at 10:22 AM, julien CLEMENT wrote:


http://pphaneuf.livejournal.com/

Hi Bill,

Very nice idea to emulate the old displays of the 70’s and 80’s.
Let us know if something is going on, an API or something …

(To everybody)
By the way, I announce that my library SDL_Layer is already available
at:
http://code.google.com/p/sdl-layer/downloads/list

There’re two demos: “scroll” and “snow”

Build instructions:

make && make demos

The first one shows the scrolling capacity with parallax effect,
the second one shows the capacity to blit sprites on different layers
and use update rects to refresh the display without having to deal
with finding refresh regions.

I’m waiting for your impressions, comments, advices.

Julien

----- Message d’origine ----De : Bill Kendrick
? : A list for developers using the SDL library. (includes SDL-announce)
Envoy? le : Lundi, 21 Juillet 2008, 19h51mn 43s
Objet : Re: [SDL] Where SDL goes

On Sun, Jul 20, 2008 at 09:58:21PM +0000, … wrote:

Where does SDL code go in your game? Does it go into its own class (its own
header,cpp) or does it go within the same class as your game? In other words
does it have its own little section of code or do you combine it with the app
code. Any help would be appreciated. Thanks!

I’ve found SDL itself low-level and portable enough that ‘wrapping’ it
(for some future replacement) hasn’t been necessary. I also often write
most of an entire game in two evenings, and then work on the next game. :wink:

OTOH, I’m hankering to go back and make all of my vector-based games look
nicer, and was thinking of making a little line-drawing library on top of
SDL (with the option of also sitting on top of OpenGL) so that I could
make the games look more like real vector screens from arcade games of
the 1970s and 1980s.

(A key feature would be the ability to change the level of realism…
straight bresenham pixelated lines, like I have now, for slow systems,
up to anti-aliased, alpha-blended, blurred lines for fast systems.
Something chosen either at runtime or build-time. I obviously haven’t
spec’d this out much yet. :slight_smile: )


-bill!
“Tux Paint” - free children’s drawing software for Windows / Mac OS X / Linux!
Download it today! http://www.tuxpaint.org/


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

  _____________________________________________________________________________ 

Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr