Sam Lantinga skrev:
This is not exactly correct. It is possible to have a pitch that extends
past the edge of the visible screen area:
Ok, that?s what I was trying to say…
The invisible area could contain offscreen video surfaces, or may be visible
in the overscan area, so you should write up to the logical pixel width,
rather than the pitch of the surface:
memset(surface->pixels, 0, surface->w*surface->format->BytesPerPixel);
Yes, anything else would be a real waste of time.
Unfortunately, hardware scrolling is not portable. You could under Linux
using XFree86 DGA set the display base address and use that to do hardware
scrolling, but there’s no way to do that in a window or as far as I know
under DirectX (I could be wrong about that, though I looked pretty hard
for a way to do it.)
I don?t know anything about DirectX. I puked all over the API when i
read through some of it. but I have a friend who is working with D3D. I
will ask him if he knows a way to do this. But then there?s the
How is this handled by default under Windoze??
How is what handled under Windows?
The fact that pitch is autoset to the value I am running as deafult.
Windows doesn?t use virtual resolution so perhaps it?s diffrent??
Well it doesn?t matter that much.
Wouldn?t it be nice to be able to controll that pictch (on the Amiga we call
it modulo) when you open the videomode???
I know of no way on any platform to do that.
Well, I did this when I created a class for handling VBE under Dos. So I
know how to do it with low-level-stuff but I can?t say if it can be done
through DGA since I don?t know anything about that. I do not like the
idea of not being able change the pitch. It?s allways a nice thing to
have a scanline of 4096 or 2048. Then you can use shifts instead of muls
when addressing the LFB and win a lot of time. But if the pitch is set
by default to a value you can?t be sure of, it can?t be done.
Christian Granstr?m, Bryggerigatan 4A, 733 34 Sala, Sweden
home:0224-77312, cellular:070-4961587, work:018-184470
@christian.granstrom, christian.granstrom at home.se