refactor: Refactor OpenGL backend to use OpenGLEnums
Use centralized OpenGLEnums.h for enum conversion: - Remove local ToGL* functions from OpenGLCommandList - Replace with ToOpenGL() and ToOpenGLClearBuffer() from OpenGLEnums - Simplify OpenGLTexture, OpenGLBuffer, OpenGLSampler, etc.
This commit is contained in:
@@ -39,7 +39,7 @@ public:
|
||||
RHISwapChain* CreateSwapChain(const SwapChainDesc& desc) override;
|
||||
RHICommandList* CreateCommandList(const CommandListDesc& desc) override;
|
||||
RHICommandQueue* CreateCommandQueue(const CommandQueueDesc& desc) override;
|
||||
RHIShader* CompileShader(const ShaderCompileDesc& desc) override;
|
||||
RHIShader* CreateShader(const ShaderCompileDesc& desc) override;
|
||||
RHIPipelineState* CreatePipelineState(const GraphicsPipelineDesc& desc) override;
|
||||
RHIPipelineLayout* CreatePipelineLayout(const RHIPipelineLayoutDesc& desc) override;
|
||||
RHIFence* CreateFence(const FenceDesc& desc) override;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include "../RHIScreenshot.h"
|
||||
|
||||
namespace XCEngine {
|
||||
namespace RHI {
|
||||
@@ -9,8 +10,11 @@ namespace RHI {
|
||||
class OpenGLSwapChain;
|
||||
class OpenGLDevice;
|
||||
|
||||
class OpenGLScreenshot {
|
||||
class OpenGLScreenshot : public RHIScreenshot {
|
||||
public:
|
||||
bool Capture(RHIDevice* device, RHISwapChain* swapChain, const char* filename) override;
|
||||
void Shutdown() override {}
|
||||
|
||||
static bool Capture(OpenGLDevice& device,
|
||||
OpenGLSwapChain& swapChain,
|
||||
const char* filename);
|
||||
@@ -23,7 +27,8 @@ public:
|
||||
|
||||
private:
|
||||
static bool SavePPM(const char* filename,
|
||||
int width, int height);
|
||||
int width,
|
||||
int height);
|
||||
};
|
||||
|
||||
} // namespace RHI
|
||||
|
||||
Reference in New Issue
Block a user