diff --git a/main.cpp b/main.cpp index ef0eebd..c4bc0f3 100644 --- a/main.cpp +++ b/main.cpp @@ -64,7 +64,7 @@ using clock = std::chrono::steady_clock; constexpr int width = 2000; constexpr int height = 1000; -constexpr auto steps_per_second = 100'000; +constexpr auto steps_per_second = 1'000'000; template struct [[nodiscard("give this a name so SDL_Quit is called at the end" @@ -88,6 +88,15 @@ struct Walker { SDL_Point pos; SDL_Color col; }; + +constexpr auto html2sdl_color(Uint32 rgb) { + return SDL_Color{ + .r = static_cast(rgb >> 16U), + .g = static_cast((rgb >> 8U) & 0xffU), + .b = static_cast(rgb & 0xffU), + .a = SDL_ALPHA_OPAQUE + }; +} } // namespace template @@ -184,15 +193,21 @@ int main() try { ); sdl_check(SDL_RenderClear(renderer)); + const auto middle = SDL_Point{.x = width / 2, .y = height / 2}; auto walkers = std::to_array( - {{.pos = {.x = width / 2, .y = height / 2}, - .col = {.r = 0xff, .g = 0x00, .b = 0x00, .a = 0xff}}, - {.pos = {.x = width / 2, .y = height / 2}, - .col = {.r = 0x00, .g = 0xff, .b = 0x00, .a = 0xff}}, - {.pos = {.x = width / 2, .y = height / 2}, - .col = {.r = 0x00, .g = 0x00, .b = 0xff, .a = 0xff}}, - {.pos = {.x = width / 2, .y = height / 2}, - .col = {.r = 0x00, .g = 0x00, .b = 0x00, .a = 0xff}}} + {/* {.pos = middle, .col = html2sdl_color(0x522258)}, + {.pos = middle, .col = html2sdl_color(0x8C3061)}, + {.pos = middle, .col = html2sdl_color(0xC63C51)}, + {.pos = middle, .col = html2sdl_color(0xD95F59)} */ + /* {.pos = middle, .col = html2sdl_color(0x402E7A)}, + {.pos = middle, .col = html2sdl_color(0x4C3BCF)}, + {.pos = middle, .col = html2sdl_color(0x4B70F5)}, + {.pos = middle, .col = html2sdl_color(0x3DC2EC)} */ + {.pos = middle, .col = html2sdl_color(0x006769)}, + {.pos = middle, .col = html2sdl_color(0x40A578)}, + {.pos = middle, .col = html2sdl_color(0x9DDE8B)}, + {.pos = middle, .col = html2sdl_color(0xE6FF94)} + } ); std::mt19937_64 rne(std::random_device{}()); diff --git a/screenshot.png b/screenshot.png index 28c51dc..53f8c31 100644 Binary files a/screenshot.png and b/screenshot.png differ