• 12
• 12
• 9
• 10
• 13

# SDL and Cocoa

This topic is 4864 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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);
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

##### Share on other sites
You don't seem to be updating the surface.
Try:
SDL_Flip(pSurface);

after the blit.