Exstar's built-in physics engine is still not fully functional
Box2d will be integrated soon
Linking: Link Exstar when compiling
main.cpp
#include "Window.hpp"
int main()
{
Window* window = new Window(800,200,"Test Window");
window->setBackgroundColor(exstar::Color::Black);
window->run();
return 0;
}
include/Window.hpp
#include "Exstar/Window.h" class Window : public exstar::Window { public: Window(int width,int height,const char* title) : exstar::Window(width,height,title) { //Set framerate to 60 setFramerate(60); } void render(exstar::Graphics g){ //Set the Fill Color g.setColor(exstar::Color::Blue); //Render Rectangle at 0,0 with a width of 50 and height of 100 g.drawRect(0,0,50,100); }
};
Compiling with G++
g++ main.cpp -o app -lExstar -Iinclude/