Advertisement

SDL_LOADBMP issues...

Started by October 24, 2011 10:20 PM
1 comment, last by WombatIDee-gafRichardson 13 years, 1 month ago
I recently jumped over to SDL from Allegro and "SDL_LOADBMP" doesn't actually load my bmp...
I've tried several different solutions, but none have solved my problem.
Only a black screen is displayed.
Any help would be greatly appreciated.

#include <iostream>
#include "SDL/SDL.h"
using namespace std;



int main( int argc, char* args[] ) {

const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
const int SCREEN_DEPTH = 32;

SDL_Surface *screen = NULL;
SDL_Surface *bitmap = NULL;
SDL_Rect offset;

SDL_Init( SDL_INIT_EVERYTHING );

//Build Screen
screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_DEPTH, SDL_SWSURFACE);
offset.x = 0;
offset.y = 0;
offset.h = SCREEN_HEIGHT;
offset.w = SCREEN_WIDTH;
//Load Image
bitmap = SDL_LoadBMP( "c:\hello.bmp" );

//Add image
SDL_BlitSurface (bitmap, NULL, screen, &offset);
SDL_Flip(screen);

while(true);
}
Because '\h' isn't a recognized escape character.
Advertisement

Because '\h' isn't a recognized escape character.


Embarrassing...
Thank you so much. xD

This topic is closed to new replies.

Advertisement