SDL-1.1.0, Win32, GDI, Fullscreen, 8-bit Again

Hello:
The following code shows wrong colors with the windib video driver.
I test it on a Pentium II and AMD athlon both with WIN98.
I want to know if it’s a bug I should report (found nothing on bugzilla).
I found an email from March 2000 with the same warning
([SDL] SDL-1.1.0, Win32, GDI, Fullscreen, 8-bit)

#include “SDL.h”

int main(int argc,char** argv){

SDL_Init(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE);
SDL_Surface * screen = SDL_SetVideoMode(640, 480, 8,SDL_HWPALETTE);
SDL_Surface * s=SDL_LoadBMP(“planet1.bmp”);
SDL_SetColors(screen, s->format->palette->colors,
0,s->format->palette->ncolors);

SDL_FillRect(screen,NULL,SDL_MapRGB(screen->format,0,0,0));
SDL_Rect r={(screen->w-s->w)>>1,(screen->h-s->h)>>1,s->w,s->h};
SDL_BlitSurface(s,NULL,screen,&r);
SDL_Flip(screen);

SDL_Delay(1000);

SDL_Quit();
return 0;
}----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

 The following code shows wrong colors with the windib video driver.

I test it on a Pentium II and AMD athlon both with WIN98.
I want to know if it’s a bug I should report (found nothing on bugzilla).
I found an email from March 2000 with the same warning
([SDL] SDL-1.1.0, Win32, GDI, Fullscreen, 8-bit)

To be clear, you aren’t using SDL 1.1.0, too, right?

–ryan.

To be clear, you aren’t using SDL 1.1.0, too, right?

That’s correct. I’m using SDL 1.2.11 with mingw.
The image I used is in

That’s correct. I’m using SDL 1.2.11 with mingw.

Works on Linux, so it’s probably a bug in SDL; Try removing
SDL_HWPALETTE…it might work around the bug.

–ryan.

Well, actually the problem was just using the windib driver .
So using directx instead worked fine.

I will try removing SDL_HWPALETTE, but since I made fade effects with
the physical palette I’m affraid that
might give me problems on some machines.

I do not understand exactly how SDL_HWPALETTE relates to the workings of
palette handling. I just asumed that
it gives the best compatibility. ?Am I wrong?

I’m registering the issue in bugzilla.

Thanks.

Ryan C. Gordon wrote:>>That’s correct. I’m using SDL 1.2.11 with mingw.

Works on Linux, so it’s probably a bug in SDL; Try removing
SDL_HWPALETTE…it might work around the bug.

–ryan.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I do not understand exactly how SDL_HWPALETTE relates to the workings of
palette handling. I just asumed that
it gives the best compatibility. ?Am I wrong?

You’re right about compatibility, but only on systems that are in 256
color mode in general, which aren’t many machines at this point.

I figured if you were having palette bugs, it might push the driver
through a less buggy codepath. But if you’re doing palette effects,
HWPALETTE should give you better performance, too, when it works.

–ryan.