Skip to main content
GameDev.net gamedev.net
🔒 Locked

SDL and Cocoa

Started by FruitJuice27 Nov 25, 2004 at 4:36 PM 1 replies 800+ views
Original Post
FruitJuice27
FruitJuice27
When I run this code in VC++6 it displays the bitmap in a window. However when I run the same code in XCode (cocoa), the window is black, the bitmap is not shown.

pSurface = SDL_SetVideoMode (640,500,16,SDL_HWSURFACE);
pBuffer = SDL_CreateRGBSurface (SDL_HWSURFACE,640,500,16,0,0,0,0);
pBuffer = SDL_LoadBMP("test.bmp");
int result = SDL_BlitSurface(pBuffer,NULL,pSurface,NULL);


I have spent some time debugging this and i assure you that the surfaces are not NULL. A check of the variable result shows success (0). I know that I have the right working directory since when I change the name of the bitmap, my result is negative for the blit. I have even tried it with a software surface. Does anyone have any ideas? Thanks Fruit
TravisWells
TravisWells
You don't seem to be updating the surface.
Try:
SDL_Flip(pSurface);

after the blit.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.