Paletted textures

Hi All,

Does anyone know how good is the support to GL_EXT_paletted_texture in
OpenGL nowadays?

Can SDL 1.3 deal with paletted textures?

Cheers,

Andre

I don’t know about the GL extension, but I do know that when you create a texture
from an 8-bit (paletted) SDL_Surface, it automatically converts it internally to
a 32-bit version.________________________________
From: aleirade@sct.microlink.com.br (Andre Leiradella)
Subject: [SDL] Paletted textures

Hi All,

Does anyone know how good is the support to GL_EXT_paletted_texture in OpenGL nowadays?

Can SDL 1.3 deal with paletted textures?

Cheers,

Andre


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

Mason Wheeler wrote:

I don’t know about the GL extension, but I do know that when you create
a texture
from an 8-bit (paletted) SDL_Surface, it automatically converts it
internally to
a 32-bit version.

Which leads me to think that SDL 1.3 can’t deal with them… Maybe
because the extension is not widely adopted?

It’d be great if paletted textures were supported, it allows for good
memory savings and cheap effects.

Thanks,

Andre> ------------------------------------------------------------------------

From: Andre de Leiradella
**Subject: [SDL] Paletted textures

Hi All,

Does anyone know how good is the support to GL_EXT_paletted_texture in
OpenGL nowadays?

Can SDL 1.3 deal with paletted textures?

Cheers,

Andre


SDL mailing list
SDL at lists.libsdl.org <mailto: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

What platforms are you targeting?

Unless you’re aiming at older handheld devices and the like, you might find
that the memory savings are irrelevant, and that the “cheap” effects are
actually more expensive than their proper, modern counterparts. :-)On Saturday 21 November 2009, at 01.45.43, Andre de Leiradella wrote:

Mason Wheeler wrote:

I don’t know about the GL extension, but I do know that when you create
a texture
from an 8-bit (paletted) SDL_Surface, it automatically converts it
internally to
a 32-bit version.

Which leads me to think that SDL 1.3 can’t deal with them… Maybe
because the extension is not widely adopted?

It’d be great if paletted textures were supported, it allows for good
memory savings and cheap effects.


//David Olofson - Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
’---------------------------------------------------------------------’

Andre de Leiradella wrote:

Mason Wheeler wrote:

I don’t know about the GL extension, but I do know that when you
create a texture
from an 8-bit (paletted) SDL_Surface, it automatically converts it
internally to
a 32-bit version.

Which leads me to think that SDL 1.3 can’t deal with them… Maybe
because the extension is not widely adopted?

Just to avoid confusion: I’m not saying that the extension is not widely
adopted, I’m just jumping to conclusions :stuck_out_tongue:

Cheers,

Andre> It’d be great if paletted textures were supported, it allows for good

memory savings and cheap effects.

Thanks,

Andre


From: Andre de Leiradella
**Subject: [SDL] Paletted textures

Hi All,

Does anyone know how good is the support to GL_EXT_paletted_texture in
OpenGL nowadays?

Can SDL 1.3 deal with paletted textures?

Cheers,

Andre


SDL mailing list
SDL at lists.libsdl.org <mailto: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


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

David Olofson wrote:> On Saturday 21 November 2009, at 01.45.43, Andre de Leiradella wrote:

Mason Wheeler wrote:

I don’t know about the GL extension, but I do know that when you create
a texture
from an 8-bit (paletted) SDL_Surface, it automatically converts it
internally to
a 32-bit version.
Which leads me to think that SDL 1.3 can’t deal with them… Maybe
because the extension is not widely adopted?

It’d be great if paletted textures were supported, it allows for good
memory savings and cheap effects.

What platforms are you targeting?

Unless you’re aiming at older handheld devices and the like, you might find
that the memory savings are irrelevant, and that the “cheap” effects are
actually more expensive than their proper, modern counterparts. :slight_smile:

iPhone for example, though I don’t know what its specs are…

As for cheap effects, I believe pelette rotation for a background image
would greatly benefit from a hardware accelerated blitting of a paletted
texture.

Cheers,

Andre

[…]

What platforms are you targeting?

Unless you’re aiming at older handheld devices and the like, you might
find that the memory savings are irrelevant, and that the “cheap” effects
are actually more expensive than their proper, modern counterparts. :slight_smile:

iPhone for example, though I don’t know what its specs are…

I see. Might be relevant there, but then again, low power hardware tends to
focus on doing a few things “reasonably fast”, and rely on software emulation
for the rest… It may well be that these devices focus on 8 bpp textures
(despite their 16 bpp displays) - but you may also find that palettes are
considered legacy junk, and only emulated using RGB(A) textures and software
conversions.

As for cheap effects, I believe pelette rotation for a background image
would greatly benefit from a hardware accelerated blitting of a paletted
texture.

Yes, IF the hardware actually has the palette look-up logic required.
Otherwise, the driver will have to re-convert the texture before rendering
whenever the palette has changed…On Saturday 21 November 2009, at 02.11.19, Andre de Leiradella wrote:


//David Olofson - Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
’---------------------------------------------------------------------’

David Olofson wrote:> On Saturday 21 November 2009, at 02.11.19, Andre de Leiradella wrote:

As for cheap effects, I believe pelette rotation for a background image
would greatly benefit from a hardware accelerated blitting of a paletted
texture.

Yes, IF the hardware actually has the palette look-up logic required.
Otherwise, the driver will have to re-convert the texture before rendering
whenever the palette has changed…

Sure, and that’s why I’m interested in the GL_EXT_paletted_texture
extension. But you’ve brought another question: if the driver says the
extension is supported, how to be sure it’s hardware accelerated and not
software emulated?

Thanks,

Andre

[…]

Yes, IF the hardware actually has the palette look-up logic required.
Otherwise, the driver will have to re-convert the texture before
rendering whenever the palette has changed…

Sure, and that’s why I’m interested in the GL_EXT_paletted_texture
extension. But you’ve brought another question: if the driver says the
extension is supported, how to be sure it’s hardware accelerated and not
software emulated?

Not sure if there is any reliable, portable way of doing that. Either way, a
feature being hardware accelerated doesn’t necessarily mean it’s fast enough
for your application.

I think the safest way is to benchmark - preferably combining operations the
same way as in-game - and create an initial configuration based on the
results. Perhaps not totally foolproof, but it’s probably a better idea than
the common “minimum everything” default configuration that leaves you with
horrible graphics and near unintelligible menus… :-)On Saturday 21 November 2009, at 02.54.25, Andre de Leiradella wrote:


//David Olofson - Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
’---------------------------------------------------------------------’

Hello, Andre!

AdL> Mason Wheeler wrote:

I don’t know about the GL extension, but I do know that when you create
a texture
from an 8-bit (paletted) SDL_Surface, it automatically converts it
internally to
a 32-bit version.

AdL> Which leads me to think that SDL 1.3 can’t deal with them… Maybe
AdL> because the extension is not widely adopted?

AdL> It’d be great if paletted textures were supported, it allows for good
AdL> memory savings and cheap effects.

As for memory savings (at least for texture data on local storage), you can
take a look at the GL_OES_compressed_paletted_texture mandatory extension
for OpenGL ES, these paletted textures are mainly used for fast compression.

With best regards, Mike Gorchak. E-mail: @Mike_Gorchak

[…]

Yes, IF the hardware actually has the palette look-up logic required.
Otherwise, the driver will have to re-convert the texture before
rendering whenever the palette has changed…

Sure, and that’s why I’m interested in the GL_EXT_paletted_texture
extension. But you’ve brought another question: if the driver says the
extension is supported, how to be sure it’s hardware accelerated and not
software emulated?

Not sure if there is any reliable, portable way of doing that. Either way, a
feature being hardware accelerated doesn’t necessarily mean it’s fast enough
for your application.

I think the safest way is to benchmark - preferably combining operations the
same way as in-game - and create an initial configuration based on the
results. Perhaps not totally foolproof, but it’s probably a better idea than
the common “minimum everything” default configuration that leaves you with
horrible graphics and near unintelligible menus… :slight_smile:

Benchmarking is the way to evaluate a feature to see if it will work
in your application. Of course, you have to run the benchmark on every
targeted platform to make sure it will work on all of them. BTW, on
iPhone that means you have to test on every model of iPhone.

Bob PendletonOn Fri, Nov 20, 2009 at 8:34 PM, David Olofson wrote:

On Saturday 21 November 2009, at 02.54.25, Andre de Leiradella wrote:


//David Olofson - Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| ?http://olofson.net ? http://kobodeluxe.com ? http://audiality.org ?|
| ?http://eel.olofson.net ?http://zeespace.net ? http://reologica.se ?|
’---------------------------------------------------------------------’


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


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

Benchmarking is the way to evaluate a feature to see if it will work
in your application. Of course, you have to run the benchmark on every
targeted platform to make sure it will work on all of them. BTW, on
iPhone that means you have to test on every model of iPhone.

Yeah, I’ll test first for the main platform (Windows) and will care for
the rest later…

Thanks,

Andre>

Bob Pendleton


//David Olofson - Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
’---------------------------------------------------------------------’


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

Benchmarking is the way to evaluate a feature to see if it will work
in your application. Of course, you have to run the benchmark on every
targeted platform to make sure it will work on all of them. BTW, on
iPhone that means you have to test on every model of iPhone.

Yeah, I’ll test first for the main platform (Windows) and will care for the
rest later…

Ergh… You probably already know this, but just in case someone out
their doesn’t know it…

You can’t just test on Windows. That only tests the machine on your
desk. Performance on Windows depends on graphics card, the drivers,
the version of Windows, the version of DirectX/OpenGL, which patches
have been applied, the CPU, and the hardware interface type. That is
why so many games run great on their developer’s PC, but no where
else.

Once you have a test written, send it to as many people as you can
without irritating them and get them to run the test on their
machines. That way you are likely to get it tested on a wide set of
hardware and software. Commercial testing labs have rooms full of PCs
with different hardware configurations and racks of hard drives loaded
with different software versions just so they can do a real test for
platforms like Windows.

The problem isn’t confined to Windows. It is the same for Macs (though
I think there are fewer versions) and it may be worse on Linux because
there are so many different distributions and so many different
versions of each distribution.

Bob PendletonOn Sun, Nov 22, 2009 at 11:39 AM, Andre de Leiradella wrote:

Thanks,

Andre

Bob Pendleton


//David Olofson - Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| ?http://olofson.net ? http://kobodeluxe.com ? http://audiality.org ?|
| ?http://eel.olofson.net ?http://zeespace.net ? http://reologica.se ?|
’---------------------------------------------------------------------’


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


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

Bob Pendleton wrote:

Once you have a test written, send it to as many people as you can
without irritating them and get them to run the test on their
machines.

Sure, I was planning on sending to the SDL mailing list…

Kidding!

I’ve got many friends who fit this role and I’ll send a test to them.
They are people who don’t know what a driver is or confuse drivers with
hard-drives :smiley:

While they represent my intended audience, I’m a bit worried on how to
get good feedback from them. I’m thinking about a questionnaire, but
more about this later.

Thanks,

Andre

[…]

I’ve got many friends who fit this role and I’ll send a test to them.
They are people who don’t know what a driver is or confuse drivers with
hard-drives :smiley:

While they represent my intended audience, I’m a bit worried on how to
get good feedback from them. I’m thinking about a questionnaire, but
more about this later.

Proper error handling! Check all return values etc, and perhaps have a
compile-time debug option that double-checks everything you can think of. That
way, if you get one of those “It doesn’t work!” responses, you may actually
figure out what happens if you also get a log file along with the report.

Taking it to extremes, you could even have the engine take screenshots at
various stages of rendering, but that’s going to generate rather massive
logs… ;-)On Monday 23 November 2009, at 22.52.54, Andre de Leiradella wrote:


//David Olofson - Developer, Artist, Open Source Advocate

.— Games, examples, libraries, scripting, sound, music, graphics —.
| http://olofson.net http://kobodeluxe.com http://audiality.org |
| http://eel.olofson.net http://zeespace.net http://reologica.se |
’---------------------------------------------------------------------’

David Olofson wrote:> On Monday 23 November 2009, at 22.52.54, Andre de Leiradella wrote:

[…]

I’ve got many friends who fit this role and I’ll send a test to them.
They are people who don’t know what a driver is or confuse drivers with
hard-drives :smiley:

While they represent my intended audience, I’m a bit worried on how to
get good feedback from them. I’m thinking about a questionnaire, but
more about this later.

Proper error handling! Check all return values etc, and perhaps have a
compile-time debug option that double-checks everything you can think of. That
way, if you get one of those “It doesn’t work!” responses, you may actually
figure out what happens if you also get a log file along with the report.

Taking it to extremes, you could even have the engine take screenshots at
various stages of rendering, but that’s going to generate rather massive
logs… :wink:

Since the game logic will be written in Lua, I’ll have beautiful stack
traces in case of errors. I’ll also add asserts in both the Lua and C++
parts. The error message (along with the stack trace) will be
automatically saved to a file, and maybe I could also save the last
image in the framebuffer.

I think I’ve recently seen something in the list about generating stack
traces of C++ programs?

Cheers,

Andre

On Windows you can have it configured such as a dump is generated when a
programm crashes, similar
to the UNIX core dump file.

That file together with your application and debug symbols can already
provide valuable information most of
the time.–
Paulo

On Mon, Nov 23, 2009 at 11:53 PM, Andre de Leiradella < aleirade at sct.microlink.com.br> wrote:

David Olofson wrote:

On Monday 23 November 2009, at 22.52.54, Andre de Leiradella < aleirade at sct.microlink.com.br> wrote:
[…]

I’ve got many friends who fit this role and I’ll send a test to them.
They are people who don’t know what a driver is or confuse drivers with
hard-drives :smiley:

While they represent my intended audience, I’m a bit worried on how to
get good feedback from them. I’m thinking about a questionnaire, but
more about this later.

Proper error handling! Check all return values etc, and perhaps have a
compile-time debug option that double-checks everything you can think of.
That way, if you get one of those “It doesn’t work!” responses, you may
actually figure out what happens if you also get a log file along with the
report.

Taking it to extremes, you could even have the engine take screenshots at
various stages of rendering, but that’s going to generate rather massive
logs… :wink:

Since the game logic will be written in Lua, I’ll have beautiful stack
traces in case of errors. I’ll also add asserts in both the Lua and C++
parts. The error message (along with the stack trace) will be automatically
saved to a file, and maybe I could also save the last image in the
framebuffer.

I think I’ve recently seen something in the list about generating stack
traces of C++ programs?

Cheers,

Andre


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

Paulo Pinto wrote:

On Windows you can have it configured such as a dump is generated when a
programm crashes, similar
to the UNIX core dump file.

Do you know how to configure the program this way?

Thanks,

Andre

Although I am new to Mac and iPhone development, I am not new to software
development (30 years, more than 20 in games).

I am trying to get SDL built on the Mac for iPhone dev. I have Xcode set
up, but the problem seems to be the instructions in the README.iphoneos
file.

"Instructions:

  1. Open SDLiPhoneOS.xcodeproj (located in Xcode-iPhoneOS/SDL) in XCode.
  2. Set Project->Set Active SDK to “Use Project Settings”
    "

Step 2 doesn’t work on Xcode 3.1.4. I only have specific options for the
various versions of the iPhone and Simulator.

I can successfully build the ONE target I have (StaticLibiPhoneOS).
However, I do not see the other two targets listed in the doc (see below):

The Doc shows these 3 targets, I only have the first one.
There are three build targets:

  • StaticLibiPhoneOS:
    Build SDL as a statically linked (armv6) library for iPhone OS 2.0.
  • StaticLibSimulator:
    Build SDL as a statically linked (x86) library for the iPhone
    Simulator
  • Template:
    Package a project template together with the SDL for iPhone static
    libraries and copies of the SDL headers. The template includes proper
    references to the SDL library and headers, skeleton code for a basic SDL
    program, and placeholder graphics for the application icon and startup
    screen.

Has anyone had any success building all 3 targets? Is there a difference
with Xcode 3.1.4 that prohibits me from selecting the "Use Project Settings"
for the Active SDK?

Thanks,

Ken

I am trying to get SDL built on the Mac for iPhone dev. I have Xcode set
up, but the problem seems to be the instructions in the README.iphoneos
file.

"Instructions:

  1. Open SDLiPhoneOS.xcodeproj (located in Xcode-iPhoneOS/SDL) in XCode.
  2. Set Project->Set Active SDK to “Use Project Settings”
    "

The documentation is out of date.

Step 2 doesn’t work on Xcode 3.1.4. I only have specific options for the
various versions of the iPhone and Simulator.

Assuming you need to actually change it, there are a dozen different
ways to change the Active SDK in Xcode. The most convenient one is in
the toolbar popup menu labeled overview. Another way is to open up the
Info panel for the project (double-click on the project at the top of
the Groups & Files panel) and in the general tab, change the Base SDK
for all Configurations. Not the most convenient one, but it’s always
there.

I think that Use Project Settings option was short lived in Xcode. I
don’t even remember that option. You should pick the specific target
you actually want.

I can successfully build the ONE target I have (StaticLibiPhoneOS).
However, I do not see the other two targets listed in the doc (see below):

There should only be one target now. Having separate targets for
simulator vs device goes against the grain.

The Doc shows these 3 targets, I only have the first one.
There are three build targets:

  • StaticLibiPhoneOS:
    Build SDL as a statically linked (armv6) library for iPhone OS 2.0.
  • StaticLibSimulator:
    Build SDL as a statically linked (x86) library for the iPhone
    Simulator
  • Template:

There never was a Template target. It is a separate directory that you
are expected to “install” on your system to use. See the SDL/Mac
directions on how to install templates.

-Eric