Jump to content
  • Advertisement
Sign in to follow this  
WombatIDee-gafRichardson

SDL_LOADBMP issues...

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!