The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL 1.3 primitives
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
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
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL 1.3 primitives
Mason Wheeler
Guest

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.



Quote:
----- 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?
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL 1.3 primitives
Bill Kendrick
Guest

On Fri, Dec 18, 2009 at 09:08:35PM -0800, Sam Lantinga wrote:
Quote:
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.)


Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL 1.3 primitives
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
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:
Quote:
On Fri, Dec 18, 2009 at 09:08:35PM -0800, Sam Lantinga wrote:
Quote:
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.)


Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




--
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
vernier


Joined: 13 Nov 2009
Posts: 6
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)
SDL 1.3 primitives
Bob


Joined: 19 Sep 2009
Posts: 185
On Fri, Dec 18, 2009 at 11:08 PM, Sam Lantinga wrote:
Quote:
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 Pendleton


Quote:

See ya!
--
       -Sam Lantinga, Founder and President, Galaxy Gameworks LLC
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




--
+-----------------------------------------------------------
+ Bob Pendleton: writer and programmer
+ email:
+ web: www.TheGrumpyProgrammer.com
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org