generated from McMassiveNZ/opengl-starter
Following along with the example for the simple
triangle in the DirectX-Graphics-Samples repository it can render a simple triangle
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
target_sources(
|
||||
dx12-starter PRIVATE
|
||||
device.h
|
||||
renderer.h
|
||||
window.h
|
||||
)
|
||||
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace dx12_starter
|
||||
{
|
||||
|
||||
struct DeviceCreateParams
|
||||
{
|
||||
void* nativeWindowHandle;
|
||||
int versionMajor;
|
||||
int versionMinor;
|
||||
};
|
||||
|
||||
class IDevice
|
||||
{
|
||||
public:
|
||||
virtual ~IDevice() = default;
|
||||
|
||||
virtual void ClearBuffers() = 0;
|
||||
virtual void Present() = 0;
|
||||
virtual void DrawScene() = 0;
|
||||
virtual void Destroy() = 0;
|
||||
|
||||
static std::unique_ptr<IDevice> Create(const DeviceCreateParams& params);
|
||||
};
|
||||
|
||||
} // namespace dx12_starter
|
||||
33
include/renderer.h
Normal file
33
include/renderer.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace dx12_starter
|
||||
{
|
||||
struct APIVersion
|
||||
{
|
||||
uint32_t major;
|
||||
uint32_t minor;
|
||||
};
|
||||
|
||||
struct RendererCreateParams
|
||||
{
|
||||
void* nativeWindowHandle;
|
||||
APIVersion minimumVersion;
|
||||
uint32_t frameCount;
|
||||
};
|
||||
|
||||
class IRenderer
|
||||
{
|
||||
public:
|
||||
virtual ~IRenderer() = default;
|
||||
|
||||
virtual void RecordCommands() = 0;
|
||||
virtual void Render() = 0;
|
||||
virtual void WaitForPreviousFrame() = 0;
|
||||
virtual void Destroy() = 0;
|
||||
|
||||
static std::unique_ptr<IRenderer> Create(const RendererCreateParams& params);
|
||||
};
|
||||
|
||||
} // namespace dx12_starter
|
||||
Reference in New Issue
Block a user