mirror of
https://github.com/NoelFB/blah.git
synced 2025-04-14 01:56:05 +08:00
d3d11 notes and updating dummy graphics backend
This commit is contained in:
parent
ea969e68cf
commit
ed1f26895b
private/blah/internal
@ -1,9 +1,7 @@
|
|||||||
#ifdef BLAH_USE_D3D11
|
#ifdef BLAH_USE_D3D11
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
// Note the D3D11 Implementation is super WIP
|
// Note the D3D11 Implementation is still a work-in-progress
|
||||||
// A bunch of rendering features aren't implemented at all
|
|
||||||
// and some stuff is .... ugly
|
|
||||||
|
|
||||||
#include <blah/internal/graphics_backend.h>
|
#include <blah/internal/graphics_backend.h>
|
||||||
#include <blah/internal/platform_backend.h>
|
#include <blah/internal/platform_backend.h>
|
||||||
|
@ -9,21 +9,15 @@ namespace Blah
|
|||||||
private:
|
private:
|
||||||
int m_width;
|
int m_width;
|
||||||
int m_height;
|
int m_height;
|
||||||
TextureFilter m_filter;
|
|
||||||
TextureWrap m_wrap_x;
|
|
||||||
TextureWrap m_wrap_y;
|
|
||||||
TextureFormat m_format;
|
TextureFormat m_format;
|
||||||
bool m_framebuffer;
|
bool m_framebuffer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Dummy_Texture(int width, int height, TextureFilter filter, TextureWrap wrap_x, TextureWrap wrap_y, TextureFormat format, bool framebuffer)
|
Dummy_Texture(int width, int height, TextureFormat format, bool framebuffer)
|
||||||
{
|
{
|
||||||
m_width = width;
|
m_width = width;
|
||||||
m_height = height;
|
m_height = height;
|
||||||
m_filter = filter;
|
|
||||||
m_wrap_x = wrap_x;
|
|
||||||
m_wrap_y = wrap_y;
|
|
||||||
m_format = format;
|
m_format = format;
|
||||||
m_framebuffer = framebuffer;
|
m_framebuffer = framebuffer;
|
||||||
}
|
}
|
||||||
@ -43,32 +37,6 @@ namespace Blah
|
|||||||
return m_format;
|
return m_format;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void set_filter(TextureFilter filter) override
|
|
||||||
{
|
|
||||||
m_filter = filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual TextureFilter get_filter() const override
|
|
||||||
{
|
|
||||||
return m_filter;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void set_wrap(TextureWrap x, TextureWrap y) override
|
|
||||||
{
|
|
||||||
m_wrap_x = x;
|
|
||||||
m_wrap_y = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual TextureWrap get_wrap_x() const override
|
|
||||||
{
|
|
||||||
return m_wrap_x;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual TextureWrap get_wrap_y() const override
|
|
||||||
{
|
|
||||||
return m_wrap_y;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void set_data(unsigned char* data) override
|
virtual void set_data(unsigned char* data) override
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -98,13 +66,8 @@ namespace Blah
|
|||||||
for (int i = 0; i < attachmentCount; i++)
|
for (int i = 0; i < attachmentCount; i++)
|
||||||
{
|
{
|
||||||
m_attachments.push_back(
|
m_attachments.push_back(
|
||||||
TextureRef(
|
TextureRef(new Dummy_Texture(width, height, attachments[i], true))
|
||||||
new Dummy_Texture(width, height,
|
);
|
||||||
TextureFilter::Linear,
|
|
||||||
TextureWrap::Repeat,
|
|
||||||
TextureWrap::Repeat,
|
|
||||||
attachments[i],
|
|
||||||
true)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,6 +131,10 @@ namespace Blah
|
|||||||
|
|
||||||
class Dummy_Mesh : public Mesh
|
class Dummy_Mesh : public Mesh
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
int64_t m_index_count = 0;
|
||||||
|
int64_t m_vertex_count = 0;
|
||||||
|
int64_t m_instance_count = 0;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Dummy_Mesh()
|
Dummy_Mesh()
|
||||||
@ -177,32 +144,32 @@ namespace Blah
|
|||||||
|
|
||||||
virtual void index_data(IndexFormat format, const void* indices, int64_t count) override
|
virtual void index_data(IndexFormat format, const void* indices, int64_t count) override
|
||||||
{
|
{
|
||||||
|
m_index_count = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void vertex_data(const VertexFormat& format, const void* vertices, int64_t count) override
|
virtual void vertex_data(const VertexFormat& format, const void* vertices, int64_t count) override
|
||||||
{
|
{
|
||||||
|
m_vertex_count = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void instance_data(const VertexFormat& format, const void* instances, int64_t count) override
|
virtual void instance_data(const VertexFormat& format, const void* instances, int64_t count) override
|
||||||
{
|
{
|
||||||
|
m_instance_count = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int64_t index_count() const override
|
virtual int64_t index_count() const override
|
||||||
{
|
{
|
||||||
return 0;
|
return m_index_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int64_t vertex_count() const override
|
virtual int64_t vertex_count() const override
|
||||||
{
|
{
|
||||||
return 0;
|
return m_vertex_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int64_t instance_count() const override
|
virtual int64_t instance_count() const override
|
||||||
{
|
{
|
||||||
return 0;
|
return m_instance_count;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -232,9 +199,9 @@ namespace Blah
|
|||||||
void GraphicsBackend::before_render() {}
|
void GraphicsBackend::before_render() {}
|
||||||
void GraphicsBackend::after_render() {}
|
void GraphicsBackend::after_render() {}
|
||||||
|
|
||||||
TextureRef GraphicsBackend::create_texture(int width, int height, TextureFilter filter, TextureWrap wrap_x, TextureWrap wrap_y, TextureFormat format)
|
TextureRef GraphicsBackend::create_texture(int width, int height, TextureFormat format)
|
||||||
{
|
{
|
||||||
return TextureRef(new Dummy_Texture(width, height, filter, wrap_x, wrap_y, format, false));
|
return TextureRef(new Dummy_Texture(width, height, format, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameBufferRef GraphicsBackend::create_framebuffer(int width, int height, const TextureFormat* attachments, int attachmentCount)
|
FrameBufferRef GraphicsBackend::create_framebuffer(int width, int height, const TextureFormat* attachments, int attachmentCount)
|
||||||
|
Loading…
Reference in New Issue
Block a user