#ifdef WIN32 #pragma comment(lib, "SDL.lib") #pragma comment(lib, "SDLmain.lib") #pragma comment(lib, "SDL_Image.lib") #endif #include "SDL.h" #include "SDL_image.h" #include <iostream> using namespace std;
image = IMG_Load(path);
#ifndef main_header #define main_header #ifdef WIN32 #pragma comment(lib, "SDL.lib") #pragma comment(lib, "SDLmain.lib") #pragma comment(lib, "SDL_Image.lib") #endif #include "SDL.h" #include "SDL_image.h" #include <iostream> #include <vector> #include <fstream> #include "CAnimation.h" using namespace std; int DisplayImage(SDL_Surface* destination, const char* path, int x, int y); #endif
#include "main.h"
CAnimation image(screen); if (image.Init("Animation") != 0) { cout << "Could not load animation!" << endl; SDL_Quit(); return 1; }
image.Draw(imgX, imgY);
Källa: http://blinkenlights.se/