Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. void Funkcja8() {
  2. SDL_Color kolorLU;
  3. kolorLU.r = 17;
  4. kolorLU.g = 23;
  5. kolorLU.b = 255;
  6. SDL_Color kolorRD;
  7. kolorRD.r = 200;
  8. kolorRD.g = 202;
  9. kolorRD.b = 255;
  10. for(int y =0 ; y < height ; y++){
  11. for(int x = 0; x<width ; x++){
  12. setPixel(x,y,kolorLU.r-((x*1.0)*255/width+(y*1.0)*255/height)/2*kolorLU.r/255 + ((x*1.0)*255/width+(y*1.0)*255/width)/2*kolorRD.r/255,
  13. kolorLU.g-((x*1.0)*255/width+(y*1.0)*255/height)/2*kolorLU.g/255 + ((x*1.0)*255/width+(y*1.0)*255/height)/2*kolorRD.g/255,
  14. kolorLU.b-((x*1.0)*255/width+(y*1.0)*255/height)/2*kolorLU.b/255 + ((x*1.0)*255/width+(y*1.0)*255/height)/2*kolorRD.b/255);
  15. }
  16. }
  17.  
  18. SDL_Flip(screen);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement