i am porting my win32C emulator to Win32ASM (fun :D)
but i am getting some funcky results on my surface.
what i usually do ,is clearing the surface with black (wm_paint)
on my drawing proc i set the pixel color i want (white / black only!)
and using surface pointer to copy the pixel to the right x,y location.



offset = (posy*ddsd.lPitch + posx);
*(szSurface+offset) = Pixel_Color;




mov ecx,posy
imul ecx,ddsd.lPitch
add ecx,posx
mov esi,ecx
add esi,szSurface
mov byte ptr [esi],al ; Pixel color
Posted on 2004-01-05 14:42:49 by wizzra
Shouldn't you multiply posx with bytes_per_pixel also ?
And since you are in Windowed mode you can not assume bytes_per_pixel :D
Posted on 2004-01-05 15:31:27 by BogdanOntanu
BogdanOntanu,
no need, thus u can 'force' the bits (user), but it could make it uglier.

anyway i found the bug,
i was streching the pixels with Y insted of X (in some part of the loop)
now it looks great.
pic below.

/me gives KetilO give hug on creating fantastic & easy DE ;)
not forgetting WinASM studio which is great too, but it takes time to adjust to it ;P
Posted on 2004-01-05 16:16:22 by wizzra
heres a pic ;)
Posted on 2004-01-05 16:26:41 by wizzra