physics/main.cpp
2024-12-10 20:23:03 +01:00

51 lines
1.1 KiB
C++

// @BAKE g++ -o $*.out $@ -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 -ggdb
#include <math.h>
#include <stdlib.h>
#include <vector>
#include "raylib.h"
#include "util.hpp"
const int screenWidth = 800;
const int screenHeight = 600;
using namespace std;
/* All of the following headers define an object:
* Interface Content {
* void display(void);
* void control(Vector2 click);
* void update(void);
* } content;
* Why not polymorhpism?
* I'll let you know this is static polymorphysm
* with a static template method, also, fuck you.
* Please uncomment only one at a time.
*/
//#include "Block1D.hpp"
//#include "BouncyBlock1D.hpp"
#include "Block2D.hpp"
//#inline "BlockProjectile.hpp"
int main() {
InitWindow(screenWidth, screenHeight, "Physics Simulation");
SetTargetFPS(60);
while (!WindowShouldClose()) {
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) {
content.control(GetMousePosition());
}
content.update();
BeginDrawing();
ClearBackground(RAYWHITE);
content.display();
EndDrawing();
}
CloseWindow();
return 0;
}