Putpixel, etc

SDL doesn’t offer simple functions like putpixel and line. Am I right?
If it’s true, why? I know I can quite easily write functions like that
of my own, but before I start reinventing the wheel, I thought I could
ask about it here.

SDL doesn’t offer simple functions like putpixel and line. Am I right?
If it’s true, why? I know I can quite easily write functions like that
of my own, but before I start reinventing the wheel, I thought I could
ask about it here.

Someone gave me patches for putpixel() and getpixel(), which I am
considering adding to the core SDL. Comments?

Many people have written graphic libraries for SDL, which have drawing
primitives in them. SparkGL and PowerDraw come to mind immediately.
Authors? :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

There are putpixel functions in SDL-demos/screenlibOn Fri, 8 Oct 1999, Lauri Nurmi wrote:

SDL doesn’t offer simple functions like putpixel and line. Am I right?
If it’s true, why? I know I can quite easily write functions like that
of my own, but before I start reinventing the wheel, I thought I could
ask about it here.

I think put/getpixel should be part of the core SDL API, but I don’t
think that line/circle/beizer/whatever should be. The latter should be done
as optional compile-in code for your app. The SDL API has done a very good
job of only supplying those functions that apps need, I’d prefer it if
it wasn’t bloated by functions that apps might want.

Just my opinion, feel free to ignore.

ttfn,
JohnOn Fri, Oct 08, 1999 at 08:56:42AM -0700, Sam Lantinga wrote:

SDL doesn’t offer simple functions like putpixel and line. Am I right?
If it’s true, why? I know I can quite easily write functions like that
of my own, but before I start reinventing the wheel, I thought I could
ask about it here.

Someone gave me patches for putpixel() and getpixel(), which I am
considering adding to the core SDL. Comments?

In my opinion is better to not insert get/putpixel routine in the SDL core,
and mantain it as small as possible; I think that it should offer a low
level set of function (as video memory direct access and as SDL already
do). All the other features should be put in another layer that stands on
it and uses its functionalityes. But, it’s just my opinion.

Bye.

Alessandro Porcu
alex.porcu at tiscalinet.it
@aporcu_at_amm.unica

SDL doesn’t offer simple functions like putpixel and line. Am I right?
If it’s true, why? I know I can quite easily write functions like that
of my own, but before I start reinventing the wheel, I thought I could
ask about it here.

Someone gave me patches for putpixel() and getpixel(), which I am
considering adding to the core SDL. Comments?

I think put/getpixel should be part of the core SDL API, but I don’t
think that line/circle/beizer/whatever should be. The latter should be done
as optional compile-in code for your app. The SDL API has done a very good
job of only supplying those functions that apps need, I’d prefer it if
it wasn’t bloated by functions that apps might want.

Some of the SDL backends may have accelerated functions associated with
line/circle/Bezier drawing. While Bezier/circle drawing may be
rare enough to delegate to another library, line drawing is
fairly common.

I’m not 100% familiar with the SDL, so please bear that in mind,
but it looks like all the drawing requests get delegated to UpdateRects.
For a pathological line (origin to width, height), that means the entire
screen is updated, with pixel-oriented drawing you have height calls to
putpixel!

People using pixel/line drawing functions should except some performance
problems associated with increased function overhead but line drawing is
common enough that it deserves special attention, IMHO.On Mon, Oct 11, 1999 at 11:11:27AM +0100, John Marshall wrote:

On Fri, Oct 08, 1999 at 08:56:42AM -0700, Sam Lantinga wrote:


J. Valenzuela – jvalenzu at subnet.org
QOTD:
“Every morning I read the obituaries; if my name’s not there,
I go to work.”

Whoa… somehow I’ve missed most of this thread…

Someone gave me patches for putpixel() and getpixel(), which I am
considering adding to the core SDL. Comments?

I think put/getpixel should be part of the core SDL API, but I don’t
think that line/circle/beizer/whatever should be. The latter should be done
as optional compile-in code for your app. The SDL API has done a very good
job of only supplying those functions that apps need, I’d prefer it if
it wasn’t bloated by functions that apps might want.

We’ve been through this discussion before… The overhead of adding more
functions to the library is nearly zero if you don’t use them nowadays. (As
opposed to adding more to functions)

Some of the SDL backends may have accelerated functions associated with
line/circle/Bezier drawing. While Bezier/circle drawing may be
rare enough to delegate to another library, line drawing is
fairly common.

Are you serious? Do people still do line drawing?

I figure that in the 90s pragrammers already have the drawing done, and all
they need to is bring 'em to life…

People using pixel/line drawing functions should except some performance
problems associated with increased function overhead but line drawing is
common enough that it deserves special attention, IMHO.

The task of line drawing is simple enough that it could be embedded into a
couple of macros… (Sorry, early morning, no code… maybe after work)

IMHO, if you’re gonna write those functions, put them in a demo lib. Real Men
waste code and re-implement it themselves :wink:
(Or get into the 90s, and find a graphic designer to do the drawing :)On Mon, Oct 11, 1999 at 08:11:35AM -0700, jvalenzu at subnet.org wrote:


– Michael Samuel