?

Generation

generate functionSat, 18 Feb 2023

white background

void set_background(int r, int g, int b) { r = r % 256; g = g % 256; b = b % 256; if (r < 0) { r = 0; } if (g < 0) { g = 0; } if (b < 0) { b = 0; } std::cout << "r=" << r << " g=" << g << " b=" << b << "\n"; SDL_FillRect(screen, 0, SDL_MapRGB(screen->format,r,g,b)); }

Questions about programming?Chat with your personal AI assistant