SDL_BlitSurface()
でございます。
SDL_Surface *screen;
SDL_Surface *img;
SDL_Rect rect;
rect.x=0;rect.y=0;
SDL_BlitSurface( img , NULL , screen , &rect );
#include <stdio.h> #include "SDL/SDL.h" #include "SDL/SDL_image.h" #pragma comment(lib, "SDL.lib") #pragma comment(lib, "SDLmain.lib") #pragma comment(lib, "SDL_image.lib") bool Init(void); //初期処理 bool Event(void); //イベント処理 void End(void); //終了処理 SDL_Surface *screen; SDL_Surface *img; int main(int argc, char* argv[]) { if(!Init()) //初期化&確認 { printf("初期化に失敗しました"); return 0; } img = IMG_Load("sample.png"); //これでimgには、sample.pngが入りました。 while(1) //メインループ { SDL_Rect rect; rect.x=0;rect.y=0; rect.w=640;rect.h=480; SDL_BlitSurface(img,NULL,screen,&rect); //imgをscreenに転送 SDL_Flip(screen); if(!Event()) //イベント確認 { break; //イベントがfalseなら、ループを抜ける } SDL_Delay(100); } End(); //終了処理へ return 0; } ・・・以下省略・・・