CG Mini Project
CG Mini Project
h>
#include <math.h>
#include <stdbool.h>
#define M_PI 3.14159265358979323846
int main() {
SDL_Init(SDL_INIT_VIDEO);
while (running) {
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
running = false;
}
}
// Physics calculations
angleAcceleration = (-1 * GRAVITY / RADIUS) * sin(angle);
angleVelocity += angleAcceleration;
angleVelocity *= DAMPING; // Damping effect
angle += angleVelocity;
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}