aboutsummaryrefslogtreecommitdiff
path: root/tests/hello_world_sdl.cpp
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-18 07:59:06 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-18 07:59:06 -0800
commit56b65a54cb92d2d4a34535f71dbae08d758d3fc3 (patch)
tree0220d27388eab38587a8fd12140552e0ce513435 /tests/hello_world_sdl.cpp
parente77d99dac0b1ba58c773b4b8c7d8a223ad008624 (diff)
parent47bc8ba2c47c67d8824c2b7bf35195a079cbed7c (diff)
Merge branch 'incoming'
Diffstat (limited to 'tests/hello_world_sdl.cpp')
-rw-r--r--tests/hello_world_sdl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/hello_world_sdl.cpp b/tests/hello_world_sdl.cpp
index f3fb8ae7..df69b055 100644
--- a/tests/hello_world_sdl.cpp
+++ b/tests/hello_world_sdl.cpp
@@ -8,7 +8,7 @@ int main() {
SDL_Init(SDL_INIT_VIDEO);
SDL_Surface *screen = SDL_SetVideoMode(256, 256, 32, SDL_SWSURFACE);
- SDL_LockSurface(screen);
+ if (SDL_MUSTLOCK(screen)) SDL_LockSurface(screen);
for (int i = 0; i < 256; i++) {
for (int j = 0; j < 256; j++) {
*((char*)screen->pixels + i*256*4 + j*4 + 0) = i;
@@ -17,7 +17,7 @@ int main() {
*((char*)screen->pixels + i*256*4 + j*4 + 3) = 255;
}
}
- SDL_UnlockSurface(screen);
+ if (SDL_MUSTLOCK(screen)) SDL_UnlockSurface(screen);
SDL_Flip(screen);
printf("you should see a colored cube.");