From: Pete S. <pe...@vi...> - 2000-09-25 21:17:31
|
> I've recently noticed that using the slice notation to > set pixels (mySurface[y][x] = xxx) is not working in > fullscreen hardware-surface mode (Win98). It seems > like it worked for me before but I can't remember. > Should it work, or should it only work for software > surfaces? --Peter Nicolai hardware surfaces need to be locked for pixel access. (same for RLEACCEL and/or ASYNCBLIT surfaces too) in SDL, the code for SDL_LockSurface won't do anything if the surface doesn't need locking. it's an inexpensive call to wrap your pixel-access code with lock/unlock calls. Then your code works with HW and SW surfaces. of coarse, you can be really, really sure by calling the surface's mustlock() method. i'm pretty sure the time taken to check 'mustlock' outweighs it's benefit though. anyone want to test? anyways, this is just my guess to your problem. |