SDLで画面を設定できるように、SDL_Surfaceを関数に渡す方法が少し混乱しています。
これは私のエラーです:
No operator "=" matches these operands
私の機能はこれです:
void SDL_Start(SDL_Surface screen){
Uint32 videoflags = SDL_SWSURFACE | SDL_DOUBLEBUF | SDL_ANYFORMAT;// | SDL_FULLSCREEN;
// Initialize the SDL library
if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
fprintf(stderr, "Couldn't initialize SDL: %s\n",
SDL_GetError());
exit(500);
}
//get player's screen info
const SDL_VideoInfo* myScreen = SDL_GetVideoInfo();
//SDL screen
int reso_x = myScreen->current_w;
int reso_y = myScreen->current_h;
Uint8 video_bpp = 32;
//setup Screen [Error on the line below]
screen = SDL_SetVideoMode(reso_x, reso_y, video_bpp, videoflags|SDL_FULLSCREEN);
}
この関数は私のメイン関数で次のように呼び出されます:
SDL_Surface *screen;
SDL_Start(*screen);
間違いは何ですか?