News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

GDI memory alignment

Started by redskull, February 03, 2008, 08:03:43 PM

Previous topic - Next topic

redskull

Does anyone have anything 'official' as it relates to GDI drawing functions needing data aligned on DWORD boundaries?  I often run into quirkly lock-up problems when using non-aligned data that seem to magically resolve themselves when the data is subsequently aligned.  For example, Polygon() takes a pointer to a set of data points; if the points are non-aligned, the program (sometimes) hangs in the function forever.  Can anyone else confirm or deny this behavior, or point me to a reference that does?

TIA
-alan
Strange women, lying in ponds, distributing swords, is no basis for a system of government

MichaelW

I couldn't find any information on this problem, and on my system, using the default Windows 2000 drivers for a fairly ancient Matrox G200, the Polygon function has no problems with the array of vertices at any alignment. Perhaps the problem is with later versions of Windows and/or more recent drivers. The attachment is my crude test app.


[attachment deleted by admin]
eschew obfuscation

u

MichaelW's test runs perfectly on:
Win2k SP5(unofficial) with GF7600GT and okay drivers

redskull, maybe it's your drivers that ruin things for you? Or a part of some OS file is damaged (has happened to me)
Please use a smaller graphic in your signature.

jj2007

Michael's test works on XP SP2 with NVIDIA GeForce 6200 TurboCache

redskull

I guess it must just be this particular video card; it's a crappy notebook card that's suspect to begin with (it doesn't change resolution, it just changes screen size), so i'm not inclined to get so upset about it.  I would have thought Windows would do some altering of the memory, at least a little bit, before the driver gets hold of it; I guess video cards have some sort of DMA-like thing?
In either case, thanks to everyone for helping out in testing it.

-alan
Strange women, lying in ponds, distributing swords, is no basis for a system of government