2025-07-05 13:28:41 +03:30
|
|
|
#pragma once
|
|
|
|
|
2025-07-17 10:44:00 +03:30
|
|
|
#include <math/vec4.hpp>
|
2025-07-05 13:28:41 +03:30
|
|
|
|
|
|
|
struct GLFWwindow;
|
|
|
|
|
2025-07-11 00:05:48 +03:30
|
|
|
namespace lt {
|
2025-07-05 13:28:41 +03:30
|
|
|
|
|
|
|
class SharedContext;
|
|
|
|
|
|
|
|
class RenderCommand
|
|
|
|
{
|
|
|
|
public:
|
2025-07-11 14:05:59 +03:30
|
|
|
static auto create(GLFWwindow *windowHandle, const Ref<SharedContext> &sharedContext)
|
2025-07-06 14:02:50 +03:30
|
|
|
-> Scope<RenderCommand>;
|
2025-07-05 13:28:41 +03:30
|
|
|
|
|
|
|
RenderCommand(const RenderCommand &) = delete;
|
2025-07-05 16:07:51 +03:30
|
|
|
|
2025-07-06 14:02:50 +03:30
|
|
|
auto operator=(const RenderCommand &) -> RenderCommand & = delete;
|
2025-07-05 13:28:41 +03:30
|
|
|
|
|
|
|
virtual ~RenderCommand() = default;
|
|
|
|
|
2025-07-05 15:36:53 +03:30
|
|
|
virtual void swap_buffers() = 0;
|
2025-07-05 16:07:51 +03:30
|
|
|
|
2025-07-17 10:44:00 +03:30
|
|
|
virtual void clear_back_buffer(const math::vec4 &clearColor) = 0;
|
2025-07-05 13:28:41 +03:30
|
|
|
|
2025-07-05 15:36:53 +03:30
|
|
|
virtual void draw(unsigned int count) = 0;
|
2025-07-05 16:07:51 +03:30
|
|
|
|
2025-07-05 15:36:53 +03:30
|
|
|
virtual void draw_indexed(unsigned int count) = 0;
|
2025-07-05 13:28:41 +03:30
|
|
|
|
2025-07-05 15:36:53 +03:30
|
|
|
virtual void default_target_framebuffer() = 0;
|
2025-07-05 13:28:41 +03:30
|
|
|
|
2025-07-05 15:36:53 +03:30
|
|
|
virtual void set_viewport(
|
2025-07-05 13:28:41 +03:30
|
|
|
unsigned int x,
|
|
|
|
unsigned int y,
|
|
|
|
unsigned int width,
|
|
|
|
unsigned int height
|
|
|
|
) = 0;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
RenderCommand() = default;
|
|
|
|
};
|
|
|
|
|
2025-07-11 00:05:48 +03:30
|
|
|
} // namespace lt
|