more color
This commit is contained in:
parent
3212f868ec
commit
7ac814bc48
2 changed files with 24 additions and 9 deletions
33
main.cpp
33
main.cpp
|
@ -64,7 +64,7 @@ using clock = std::chrono::steady_clock;
|
||||||
|
|
||||||
constexpr int width = 2000;
|
constexpr int width = 2000;
|
||||||
constexpr int height = 1000;
|
constexpr int height = 1000;
|
||||||
constexpr auto steps_per_second = 100'000;
|
constexpr auto steps_per_second = 1'000'000;
|
||||||
|
|
||||||
template <auto EF>
|
template <auto EF>
|
||||||
struct [[nodiscard("give this a name so SDL_Quit is called at the end"
|
struct [[nodiscard("give this a name so SDL_Quit is called at the end"
|
||||||
|
@ -88,6 +88,15 @@ struct Walker {
|
||||||
SDL_Point pos;
|
SDL_Point pos;
|
||||||
SDL_Color col;
|
SDL_Color col;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr auto html2sdl_color(Uint32 rgb) {
|
||||||
|
return SDL_Color{
|
||||||
|
.r = static_cast<Uint8>(rgb >> 16U),
|
||||||
|
.g = static_cast<Uint8>((rgb >> 8U) & 0xffU),
|
||||||
|
.b = static_cast<Uint8>(rgb & 0xffU),
|
||||||
|
.a = SDL_ALPHA_OPAQUE
|
||||||
|
};
|
||||||
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
template <typename Loopdata>
|
template <typename Loopdata>
|
||||||
|
@ -184,15 +193,21 @@ int main() try {
|
||||||
);
|
);
|
||||||
sdl_check(SDL_RenderClear(renderer));
|
sdl_check(SDL_RenderClear(renderer));
|
||||||
|
|
||||||
|
const auto middle = SDL_Point{.x = width / 2, .y = height / 2};
|
||||||
auto walkers = std::to_array<Walker>(
|
auto walkers = std::to_array<Walker>(
|
||||||
{{.pos = {.x = width / 2, .y = height / 2},
|
{/* {.pos = middle, .col = html2sdl_color(0x522258)},
|
||||||
.col = {.r = 0xff, .g = 0x00, .b = 0x00, .a = 0xff}},
|
{.pos = middle, .col = html2sdl_color(0x8C3061)},
|
||||||
{.pos = {.x = width / 2, .y = height / 2},
|
{.pos = middle, .col = html2sdl_color(0xC63C51)},
|
||||||
.col = {.r = 0x00, .g = 0xff, .b = 0x00, .a = 0xff}},
|
{.pos = middle, .col = html2sdl_color(0xD95F59)} */
|
||||||
{.pos = {.x = width / 2, .y = height / 2},
|
/* {.pos = middle, .col = html2sdl_color(0x402E7A)},
|
||||||
.col = {.r = 0x00, .g = 0x00, .b = 0xff, .a = 0xff}},
|
{.pos = middle, .col = html2sdl_color(0x4C3BCF)},
|
||||||
{.pos = {.x = width / 2, .y = height / 2},
|
{.pos = middle, .col = html2sdl_color(0x4B70F5)},
|
||||||
.col = {.r = 0x00, .g = 0x00, .b = 0x00, .a = 0xff}}}
|
{.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{}());
|
std::mt19937_64 rne(std::random_device{}());
|
||||||
|
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 432 KiB |
Loading…
Reference in a new issue