diff --git a/main.cpp b/main.cpp index 29dcc17..717eee0 100644 --- a/main.cpp +++ b/main.cpp @@ -113,6 +113,7 @@ int main() try { sdl_check(SDL_RenderClear(renderer)); SDL_Point pos{.x = width / 2, .y = height / 2}; + SDL_Point pos1{.x = width / 2, .y = height / 2}; constexpr SDL_Point directions[] = { {.x = -1, .y = 0}, {.x = 1, .y = 0}, {.x = 0, .y = -1}, {.x = 0, .y = 1} }; @@ -160,14 +161,25 @@ int main() try { SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD ) )); - sdl_check( - SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, SDL_ALPHA_OPAQUE) - ); + sdl_check(SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 32)); sdl_check(SDL_RenderDrawPoints( renderer, point_batch.data(), point_batch.size() )); + for (auto step = 0z; step < batchsize; ++step) { + SDL_Point newpoint; + do { + newpoint = pos1 + directions[dist(rne)]; + } while (newpoint.x < 0 or newpoint.x >= width or newpoint.y < 0 or + newpoint.y >= height); + pos1 = newpoint; + point_batch[step] = newpoint; + } sdl_check(SDL_SetRenderDrawColor(renderer, 0xff, 0xff, 0xff, 32)); - sdl_check(SDL_RenderFillRect(renderer, nullptr)); + sdl_check(SDL_RenderDrawPoints( + renderer, point_batch.data(), point_batch.size() + )); + // sdl_check(SDL_SetRenderDrawColor(renderer, 0xff, 0xff, 0xff, 32)); + // sdl_check(SDL_RenderFillRect(renderer, nullptr)); // SDL_RenderCopy(renderer, fade_texture, nullptr, nullptr); ///// Render screen diff --git a/screenshot.png b/screenshot.png index 2e752d2..28c51dc 100644 Binary files a/screenshot.png and b/screenshot.png differ