Skip to content

Commit a144a27

Browse files
committed
Add SDL initialisation
1 parent 3c3953c commit a144a27

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ void init(int &SCALE, int &DELAY, SDL_Window*& win, SDL_Renderer*& render,
4444
actor.setSeed(GLOBALSEED);
4545
}
4646

47+
// Initialise SDL
48+
SDL_Init(SDL_INIT_VIDEO);
49+
win = SDL_CreateWindow("SYCL Crowd Simulation", SDL_WINDOWPOS_UNDEFINED,
50+
SDL_WINDOWPOS_UNDEFINED, WIDTH * SCALE,
51+
HEIGHT * SCALE, SDL_WINDOW_SHOWN);
52+
render = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED);
4753
}
4854

4955
void drawCircle(SDL_Renderer *&render, SDL_Point center, int radius,

0 commit comments

Comments
 (0)