Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. void Application::Render()
  2. {
  3. //render drawbox
  4. SDL_Rect offset;
  5. offset.x = test->getxoffset();
  6. offset.y = test->getyoffset();
  7. int width = test->getwidth();
  8. int height = test->getheight();
  9.  
  10. for( int j = 0; j < height; j++) {
  11. for( int i = 0; i < width; i++) {
  12. offset.x += 10;
  13. if(test->getarrayvalue(j,i) == 0) {
  14. SDL_BlitSurface( pixelnotset, NULL, mWindow.GetSurface(), &offset);
  15. }
  16. else
  17. SDL_BlitSurface( pixelset, NULL, mWindow.GetSurface(), &offset);
  18.  
  19. }
  20. offset.x = test->getxoffset();
  21. offset.y += 10;
  22. }
  23.  
  24.  
  25.  
  26. SDL_BlitSurface( neuron, NULL, mWindow.GetSurface(), NULL);
  27. SDL_Flip( mWindow.GetSurface() );
  28. //Here, we will draw our images to the screen
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement