39 lines
637 B
C++
39 lines
637 B
C++
#include "Window.h"
|
|
#include "Entity.h"
|
|
#include <SDL2/SDL_render.h>
|
|
#include <functional>
|
|
#include <SDL2/SDL.h>
|
|
|
|
Entity* ent;
|
|
|
|
bool my_setup(Window* win){
|
|
ent = new Entity({10,10}, {5,0}, {0,2});
|
|
return true;
|
|
}
|
|
|
|
bool my_Draw(Window* win){
|
|
|
|
SDL_Renderer* ren = win->GetRenderer();
|
|
|
|
/* if(win->step){ */
|
|
ent->Update();
|
|
win->step = false;
|
|
/* } */
|
|
Vec2 ent_pos = ent->GetPos();
|
|
|
|
SDL_SetRenderDrawColor(ren, 0xff, 0x00, 0x00, 0x00);
|
|
win->DrawCircle(ren, ent_pos.x, ent_pos.y, 5, true);
|
|
|
|
return true;
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
Window win("test", 100, 100);
|
|
win.Draw(my_setup, my_Draw);
|
|
|
|
delete ent;
|
|
|
|
return 0;
|
|
}
|