19 lines
492 B
C++
19 lines
492 B
C++
|
|
#include <render.hpp>
|
|
#include <components.hpp>
|
|
|
|
#include<raylib.h>
|
|
#include <entt/entt.hpp>
|
|
|
|
void update_render_system(entt::registry ®istry){
|
|
auto view = registry.view<const Sprite, const Position>();
|
|
|
|
view.each([] (const auto &sprite, const auto &position){
|
|
if (sprite.texture){
|
|
DrawTexture(*(sprite.texture),position.x,position.y,WHITE);
|
|
}else{
|
|
DrawRectangle(position.x,position.y,50, 70,BLACK);
|
|
}
|
|
});
|
|
}
|