No updateting in Windowmode!

I start writing a very simple test program setting up a windowmode using:
screen = SDL_SetVideoMode(640, 480, 0, 0);

when i’m then blitting an image to “screen” and performing an
SDL_updateRect(), nothing is to see just an black window!

but when i’m swtching to fullscreen or using from start fullscreen, it works.
when switching back to windowmode it works on.

very suspicious is that in an other programm from it works in windowmode
after i created an SDL-thread in wich the “SDL_WaitEvent(…)” function is
called. After that SDL_updateRect() allwais does what it schould.

I reduced both programms just to this to things and i do not see whats
wrong!!!

PLEASE if anybody knows help…

thanks, stefan___________________________________________________________________
/_THE_END______________________________________________/_

At 17.30 12/12/01 +0100, you wrote:

I start writing a very simple test program setting up a windowmode using:
screen = SDL_SetVideoMode(640, 480, 0, 0);
when i’m then blitting an image to “screen” and performing an
SDL_updateRect(), nothing is to see just an black window!

Are you sure that the image you are blitting is in the same format of the
window?

With depth=0 you cannot make any assumption on the bitsperpixel of the
allocated surface.

very suspicious is that in an other programm from it works in windowmode
after i created an SDL-thread in wich the “SDL_WaitEvent(…)” function is
called. After that SDL_updateRect() allwais does what it schould.

You should ALWAYS run the event handling code in the same thread where you
opened the window with SetVideoMode!

Bye,
Gabry (gabrielegreco at tin.it)

At 17.30 12/12/01 +0100, you wrote:

I start writing a very simple test program setting up a windowmode using:
screen = SDL_SetVideoMode(640, 480, 0, 0);
when i’m then blitting an image to “screen” and performing an
SDL_updateRect(), nothing is to see just an black window!

Are you sure that the image you are blitting is in the same format of the
window?

YES! i’m using the transformation showen in the examples wich works.
an other curios thing is that when switching to fullscreen with the toggle
function directly after the vidmode setting up and then imeditly switching
back to windowmode, it seems to work as a dirty workaround cause then it
works: everytime i’m using updaterect it does waht opposed to do!

With depth=0 you cannot make any assumption on the bitsperpixel of the
allocated surface.

very suspicious is that in an other programm from it works in windowmode
after i created an SDL-thread in wich the “SDL_WaitEvent(…)” function is
called. After that SDL_updateRect() allwais does what it schould.

You should ALWAYS run the event handling code in the same thread where you
opened the window with SetVideoMode!

why this?

Bye,
Gabry (gabrielegreco at tin.it)

thanks, Stefan

p.s. i’m using SDL v1.2.2On Wed, 12 Dec 2001, Gabriele Greco wrote:


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