SDL 1.3 primitives

Hey guys, I’m looking at what primitives to add to SDL 1.3.

So far I have point, line, rect outline, and rect filled. I’m going
to have fast and anti-aliased versions of the line drawing code. How
many people would use circle or polygon and not go directly to OpenGL?

See ya!–
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Oh, there’s a rect outline now? That would be really useful for me.

I personally don’t see much use for a “polygon”. Circle, though, would
be nice.>----- Original Message ----

From: Sam Lantinga
Subject: [SDL] SDL 1.3 primitives

Hey guys, I’m looking at what primitives to add to SDL 1.3.

So far I have point, line, rect outline, and rect filled. I’m going
to have fast and anti-aliased versions of the line drawing code. How
many people would use circle or polygon and not go directly to OpenGL?

Hey guys, I’m looking at what primitives to add to SDL 1.3.

So far I have point, line, rect outline, and rect filled. I’m going
to have fast and anti-aliased versions of the line drawing code.

Out of curiosity, how are you anti-aliasing? In libcrtxy, I was using
Xiaolin Wu’s algorithm for fast AA. Of course, that lib’s purpose is
to be able to target even slower, FPU-less systems. (And to allow
the user and/or porter to decide what rendering features were used;
the games aren’t supposed to care.)

I was hoping that lib would eventually have OpenGL as a backend, too,
of course. :wink: (Though perhaps via SDL 1.3’s primitives, that’d be moot;
I’d just do it through SDL 1.3 directly.)

How many people would use circle or polygon and not go directly to OpenGL?

Well, me, but I probably don’t count. ;)On Fri, Dec 18, 2009 at 09:08:35PM -0800, Sam Lantinga wrote:


-bill!
Sent from my computer

Funny you should ask that, I was literally typing Wu’s algorithm as I
read your e-mail. I’m dropping Bresenham’s algorithm entirely. We
have perfectly good alpha blending, and modern CPUs can actually
handle it, so why not use it? Of course OpenGL and Direct3D will give
us that for free.

Of course the first thing that comes to mind with this is
free-rotating vector shapes (classic asteroids anyone?), which means
that we’d need floating point precision for points.

Hmmm…On Fri, Dec 18, 2009 at 11:05 PM, Bill Kendrick wrote:

On Fri, Dec 18, 2009 at 09:08:35PM -0800, Sam Lantinga wrote:

Hey guys, I’m looking at what primitives to add to SDL 1.3.

So far I have point, line, rect outline, and rect filled. ?I’m going
to have fast and anti-aliased versions of the line drawing code.

Out of curiosity, how are you anti-aliasing? ?In libcrtxy, I was using
Xiaolin Wu’s algorithm for fast AA. ?Of course, that lib’s purpose is
to be able to target even slower, FPU-less systems. ?(And to allow
the user and/or porter to decide what rendering features were used;
the games aren’t supposed to care.)

I was hoping that lib would eventually have OpenGL as a backend, too,
of course. :wink: ?(Though perhaps via SDL 1.3’s primitives, that’d be moot;
I’d just do it through SDL 1.3 directly.)

How many people would use circle or polygon and not go directly to OpenGL?

Well, me, but I probably don’t count. :wink:


-bill!
Sent from my computer


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

I would use circle AND polygon (thank you for asking). I would also use rounded_rect.
For both polygon, rect and rounded_rect I’d love having color gradient too in them (plesae Sam-ta claus)
At last I would use curve drawing primitives if parameters are clear enough (I don’t care if underlying algorithm are complex)
fred

See ya!–
Fred Vernier, Founder and President of nothing but still working on the newcol game (http://newcol.free.fr/ where you’ll find the latest screenshots)

Hey guys, I’m looking at what primitives to add to SDL 1.3.

So far I have point, line, rect outline, and rect filled. ?I’m going
to have fast and anti-aliased versions of the line drawing code. ?How
many people would use circle or polygon and not go directly to OpenGL?

People first learning computer graphics. The learning barrier from
simple primitives to OpenGL is a lot like the difference between basic
arithmetic and vector math. The really dumb simple shapes make it very
easy to build programs that demonstrate animation without having to
jump to the complexity of OpenGL. Seriously, just trying to get past
the details of the OpenGL data type variants for all the different
APIs is a major barrier to learning.

I’d like to see circle and ellipse. Circle needs, x, y, radius and
color. Ellipse needs x, y, x-radius, y-radius, angle, and color. Yeah,
I know, the ellipse parameters aren’t what a lot of people expect, but
they are dead simple for people who don’t yet understand vectors and
rotations.

Polygon is nice if you can handle concave polygons, otherwise I’d
leave them out.

It would be nice to have texturing of the primitives, but… well I
understand not doing it.

Are you restricting this to 2D primitives? Even in OpenGL it would be
nice to have the GLUT solids as built in primitives. Those are
especially nice if they support texture faces.

Bob PendletonOn Fri, Dec 18, 2009 at 11:08 PM, Sam Lantinga wrote:

See ya!

? ? ? ?-Sam Lantinga, Founder and President, Galaxy Gameworks LLC


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


±----------------------------------------------------------

Has anyone built docs for SDL 1.3? In particular documentation regarding
the use of textures instead of surfaces (the old API vs. the new API)?

I built and ran my game using SDL 1.2.14 and got 29 FPS.
I then build and ran it using SDL 1.3.0 using the Compatibility mode (old
API) and got 15 FPS.

It looks like it is time to switch over to the new Texture based API so I
can get decent performance, but it looks like there isn’t any documentation
other than the headers. I thought I saw a post a while back that talked
about the changes necessary to migrate 1.2.x to 1.3.x, but cannot find it in
emails.

I have built the docs using doxygen, and although all of the new functions
are in the generated html, there really isn’t a good example of migrating
from 1.2.x to 1.3.x

Can someone point me to a old post or doc somewhere that details this?

Thanks,

Ken Rogoway

I guess that the best solution for the time being is to look at the provided
sample code.On Sun, Dec 20, 2009 at 4:04 AM, Ken Rogoway wrote:

Has anyone built docs for SDL 1.3? In particular documentation regarding
the use of textures instead of surfaces (the old API vs. the new API)?

I built and ran my game using SDL 1.2.14 and got 29 FPS.
I then build and ran it using SDL 1.3.0 using the Compatibility mode (old
API) and got 15 FPS.

It looks like it is time to switch over to the new Texture based API so I
can get decent performance, but it looks like there isn’t any documentation
other than the headers. I thought I saw a post a while back that talked
about the changes necessary to migrate 1.2.x to 1.3.x, but cannot find it
in
emails.

I have built the docs using doxygen, and although all of the new functions
are in the generated html, there really isn’t a good example of migrating
from 1.2.x to 1.3.x

Can someone point me to a old post or doc somewhere that details this?

Thanks,

Ken Rogoway


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

There isn’t an official 1.3 migration guide, although it’s high on the
priority list. We’re going to put a list of new functions and a
migration guide on the wiki here:
http://wiki.libsdl.org/moin.cgi/NewInSDL1.3

In the meantime, the best way to get comfortable with the new API
functions is to take a look at the testsprite2 and testdraw2 test
programs.

If you’d like to put together some initial notes for people migrating
to SDL 1.3, feel free to start a page on the wiki, coordinating it
with Lauren <laleh_aziz at cox.net>

As for the slowdown, I’ve tried to keep the SDL 1.3 implementation as
close to the 1.2 code path as possible. Judging by the 50% slowdown,
it sounds like there’s an extra buffer copy going on there. What
platform are you running?

See ya!On Sat, Dec 19, 2009 at 7:04 PM, Ken Rogoway wrote:

Has anyone built docs for SDL 1.3? ?In particular documentation regarding
the use of textures instead of surfaces (the old API vs. the new API)?

I built and ran my game using SDL 1.2.14 and got 29 FPS.
I then build and ran it using SDL 1.3.0 using the Compatibility mode (old
API) and got 15 FPS.

It looks like it is time to switch over to the new Texture based API so I
can get decent performance, but it looks like there isn’t any documentation
other than the headers. ?I thought I saw a post a while back that talked
about the changes necessary to migrate 1.2.x to 1.3.x, but cannot find it in
emails.

I have built the docs using doxygen, and although all of the new functions
are in the generated html, there really isn’t a good example of migrating
from 1.2.x to 1.3.x

Can someone point me to a old post or doc somewhere that details this?

Thanks,

Ken Rogoway


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

After I sent the post I saw the sample apps. Better than nothing, but still
not ideal for a migration since you can never tell in a sample what is
particular to that program, and what is required for a minimum
implementation. I will keep notes of the migration from 1.2 to 1.3 and get
in touch with Lauren.

As for the slow down:

I am running on Windows XP.

The program is running in a 800x600x24 software window. My physical screen
is 1920x1200x32.

I convert all images at load time to match the display format. I use
SDL_Flip() to update the screen, which according to the docs is the
equivalent of calling SDL_UpdateRect().

I am not using dirty rects for this game since I need to redraw everything.

The concern is that just by rebuilding with SDL 1.3 (no code changes) the
framerate drops 50%. Let me know if there is anything you want me to
try/test to see if I can get the performance up.

Ken> ----- Original Message -----

From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Sam Lantinga
Sent: Sunday, December 20, 2009 10:30 AM
To: SDL Development List
Subject: Re: [SDL] SDL 1.3 docs?

There isn’t an official 1.3 migration guide, although it’s high on the
priority list. We’re going to put a list of new functions and a
migration guide on the wiki here:
http://wiki.libsdl.org/moin.cgi/NewInSDL1.3

In the meantime, the best way to get comfortable with the new API
functions is to take a look at the testsprite2 and testdraw2 test
programs.

If you’d like to put together some initial notes for people migrating
to SDL 1.3, feel free to start a page on the wiki, coordinating it
with Lauren <laleh_aziz at cox.net>

As for the slowdown, I’ve tried to keep the SDL 1.3 implementation as
close to the 1.2 code path as possible. Judging by the 50% slowdown,
it sounds like there’s an extra buffer copy going on there. What
platform are you running?

See ya!

Can you send me a link to your program so I can try it out here?On Sun, Dec 20, 2009 at 9:11 AM, Ken Rogoway wrote:

After I sent the post I saw the sample apps. ?Better than nothing, but still
not ideal for a migration since you can never tell in a sample what is
particular to that program, and what is required for a minimum
implementation. ?I will keep notes of the migration from 1.2 to 1.3 and get
in touch with Lauren.

As for the slow down:

I am running on Windows XP.

The program is running in a 800x600x24 software window. ?My physical screen
is 1920x1200x32.

I convert all images at load time to match the display format. ?I use
SDL_Flip() to update the screen, which according to the docs is the
equivalent of calling SDL_UpdateRect().

I am not using dirty rects for this game since I need to redraw everything.

The concern is that just by rebuilding with SDL 1.3 (no code changes) the
framerate drops 50%. ?Let me know if there is anything you want me to
try/test to see if I can get the performance up.

Ken

-----Original Message-----
From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Sam Lantinga
Sent: Sunday, December 20, 2009 10:30 AM
To: SDL Development List
Subject: Re: [SDL] SDL 1.3 docs?

There isn’t an official 1.3 migration guide, although it’s high on the
priority list. ?We’re going to put a list of new functions and a
migration guide on the wiki here:
http://wiki.libsdl.org/moin.cgi/NewInSDL1.3

In the meantime, the best way to get comfortable with the new API
functions is to take a look at the testsprite2 and testdraw2 test
programs.

If you’d like to put together some initial notes for people migrating
to SDL 1.3, feel free to start a page on the wiki, coordinating it
with Lauren <laleh_aziz at cox.net>

As for the slowdown, I’ve tried to keep the SDL 1.3 implementation as
close to the 1.2 code path as possible. ?Judging by the 50% slowdown,
it sounds like there’s an extra buffer copy going on there. ?What
platform are you running?

See ya!


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Oh, there’s a great test to show the minimum you need to get up and
running! Try out testspriteminimal in the test directory. As you can
see it’s super easy. :)On Sun, Dec 20, 2009 at 9:11 AM, Ken Rogoway wrote:

After I sent the post I saw the sample apps. ?Better than nothing, but still
not ideal for a migration since you can never tell in a sample what is
particular to that program, and what is required for a minimum
implementation. ?I will keep notes of the migration from 1.2 to 1.3 and get
in touch with Lauren.

As for the slow down:

I am running on Windows XP.

The program is running in a 800x600x24 software window. ?My physical screen
is 1920x1200x32.

I convert all images at load time to match the display format. ?I use
SDL_Flip() to update the screen, which according to the docs is the
equivalent of calling SDL_UpdateRect().

I am not using dirty rects for this game since I need to redraw everything.

The concern is that just by rebuilding with SDL 1.3 (no code changes) the
framerate drops 50%. ?Let me know if there is anything you want me to
try/test to see if I can get the performance up.

Ken

-----Original Message-----
From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Sam Lantinga
Sent: Sunday, December 20, 2009 10:30 AM
To: SDL Development List
Subject: Re: [SDL] SDL 1.3 docs?

There isn’t an official 1.3 migration guide, although it’s high on the
priority list. ?We’re going to put a list of new functions and a
migration guide on the wiki here:
http://wiki.libsdl.org/moin.cgi/NewInSDL1.3

In the meantime, the best way to get comfortable with the new API
functions is to take a look at the testsprite2 and testdraw2 test
programs.

If you’d like to put together some initial notes for people migrating
to SDL 1.3, feel free to start a page on the wiki, coordinating it
with Lauren <laleh_aziz at cox.net>

As for the slowdown, I’ve tried to keep the SDL 1.3 implementation as
close to the 1.2 code path as possible. ?Judging by the 50% slowdown,
it sounds like there’s an extra buffer copy going on there. ?What
platform are you running?

See ya!


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

It’s large due to the assets, so I will send you access to my FTP. Do you
just want the Bin, or do you need the source too?> ----- Original Message -----

From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Sam Lantinga
Sent: Sunday, December 20, 2009 11:13 AM
To: SDL Development List
Subject: Re: [SDL] SDL 1.3 docs?

Can you send me a link to your program so I can try it out here?

On Sun, Dec 20, 2009 at 9:11 AM, Ken Rogoway wrote:

After I sent the post I saw the sample apps. ?Better than nothing, but
still
not ideal for a migration since you can never tell in a sample what is
particular to that program, and what is required for a minimum
implementation. ?I will keep notes of the migration from 1.2 to 1.3 and
get
in touch with Lauren.

As for the slow down:

I am running on Windows XP.

The program is running in a 800x600x24 software window. ?My physical
screen
is 1920x1200x32.

I convert all images at load time to match the display format. ?I use
SDL_Flip() to update the screen, which according to the docs is the
equivalent of calling SDL_UpdateRect().

I am not using dirty rects for this game since I need to redraw
everything.

The concern is that just by rebuilding with SDL 1.3 (no code changes) the
framerate drops 50%. ?Let me know if there is anything you want me to
try/test to see if I can get the performance up.

Ken

-----Original Message-----
From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org]
On
Behalf Of Sam Lantinga
Sent: Sunday, December 20, 2009 10:30 AM
To: SDL Development List
Subject: Re: [SDL] SDL 1.3 docs?

There isn’t an official 1.3 migration guide, although it’s high on the
priority list. ?We’re going to put a list of new functions and a
migration guide on the wiki here:
http://wiki.libsdl.org/moin.cgi/NewInSDL1.3

In the meantime, the best way to get comfortable with the new API
functions is to take a look at the testsprite2 and testdraw2 test
programs.

If you’d like to put together some initial notes for people migrating
to SDL 1.3, feel free to start a page on the wiki, coordinating it
with Lauren <laleh_aziz at cox.net>

As for the slowdown, I’ve tried to keep the SDL 1.3 implementation as
close to the 1.2 code path as possible. ?Judging by the 50% slowdown,
it sounds like there’s an extra buffer copy going on there. ?What
platform are you running?

See ya!


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC


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

The source would be great, if possible. Go ahead and send me private
e-mail, if you want.On Sun, Dec 20, 2009 at 10:32 AM, Ken Rogoway wrote:

It’s large due to the assets, so I will send you access to my FTP. ?Do you
just want the Bin, or do you need the source too?

-----Original Message-----
From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On
Behalf Of Sam Lantinga
Sent: Sunday, December 20, 2009 11:13 AM
To: SDL Development List
Subject: Re: [SDL] SDL 1.3 docs?

Can you send me a link to your program so I can try it out here?

On Sun, Dec 20, 2009 at 9:11 AM, Ken Rogoway wrote:

After I sent the post I saw the sample apps. ?Better than nothing, but
still
not ideal for a migration since you can never tell in a sample what is
particular to that program, and what is required for a minimum
implementation. ?I will keep notes of the migration from 1.2 to 1.3 and
get
in touch with Lauren.

As for the slow down:

I am running on Windows XP.

The program is running in a 800x600x24 software window. ?My physical
screen
is 1920x1200x32.

I convert all images at load time to match the display format. ?I use
SDL_Flip() to update the screen, which according to the docs is the
equivalent of calling SDL_UpdateRect().

I am not using dirty rects for this game since I need to redraw
everything.

The concern is that just by rebuilding with SDL 1.3 (no code changes) the
framerate drops 50%. ?Let me know if there is anything you want me to
try/test to see if I can get the performance up.

Ken

-----Original Message-----
From: sdl-bounces at lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org]
On
Behalf Of Sam Lantinga
Sent: Sunday, December 20, 2009 10:30 AM
To: SDL Development List
Subject: Re: [SDL] SDL 1.3 docs?

There isn’t an official 1.3 migration guide, although it’s high on the
priority list. ?We’re going to put a list of new functions and a
migration guide on the wiki here:
http://wiki.libsdl.org/moin.cgi/NewInSDL1.3

In the meantime, the best way to get comfortable with the new API
functions is to take a look at the testsprite2 and testdraw2 test
programs.

If you’d like to put together some initial notes for people migrating
to SDL 1.3, feel free to start a page on the wiki, coordinating it
with Lauren <laleh_aziz at cox.net>

As for the slowdown, I’ve tried to keep the SDL 1.3 implementation as
close to the 1.2 code path as possible. ?Judging by the 50% slowdown,
it sounds like there’s an extra buffer copy going on there. ?What
platform are you running?

See ya!


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


? ? ? ?-Sam Lantinga, Founder and President, Galaxy Gameworks LLC


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


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


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC