Advertisement
j0h

Untitled

j0h
Sep 4th, 2016
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. bool LoadImages(){
  2.  
  3.     VideoCapture cap(0); // open the default camera
  4.     if(!cap.isOpened())  // check if we succeeded
  5.         return -1;
  6.        
  7.     //background = SDL_LoadBMP("graphics/background.bmp");
  8.     Mat frame;
  9.     cap >> frame; // get a new frame from camera
  10.     background = MatToSDL(frame);
  11.     cap.release();
  12.    
  13.     if(background == NULL){
  14.         printf("Image failed to load!\n");
  15.         //SDL_Quit();
  16.         return 0;
  17.     }
  18.     sprite = SDL_LoadBMP("graphics/sprite.bmp");
  19.     if(sprite == NULL)
  20.         return false;
  21.  
  22.     return true;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement