#include "SDL.h" // include SDL
int main(int argc, char *argv[])
{
// the screen we will draw to.
SDL_Surface *screen;
// the surface to draw the bitmap on.
SDL_Surface *bmp;
// area to draw the bitmap to.
SDL_Rect targetarea;
// initialize SDL. // I use everything as it will load video as well.
SDL_Init(SDL_INIT_EVERYTHING);
/*
set up the screen pass in screen
width,height,bpp and set SDL to software
rendering
*/
screen = SDL_SetVideoMode(640,480,32, SDL_SWSURFACE);
// load a bitmap.
bmp = SDL_LoadBMP("test.bmp");
targetarea.x = 10; // target x
targetarea.y = 20; // target y
targetarea.w = bmp->w; // target width
targetarea.h = bmp->h; // target height
// Draw the bitmap to the target area
SDL_BlitSurface(bmp, NULL, screen, &targetarea);
// show the bitmap // double buffering
SDL_Flip(screen);
while(1);
}
But I keep getting this error type thing. It allows me to run the program but immediately crashes.
LINK : c:\users\user\documents\visual studio 2010\Projects\SDL2\Debug\SDL2.exe not found or not built by the last incremental link; performing full link

New Topic/Question
Reply




MultiQuote



|