Hey guies, I studied SDL following lazy’s tutorial.
But, when i try to load a bitmap and display it as tutorial, the screen is always black.
It occurs when debugging.
But when i started the execute in command line and windows, it’s OK.
Could you give me a hand and tell me why?
Code:
#include <SDL\sdl.h>
int main(int argc, char* args[])
{
t
SDL_Surface* pHello = NULL;
SDL_Surface* pScreen = NULL;
You don’t have an error checking. Your image could have failed to
load. Try using SDL_GetError() if an error is detected (e.g.
SDL_LoadBMP() returns NULL). Almost all SDL functions can return an
error code.On 23 March 2010 08:43, lth0721 at 163.com <lth0721 at 163.com> wrote:
You don’t have an error checking. Your image could have failed to
load. Try using SDL_GetError() if an error is detected (e.g.
SDL_LoadBMP() returns NULL). Almost all SDL functions can return an
error code.
Some applications do not set the working directory correctly when running
other programs (Konqueror and Dolphin, I’m looking at you). I’m actually
surprised that Eclipse would mess it up. Code::Blocks works fine.
Jonny DOn Fri, Mar 26, 2010 at 7:01 AM, lth0721 at 163.com <lth0721 at 163.com> wrote:
Brian Barrett wrote:
You don’t have an error checking. Your image could have failed to
load. Try using SDL_GetError() if an error is detected (e.g.
SDL_LoadBMP() returns NULL). Almost all SDL functions can return an
error code.