Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Bartek Sowka

Member Since 03 Apr 2012
Offline Last Active Apr 04 2012 12:02 AM

Topics I've Started

[C++][SDL] SDL_LoadBMP won't load the bitmap

03 April 2012 - 01:35 PM

Ok so my code is:
#include "SDL/SDL.h"
#include <iostream>
using namespace std;
int main( int argc, char* args[] )
{
    SDL_Surface* hello = NULL;
    SDL_Surface* screen = NULL;
    //Start SDL
    SDL_Init( SDL_INIT_EVERYTHING );
    screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );
    hello = SDL_LoadBMP("block.bmp");
    SDL_BlitSurface(hello,NULL,screen,NULL);
    SDL_Flip(screen);
    SDL_Delay(2000);
    SDL_FreeSurface( hello );
    //Quit SDL
    SDL_Quit();
    return 0;
}

I have the block.bmp in the same directory as my exe (Debug)

Oh and I'm using Code::Blocks.

Can anyone help me?

PARTNERS