#include #include #include #include #include #include int startw=1900; int starth=1100; void putPixelRGB(SDL_Renderer* renderer, int x, int y, unsigned char r,unsigned char g,unsigned char b){ SDL_SetRenderDrawColor(renderer,(Uint8)r,(Uint8)g,(Uint8)b,255); SDL_RenderDrawPoint(renderer,x,y); } void putRectRGB(SDL_Renderer* renderer, int x, int y, int size, unsigned char r,unsigned char g,unsigned char b){ SDL_Rect tmp_rect; tmp_rect.w = tmp_rect.h = size; tmp_rect.x=x; tmp_rect.y=y; SDL_SetRenderDrawColor(renderer,(Uint8)r,(Uint8)g,(Uint8)b,255); SDL_RenderFillRect(renderer,&tmp_rect); } void iterate_game(int **grid, int** nextgrid, int cols, int rows){ for (int i=0; i3)){ nextgrid[i][j]=0; } else { nextgrid[i][j]=state; } } } for (int i=0; i