[SDL] Weird surface behavior

Mattias Engdegård f91-men at nada.kth.se
Wed Aug 22 02:08:01 PDT 2001


Ti Leggett <leggett at eecs.tulane.edu> wrote:
>color_map->pixels should remain constant since all I do is load the image once
>and copy from it. surface->pixels should change only once (the first pass
>through). After that it should remain the same since color_map shouldn't
>change.

>> Also in the main loop don't you need to lock a surface even to get read
>> access to it (I am not sure)?

No.

1. surface->pixels may return a different value each time the surface is
   locked, so don't keep a pointer to pixels after unlocking
2. you must lock surfaces for any pixel access, reading or writing





More information about the SDL mailing list