Different SDL_UpdateRect behaviour between Win95/98 and Win98SE

Finally I’ve found the problem…

I was calling SDL_UpdateRect (Page,0,0,0,0)
to update all the screen area:

  • it works well in win95
  • it works well in win98 first edition
  • in win98 second edition I have to call SDL_UpdateRect (Page,0,0,639,479)

I’ve fixed my program by calling always the last one,
but I wonder if there’s a problem to fix in SDL sources,
because in them there are calls to SDL_UpdateRect (,0,0,0,0);

Bye,
Enzo.–
E-mail enzo.gupi at tiscalinet.it
Home page http://enzogupi.interfree.it

  • it works well in win95
  • it works well in win98 first edition
  • in win98 second edition I have to call SDL_UpdateRect (Page,0,0,639,479)

Bah, I’ve tried reducing the bottom left coordinates by one, and it actually
doesn’t draw the bottom-most left pixel in DirectX. Is this using the GDI
driver or DirectX?

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Sam Lantinga wrote:

  • it works well in win95
  • it works well in win98 first edition
  • in win98 second edition I have to call SDL_UpdateRect (Page,0,0,639,479)

Bah, I’ve tried reducing the bottom left coordinates by one, and it actually
doesn’t draw the bottom-most left pixel in DirectX. Is this using the GDI
driver or DirectX?

It is in DirectX full screen.

Have you been able to see the same bug on your computer?

Maybe in src/video/windx5/SDL_dx5video.c
in function DX5_WindowUpdate we can add something like this?

if (rects[i].w == 0) rects[i].w = -1;
if (rects[i].h == 0) rects[i].h = -1;

Bye,
Enzo.–
E-mail enzo.gupi at tiscalinet.it
Home page http://enzogupi.supereva.it

  • it works well in win95
  • it works well in win98 first edition
  • in win98 second edition I have to call SDL_UpdateRect (Page,0,0,639,479)

Bah, I’ve tried reducing the bottom left coordinates by one, and it actually
doesn’t draw the bottom-most left pixel in DirectX. Is this using the GDI
driver or DirectX?

It is in DirectX full screen.

Have you been able to see the same bug on your computer?

No, though I don’t have access to Win98SE.
It may be a bug in earlier versions of DirectX, where the corner pixel was
not being drawn, and now it is. I was really surprised to find that the
corner pixel was not being drawn, as the docs indicate that the rectangle
should be specified as (x,y) (x+w-1,y+h-1) but the rectangle necessary to
actually update the entire rectangle was (x,y), (x+w,y+h).

Try making that change in SDL_dx5video.c in UpdateRects, and let me know
if that works for all images.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Ooops! I’m really really sorry…
I’ve found that there was another bug on MY program!

I was calling a procedure called UpdateArea (top,left,right,bottom)
like this:

void Screen::UpdateArea (int top, int left, int right, int bottom)
{
SDL_UpdateRect (Page, top, left, right-left+1, bottom-top+1);
}

So, by calling UpdateArea (0,0,0,0) I was calling SDL_UpdateRect (0,0,1,1),
and by calling UpdateArea (0,0,639,479) I was calling SDL_UpdateRect (0,0,640,480)

Now I don’t understand why the program has worked before this change! :wink:

Thanks again and sorry for the mistake.

Bye,
Enzo.–
E-mail enzo.gupi at tiscalinet.it
Home page http://enzogupi.supereva.it

Ooops! I’m really really sorry…
I’ve found that there was another bug on MY program!

Well, I’m glad you found it. I just upgraded to Win98 SE last night,
and I ran a bunch of tests and everything seemed okay.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Sam Lantinga wrote:

Ooops! I’m really really sorry…
I’ve found that there was another bug on MY program!

Well, I’m glad you found it. I just upgraded to Win98 SE last night,
and I ran a bunch of tests and everything seemed okay.

I really hope you haven’t spent much time for it

Next time I’ll pay more attention to my code
before asking to the list

Bye,
Enzo.–
E-mail enzo.gupi at tiscalinet.it
Home page http://enzogupi.supereva.it

“Enzo” <enzo.gupi at tiscalinet.it> wrote in message
news:20000912092729.B700 at tiscalinet.it

Ooops! I’m really really sorry…
I’ve found that there was another bug on MY program!

I was calling a procedure called UpdateArea (top,left,right,bottom)
like this:

void Screen::UpdateArea (int top, int left, int right, int bottom)
{
SDL_UpdateRect (Page, top, left, right-left+1, bottom-top+1);
}

So, by calling UpdateArea (0,0,0,0) I was calling SDL_UpdateRect
(0,0,1,1),
and by calling UpdateArea (0,0,639,479) I was calling SDL_UpdateRect
(0,0,640,480)

That’s correct, isn’t it? SDL_UpdateRect(0, 0, 640, 480) should update the
whole screen in 640x480 mode.–
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games - http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor