Shkyera Engine
Easy to use, game engine for Python
Loading...
Searching...
No Matches
ModelComponent.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4#include <string>
5
9
10namespace shkyera {
11
12class ModelComponent : public BaseComponent<ModelComponent> {
13 public:
16
17 void updateImpl() const {
18 const auto& meshAsset = std::get<AssetRef<Mesh>>(mesh);
19 if (meshAsset) {
20 meshAsset->bind();
21 glDrawElements(GL_TRIANGLES, meshAsset->getMeshSize(), GL_UNSIGNED_INT, nullptr);
22 meshAsset->unbind();
23 }
24 }
25};
26
27} // namespace shkyera
Base component for implementing update functionality.
Definition BaseComponent.hpp:17
Definition ModelComponent.hpp:12
void updateImpl() const
Definition ModelComponent.hpp:17
HandleAndAsset< Mesh > mesh
Definition ModelComponent.hpp:14
HandleAndAsset< Material > material
Definition ModelComponent.hpp:15
Definition Asset.hpp:6
Definition Clock.hpp:9