feat: move circle
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -1,6 +1,7 @@
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_events.h>
|
||||
#include <SDL3/SDL_render.h>
|
||||
#include <SDL3/SDL_timer.h>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
||||
@@ -66,10 +67,19 @@ int main() {
|
||||
SDL_Event e;
|
||||
|
||||
bool exit = false;
|
||||
struct {
|
||||
int x;
|
||||
int y;
|
||||
} circle_pos;
|
||||
circle_pos = {10, 10};
|
||||
while (!exit) {
|
||||
exit = event_handling(e);
|
||||
draw_circle(renderer, 150, 150, 100);
|
||||
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
|
||||
SDL_RenderClear(renderer);
|
||||
draw_circle(renderer, circle_pos.x, circle_pos.y, 10);
|
||||
circle_pos.x++;
|
||||
SDL_RenderPresent(renderer);
|
||||
SDL_Delay(16);
|
||||
}
|
||||
|
||||
SDL_Quit();
|
||||
|
||||
Reference in New Issue
Block a user