Archived

This topic is now archived and is closed to further replies.

fluke

Linear vs. Nonlinear memory

Recommended Posts

fluke    136
what is linear/nonlinear memory and how do they relate to surfaces and the screen? i''m using lamothe''s book as a tutorial and it''s great, but he just seemed to jump right into this w/out much explanation... just the stuff on how these affect horizontal memory pitch... confusing!!! anyone care to share some input or know a place on the net that might better explain these concepts? thanks!

Share this post


Link to post
Share on other sites
What Andre'' LaMothe meant is, that if you have a pointer to some
video memory, for example running in 640x480x16bpp, the memory can
be for example 800x480x16bpp, although the current screen''s resolution
is 640x480.
So the memory pitch to the next line of the screen is not the screen''s width,
it''s rather the pitch value DDraw returns with DDSurface->Lock
(here 800, with my example)

You can imagine the Drawing Surface as a rectangular part of a bigger surface
in the video ram, so the width of your Drawig Surace cannot be the pitch to
next line, its the one of the bigger surface.
(well, it sometimes is, exactly when you dsurface has same size as that in vram)

Share this post


Link to post
Share on other sites