Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool LoadImages(){
- VideoCapture cap(0); // open the default camera
- if(!cap.isOpened()) // check if we succeeded
- return -1;
- //background = SDL_LoadBMP("graphics/background.bmp");
- Mat frame;
- cap >> frame; // get a new frame from camera
- background = MatToSDL(frame);
- cap.release();
- if(background == NULL){
- printf("Image failed to load!\n");
- //SDL_Quit();
- return 0;
- }
- sprite = SDL_LoadBMP("graphics/sprite.bmp");
- if(sprite == NULL)
- return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement