Files
OpenEngine/open_engine/include/open_engine/renderer/render_command.hpp
2026-02-22 23:18:27 +01:00

53 lines
1.3 KiB
C++

#ifndef RENDER_COMMAND_HPP
#define RENDER_COMMAND_HPP
#include "open_engine/core.hpp"
#include "open_engine/opengl/opengl_renderer_api.hpp"
#include "open_engine/renderer/renderer_api.hpp"
#include "open_engine/ref_scope.hpp"
#include <cstdint>
namespace OpenEngine {
class RenderCommand
{
public:
inline static void Init()
{
OE_PROFILE_FUNCTION();
api->Init();
};
inline static void SetClearColor(const glm::vec4& color)
{
api->SetClearColor(color);
};
inline static void Clear()
{
api->Clear();
};
inline static void DrawIndexed(const Ref<VertexArray>& vertex_array, uint32_t count = 0)
{
OE_PROFILE_FUNCTION();
api->DrawIndexed(vertex_array, count);
};
inline static void SetViewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height)
{
OE_PROFILE_FUNCTION();
api->SetViewport(x, y, width, height);
};
private:
static inline Scope<RendererAPI> api = CreateScope<OpenGLRendererAPI>();
};
}
#endif // RENDER_COMMAND_HPP