Pnglite wrapper

Hello.

Modelled after infamous LoadBMP/SaveBMP. Loads RGB/RGBA as is,
greyscale and greyscale+alpha by expanding to RGB/RGBA.
Lacks support for interlaced images and indexed colors. Saves by
converting surface to RGB24 or RGBA8888.

Intended uses: screenshots/texture dumps and texture loads without
extra dependencies or writing yet another SDL_SavePNG.c

Ideally I’d like to see this in SDL core, pnglite license seems
compatible (or the same).

If lack of indexed formats/interlace support would be the only
blocker, I’ll hack it into pnglite myself.–

./lxnt

2012/12/13 Alexander Sabourenkov :

If lack of indexed formats/interlace support would be the only
blocker, I’ll hack it into pnglite myself.

Not sure how much of an advantage would it be to use pnglite instead
of standard libpng if you were to add that (not to mention libpng
being more widely available).

Indexed and interlaced PNGs aren’t exactly common, but also it’d be
wrong to say they are so unusual as to be hard to find (in fact I use
indexed PNGs since I’m dealing with pixelart and I like to keep the
palette to make editing easier), so I’m not sure if lack of support
for them would be acceptable - even if in the end they get converted
to raw linear RGBA when they’re loaded.

Saving would be a different issue as you have total control over the
output format there.

Not sure how much of an advantage would it be to use pnglite instead
of standard libpng if you were to add that (not to mention libpng
being more widely available).

An external dependency will rule out any chance of inclusion into the core.

I intended this more like an alternative for SDL_SaveBMP plus a chance to
not require SDL_image if not absolutely necessary. The fact that pnglite is
small enough and suitably licenced only helps.

Indexed and interlaced PNGs aren’t exactly common, but also it’d be
wrong to say they are so unusual as to be hard to find (in fact I use
indexed PNGs since I’m dealing with pixelart and I like to keep the
palette to make editing easier), so I’m not sure if lack of support
for them would be acceptable - even if in the end they get converted
to raw linear RGBA when they’re loaded.

Saving would be a different issue as you have total control over the
output format there.

As I said, if that gets in the way, I’ll fix it. It is because I don’t use
indexed formats myself I didn’t do it yet.–

./lxnt

Looks well written, I’ll try and check it out sometime this weekend.

Good job!
-AlexOn Thu, Dec 13, 2012 at 7:44 PM, Alexander Sabourenkov wrote:

Hello.

https://github.com/lxnt/SDL_pnglite

Modelled after infamous LoadBMP/SaveBMP. Loads RGB/RGBA as is,
greyscale and greyscale+alpha by expanding to RGB/RGBA.
Lacks support for interlaced images and indexed colors. Saves by
converting surface to RGB24 or RGBA8888.

Intended uses: screenshots/texture dumps and texture loads without
extra dependencies or writing yet another SDL_SavePNG.c

Ideally I’d like to see this in SDL core, pnglite license seems
compatible (or the same).

If lack of indexed formats/interlace support would be the only
blocker, I’ll hack it into pnglite myself.

./lxnt


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

Thank you.

Adding support for <8 bits per pixel and then testing it with pngsuite
amounted to a significant rewrite, which is still in progress.
Anything after commit 83be278 is broken.On Fri, Dec 14, 2012 at 7:00 AM, Alex Barry <alex.barry at gmail.com> wrote:

Looks well written, I’ll try and check it out sometime this weekend.

Good job!

./lxnt

Slightly off topic, has anyone ever used LodePNG? I chose it over libpng
and am happy with it, but am surprised how unknown it is considering how
smoothly things have gone for me…On Fri, Dec 14, 2012 at 4:31 PM, Alexander Sabourenkov wrote:

On Fri, Dec 14, 2012 at 7:00 AM, Alex Barry <alex.barry at gmail.com> wrote:

Looks well written, I’ll try and check it out sometime this weekend.

Good job!

Thank you.

Adding support for <8 bits per pixel and then testing it with pngsuite
amounted to a significant rewrite, which is still in progress.
Anything after commit 83be278 is broken.

./lxnt


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

You should tag that commit, and move your dev stuff into a separate branch

  • once it’s stable, merge it with the master branch - that way, no one will
    mistakenly grab a bugged commit :)On Fri, Dec 14, 2012 at 4:31 PM, Alexander Sabourenkov wrote:

On Fri, Dec 14, 2012 at 7:00 AM, Alex Barry <@Alex_Barry> wrote:

Looks well written, I’ll try and check it out sometime this weekend.

Good job!

Thank you.

Adding support for <8 bits per pixel and then testing it with pngsuite
amounted to a significant rewrite, which is still in progress.
Anything after commit 83be278 is broken.

./lxnt


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

Well, instead I just fixed it all but for the 1-2-4 to 8 bit per
channel expander. It skews currently.

As for LodePNG, it’s because it doesn’t show up in aptitude search png I guess.On Sat, Dec 15, 2012 at 1:44 AM, Alex Barry <alex.barry at gmail.com> wrote:

You should tag that commit, and move your dev stuff into a separate branch -
once it’s stable, merge it with the master branch - that way, no one will
mistakenly grab a bugged commit :slight_smile:

./lxnt

I fixed the pixel unpacker, the loading part passes all tests I can
think of throwing at it.

The save side works too, it even might grow filtering/indexed/colorkey
support if there’s any demand for that.–

./lxnt

I would love a SavePNG API, if the added dependency is not very high, I
really hope this gets integrated in sdl2
VittorioOn Sat, Dec 15, 2012 at 10:44 PM, Alexander Sabourenkov wrote:

I fixed the pixel unpacker, the loading part passes all tests I can
think of throwing at it.

The save side works too, it even might grow filtering/indexed/colorkey
support if there’s any demand for that.

./lxnt


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

I submitted a SavePNG API a couple years ago. It’s been ignored ever since. :(________________________________
From: Vittorio Giovara <vitto.giova at yahoo.it>
To: SDL Development List
Sent: Saturday, December 15, 2012 2:18 PM
Subject: Re: [SDL] pnglite wrapper

I would love a SavePNG API, if the added dependency is not very high, I really hope this gets integrated in sdl2
Vittorio

On Sat, Dec 15, 2012 at 10:44 PM, Alexander Sabourenkov wrote:

I fixed the pixel unpacker, the loading part passes all tests I can

think of throwing at it.

The save side works too, it even might grow filtering/indexed/colorkey
support if there’s any demand for that.

?–

?./lxnt


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

Yeah, this question keeps being ignored. I believe mostly because
attempts at SavePNG are being compared to Load/SaveBMP in that the
latter doesn’t have any dependencies and amount of code is minimal, so
it doesn’t present a maintenance burden, SDL not being and image i/o
library and there existing the SDL_image.

The argument for existence of BMP support is that some very basic
functionality for loading and saving images in core SDL is useful for
code samples and tests, and for that anything more complicated there
are other libraries.

I fully support that view, except that BMP format has, well, no
compression whatsoever, and incurs additional steps to convert images
to or from it, or additional burden of pulling in SDL_image with its
dependencies and writing requisite glue code, however minimal it has
to be, if one wants to try a test or code sample on a random image
from the net, or upload a screenshot.

Consider the mobile devices, now actively targeted by the SDL. They
don’t have that much memory, or I/O bandwidth, but start to have
screen resolutions big enough so that making screen- or rather
window-shots with SaveBMP becomes sluggish, while eating memory and
flash space. On the other hand, pulling in SDL_image here is not just
an “apt-get install”, even if SDL2 was already released. All while
from what I’ve seen, many apps can get by using only png and rarely
need anything else SDL_image has to offer.

BMP-only in core was ok for desktop-only environment. But it isn’t adequate now.

On the code size:

$ wc -l SDL_bmp.c
567 SDL_bmp.c

$ wc -l SDL_pnglite.c pnglite.c
437 SDL_pnglite.c
1005 pnglite.c
1442 total

pnglite+wrapper is three times larger, but it’s still only 1,5k lines.

And depends only on libz, which probably has larger install base than
C standard library.–

./lxnt

Actually, as you mention, BMP support is there pretty much for that:
for quick test stuff and the like (also one argument was to help
newbies to get accustomed to SDL), not for any serious work where
you’re expected to provide your own loading and saving functions.

Also there’s the fact that in SDL2 renderers work with textures, not
with surfaces. This makes LoadBMP look even more out of place, since
it returns a surface, but normally in SDL2 you’d render using a
texture instead. It seems like surfaces now are there just to make
easier to manipulate bitmaps rather than using them for showing
anything on screen.

2012/12/16 Alexander Sabourenkov :> Yeah, this question keeps being ignored. I believe mostly because

attempts at SavePNG are being compared to Load/SaveBMP in that the
latter doesn’t have any dependencies and amount of code is minimal, so
it doesn’t present a maintenance burden, SDL not being and image i/o
library and there existing the SDL_image.

The argument for existence of BMP support is that some very basic
functionality for loading and saving images in core SDL is useful for
code samples and tests, and for that anything more complicated there
are other libraries.

I fully support that view, except that BMP format has, well, no
compression whatsoever, and incurs additional steps to convert images
to or from it, or additional burden of pulling in SDL_image with its
dependencies and writing requisite glue code, however minimal it has
to be, if one wants to try a test or code sample on a random image
from the net, or upload a screenshot.

Consider the mobile devices, now actively targeted by the SDL. They
don’t have that much memory, or I/O bandwidth, but start to have
screen resolutions big enough so that making screen- or rather
window-shots with SaveBMP becomes sluggish, while eating memory and
flash space. On the other hand, pulling in SDL_image here is not just
an “apt-get install”, even if SDL2 was already released. All while
from what I’ve seen, many apps can get by using only png and rarely
need anything else SDL_image has to offer.

BMP-only in core was ok for desktop-only environment. But it isn’t adequate now.

On the code size:

$ wc -l SDL_bmp.c
567 SDL_bmp.c

$ wc -l SDL_pnglite.c pnglite.c
437 SDL_pnglite.c
1005 pnglite.c
1442 total

pnglite+wrapper is three times larger, but it’s still only 1,5k lines.

And depends only on libz, which probably has larger install base than
C standard library.

./lxnt


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

Since the BMP support is there for that reason, I think would make more
sense nowdays to replace it with PNG support and move the BMP stuff to
SDL_image.

Sik the hedgehog sik.the.hedgehog at gmail.com
<sdl%40lists.libsdl.org?Subject=Re%3A%20[SDL]%20pnglite%20wrapper&In-Reply-To=<CAEyBR%2BVjjGEbTc4wAmPpdrnQoW8JjAsN1DZAScgqj82uELE7Eg%40mail.gmail.com>>
Sun Dec 16 05:43:14 PST 2012

Actually, as you mention, BMP support is there pretty much for that:
for quick test stuff and the like (also one argument was to help
newbies to get accustomed to SDL), not for any serious work where
you’re expected to provide your own loading and saving functions.

Also there’s the fact that in SDL2 renderers work with textures, not
with surfaces. This makes LoadBMP look even more out of place, since
it returns a surface, but normally in SDL2 you’d render using a
texture instead. It seems like surfaces now are there just to make
easier to manipulate bitmaps rather than using them for showing
anything on screen.

2012/12/16 Alexander Sabourenkov <llxxnntt at gmail.com
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org>:

  • Yeah, this question keeps being ignored. I believe mostly because*>* attempts at SavePNG are being compared to Load/SaveBMP in that the*>* latter doesn’t have any dependencies and amount of code is minimal, so*>* it doesn’t present a maintenance burden, SDL not being and image i/o*>* library and there existing the SDL_image.>**> The argument for existence of BMP support is that some very basic*>* functionality for loading and saving images in core SDL is useful for*>* code samples and tests, and for that anything more complicated there*>* are other libraries.>**> I fully support that view, except that BMP format has, well, no*>* compression whatsoever, and incurs additional steps to convert images*>* to or from it, or additional burden of pulling in SDL_image with its*>* dependencies and writing requisite glue code, however minimal it has*>* to be, if one wants to try a test or code sample on a random image*>* from the net, or upload a screenshot.>**> Consider the mobile devices, now actively targeted by the SDL. They*>* don’t have that much memory, or I/O bandwidth, but start to have*>* screen resolutions big enough so that making screen- or rather*>* window-shots with SaveBMP becomes sluggish, while eating memory and*>* flash space. On the other hand, pulling in SDL_image here is not just*>* an “apt-get install”, even if SDL2 was already released. All while*>* from what I’ve seen, many apps can get by using only png and rarely*>* need anything else SDL_image has to offer.>**> BMP-only in core was ok for desktop-only environment. But it isn’t adequate now.>>> On the code size:>**> $ wc -l SDL_bmp.c*>* 567 SDL_bmp.c*>>* $ wc -l SDL_pnglite.c pnglite.c*>* 437 SDL_pnglite.c*>* 1005 pnglite.c*>* 1442 total*>>* pnglite+wrapper is three times larger, but it’s still only 1,5k lines.>**> And depends only on libz, which probably has larger install base than*>* C standard library.>>>>**> ./lxnt*>* _______________________________________________> SDL mailing list*>* SDL at lists.libsdl.org http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org*

Actually, as you mention, BMP support is there pretty much for that:
for quick test stuff and the like (also one argument was to help
newbies to get accustomed to SDL), not for any serious work where
you’re expected to provide your own loading and saving functions.

Yes, but nowadays sheer size of BMP data started to get in the way.

As Rodrigo said, it will make more sense to declare BMP obsolete and move on.

Of course, it is not possible to actually drop SDL_LoadBMP/SDL_SaveBMP
from the API, but an alternative would be the first step.

Also there’s the fact that in SDL2 renderers work with textures, not
with surfaces. This makes LoadBMP look even more out of place, since
it returns a surface, but normally in SDL2 you’d render using a
texture instead. It seems like surfaces now are there just to make
easier to manipulate bitmaps rather than using them for showing
anything on screen.

SDL_Texture is one call away from SDL_Surface, and I see good reasons
for it to stay that way.

Besides, SDL_Texture is there only if one actually uses SDL renderers
for rendering, which isn’t exactly the case with direct use of OpenGL/GLES.

I, for one, never used, and don’t plan to seriously use the SDL rendering API.
I, like, like writing shaders myself. But I still need to load the
data to feed them.On Sun, Dec 16, 2012 at 5:43 PM, Sik the hedgehog <sik.the.hedgehog at gmail.com> wrote:

./lxnt

If I recall correctly, Paint doesn’t even support BMP anymore. At
least for saving. But yeah, there’s the problem you can’t get rid of
SDL_LoadBMP without breaking lots of tutorials and the like - but
adding a second format would then lend to the question of “why not add
more” and result in requests for adding more popular formats (at the
very least JPEG and GIF), which then makes us wonder why shouldn’t the
functions just be used for loading images in general (defeating
SDL_Image’s purpose).

Also about this:

Besides, SDL_Texture is there only if one actually uses SDL renderers
for rendering, which isn’t exactly the case with direct use of OpenGL/GLES.

If you use GL directly then you directly skip SDL for everything
except setting up the window. You use neither SDL_Texture nor
SDL_Surface.

2012/12/16 Alexander Sabourenkov :> On Sun, Dec 16, 2012 at 5:43 PM, Sik the hedgehog <@Sik_the_hedgehog> wrote:

Actually, as you mention, BMP support is there pretty much for that:
for quick test stuff and the like (also one argument was to help
newbies to get accustomed to SDL), not for any serious work where
you’re expected to provide your own loading and saving functions.

Yes, but nowadays sheer size of BMP data started to get in the way.

As Rodrigo said, it will make more sense to declare BMP obsolete and move on.

Of course, it is not possible to actually drop SDL_LoadBMP/SDL_SaveBMP
from the API, but an alternative would be the first step.

Also there’s the fact that in SDL2 renderers work with textures, not
with surfaces. This makes LoadBMP look even more out of place, since
it returns a surface, but normally in SDL2 you’d render using a
texture instead. It seems like surfaces now are there just to make
easier to manipulate bitmaps rather than using them for showing
anything on screen.

SDL_Texture is one call away from SDL_Surface, and I see good reasons
for it to stay that way.

Besides, SDL_Texture is there only if one actually uses SDL renderers
for rendering, which isn’t exactly the case with direct use of OpenGL/GLES.

I, for one, never used, and don’t plan to seriously use the SDL rendering API.
I, like, like writing shaders myself. But I still need to load the
data to feed them.

./lxnt


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

Since SDL2 is already not backward compatible, this is the right time to
get rid of that IMO.
SDL2 is not officially realeased it should not a a problem to break some
stuff. Dont you think?Date: Sun, 16 Dec 2012 17:01:38 -0300

From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: SDL Development List
Subject: Re: [SDL] pnglite wrapper
Message-ID:
<
CAEyBR+U_JwTJ8WCdV_GJ-jcLmUU3x450URntgvL6wCkZWxe1qw at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

If I recall correctly, Paint doesn’t even support BMP anymore. At
least for saving. But yeah, there’s the problem you can’t get rid of
SDL_LoadBMP without breaking lots of tutorials and the like - but
adding a second format would then lend to the question of “why not add
more” and result in requests for adding more popular formats (at the
very least JPEG and GIF), which then makes us wonder why shouldn’t the
functions just be used for loading images in general (defeating
SDL_Image’s purpose).

I think the problem is that 1.3 was probably the time to do that
(which is when the API kept changing all the time). The jump to 2.0 is
what set the API as being considered stable (as in what’s there will
remain there), unless I misunderstood something.

And yeah, if it was me, I’d rather just get rid of the LoadBMP
altogether (along with SaveBMP, LoadWAV and SaveWAV). In tutorials
loading bitmaps could be a good time to teach newcomers to use the
satellite libraries while for tests we could probably just generate
some quick assets procedurally to do the job.

2012/12/16 Rodrigo :> Since SDL2 is already not backward compatible, this is the right time to get

rid of that IMO.
SDL2 is not officially realeased it should not a a problem to break some
stuff. Dont you think?

Date: Sun, 16 Dec 2012 17:01:38 -0300
From: Sik the hedgehog <@Sik_the_hedgehog>

To: SDL Development List
Subject: Re: [SDL] pnglite wrapper
Message-ID:

<CAEyBR+U_JwTJ8WCdV_GJ-jcLmUU3x450URntgvL6wCkZWxe1qw at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

If I recall correctly, Paint doesn’t even support BMP anymore. At
least for saving. But yeah, there’s the problem you can’t get rid of
SDL_LoadBMP without breaking lots of tutorials and the like - but
adding a second format would then lend to the question of “why not add
more” and result in requests for adding more popular formats (at the
very least JPEG and GIF), which then makes us wonder why shouldn’t the
functions just be used for loading images in general (defeating
SDL_Image’s purpose).


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

Message-ID:
<CAGQRh_atWAyEbEMmsyn+ujARxSnujdVVnxJ6r2XfBCxwUFA0GA at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”

Since the BMP support is there for that reason, I think would make more
sense nowdays to replace it with PNG support and move the BMP stuff to
SDL_image.

Agreed. MSPaint actually supports PNG, so it’s just about omnipresent,
which is all that you really need for examples.> Date: Sun, 16 Dec 2012 15:03:25 -0200

From: Rodrigo
To: sdl at lists.libsdl.org
Subject: Re: [SDL] pnglite wrapper

Date: Sun, 16 Dec 2012 22:27:25 +0300
From: Alexander Sabourenkov
To: SDL Development List
Subject: Re: [SDL] pnglite wrapper
Message-ID:
<CABZtw9PgmtVRc4VbQpgQnej3HE=8CQTqnUdfGdOHyGpoj7Vusg at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Of course, it is not possible to actually drop SDL_LoadBMP/SDL_SaveBMP
from the API, but an alternative would be the first step.

See below.

Date: Sun, 16 Dec 2012 17:01:38 -0300
From: Sik the hedgehog <sik.the.hedgehog at gmail.com>
To: SDL Development List
Subject: Re: [SDL] pnglite wrapper
Message-ID:
<CAEyBR+U_JwTJ8WCdV_GJ-jcLmUU3x450URntgvL6wCkZWxe1qw at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

If I recall correctly, Paint doesn’t even support BMP anymore. At
least for saving. But yeah, there’s the problem you can’t get rid of
SDL_LoadBMP without breaking lots of tutorials and the like

Tutorials which will probably have to be rewritten anyways. Unless Sam
or Ryan consider this a show-stopper, I’d say that it can be
disregarded. SDL 2 isn’t an iteration of SDL 1.2, it’s a redesign, and
compatibility has been discarded before (with the removal of the
compatibility layer). The proper question isn’t “does this break SDL
1.2 & 1.3 tutorials”, but instead “does this make sense for SDL 2”. If
Sam wanted to maintain compatibility then he would have vetoed
dropping the compatibility layer, instead he decided that a modern
re-imagining of SDL was the correct choice.

  • but
    adding a second format would then lend to the question of “why not add
    more” and result in requests for adding more popular formats (at the
    very least JPEG and GIF), which then makes us wonder why shouldn’t the
    functions just be used for loading images in general (defeating
    SDL_Image’s purpose).

Which is why you remove the old image file functions at the same time.
You send a clear message that SDL only directly supports one image
format at any point in time.

I would definitely say not to support APNGs, though. This doesn’t need
to be advanced or full-featured, just bare-bones.

When I was talking about breaking tutorials, I was talking about SDL2
tutorials actually, of which there’s quite a fair share out there
already (which indeed say 2.0 instead of 1.3).

And why would anybody even want to try supporting APNGs with an API
that can only do individual images? :stuck_out_tongue:

2012/12/17 Jared Maddox :>> Date: Sun, 16 Dec 2012 15:03:25 -0200

From: Rodrigo
To: sdl at lists.libsdl.org
Subject: Re: [SDL] pnglite wrapper
Message-ID:
<CAGQRh_atWAyEbEMmsyn+ujARxSnujdVVnxJ6r2XfBCxwUFA0GA at mail.gmail.com>
Content-Type: text/plain; charset=“iso-8859-1”

Since the BMP support is there for that reason, I think would make more
sense nowdays to replace it with PNG support and move the BMP stuff to
SDL_image.

Agreed. MSPaint actually supports PNG, so it’s just about omnipresent,
which is all that you really need for examples.

Date: Sun, 16 Dec 2012 22:27:25 +0300
From: Alexander Sabourenkov
To: SDL Development List
Subject: Re: [SDL] pnglite wrapper
Message-ID:
<CABZtw9PgmtVRc4VbQpgQnej3HE=8CQTqnUdfGdOHyGpoj7Vusg at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

Of course, it is not possible to actually drop SDL_LoadBMP/SDL_SaveBMP
from the API, but an alternative would be the first step.

See below.

Date: Sun, 16 Dec 2012 17:01:38 -0300
From: Sik the hedgehog <@Sik_the_hedgehog>
To: SDL Development List
Subject: Re: [SDL] pnglite wrapper
Message-ID:
<CAEyBR+U_JwTJ8WCdV_GJ-jcLmUU3x450URntgvL6wCkZWxe1qw at mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

If I recall correctly, Paint doesn’t even support BMP anymore. At
least for saving. But yeah, there’s the problem you can’t get rid of
SDL_LoadBMP without breaking lots of tutorials and the like

Tutorials which will probably have to be rewritten anyways. Unless Sam
or Ryan consider this a show-stopper, I’d say that it can be
disregarded. SDL 2 isn’t an iteration of SDL 1.2, it’s a redesign, and
compatibility has been discarded before (with the removal of the
compatibility layer). The proper question isn’t “does this break SDL
1.2 & 1.3 tutorials”, but instead “does this make sense for SDL 2”. If
Sam wanted to maintain compatibility then he would have vetoed
dropping the compatibility layer, instead he decided that a modern
re-imagining of SDL was the correct choice.

  • but
    adding a second format would then lend to the question of “why not add
    more” and result in requests for adding more popular formats (at the
    very least JPEG and GIF), which then makes us wonder why shouldn’t the
    functions just be used for loading images in general (defeating
    SDL_Image’s purpose).

Which is why you remove the old image file functions at the same time.
You send a clear message that SDL only directly supports one image
format at any point in time.

I would definitely say not to support APNGs, though. This doesn’t need
to be advanced or full-featured, just bare-bones.


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