Refactor material system (#382)
This commit is contained in:
@@ -19,7 +19,7 @@ namespace Nz
|
||||
class RenderPass;
|
||||
class Texture;
|
||||
|
||||
class NAZARA_OPENGLRENDERER_API OpenGLFboFramebuffer : public OpenGLFramebuffer
|
||||
class NAZARA_OPENGLRENDERER_API OpenGLFboFramebuffer final : public OpenGLFramebuffer
|
||||
{
|
||||
public:
|
||||
OpenGLFboFramebuffer(OpenGLDevice& device, const std::vector<std::shared_ptr<Texture>>& attachments);
|
||||
@@ -31,12 +31,15 @@ namespace Nz
|
||||
|
||||
std::size_t GetColorBufferCount() const override;
|
||||
|
||||
const Vector2ui& GetSize() const override;
|
||||
|
||||
OpenGLFboFramebuffer& operator=(const OpenGLFboFramebuffer&) = delete;
|
||||
OpenGLFboFramebuffer& operator=(OpenGLFboFramebuffer&&) = delete;
|
||||
|
||||
private:
|
||||
GL::Framebuffer m_framebuffer;
|
||||
std::size_t m_colorAttachmentCount;
|
||||
Vector2ui m_size;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#define NAZARA_OPENGLRENDERER_OPENGLFRAMEBUFFER_HPP
|
||||
|
||||
#include <Nazara/Prerequisites.hpp>
|
||||
#include <Nazara/Math/Vector2.hpp>
|
||||
#include <Nazara/OpenGLRenderer/Config.hpp>
|
||||
#include <Nazara/Renderer/Framebuffer.hpp>
|
||||
|
||||
@@ -26,6 +27,8 @@ namespace Nz
|
||||
|
||||
virtual std::size_t GetColorBufferCount() const = 0;
|
||||
|
||||
virtual const Vector2ui& GetSize() const = 0;
|
||||
|
||||
OpenGLFramebuffer& operator=(const OpenGLFramebuffer&) = delete;
|
||||
OpenGLFramebuffer& operator=(OpenGLFramebuffer&&) noexcept = default;
|
||||
};
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Nz
|
||||
{
|
||||
class RenderWindow;
|
||||
|
||||
class NAZARA_OPENGLRENDERER_API OpenGLRenderWindow : public RenderWindowImpl
|
||||
class NAZARA_OPENGLRENDERER_API OpenGLRenderWindow final : public RenderWindowImpl
|
||||
{
|
||||
public:
|
||||
OpenGLRenderWindow(RenderWindow& owner);
|
||||
|
||||
@@ -26,6 +26,8 @@ namespace Nz
|
||||
|
||||
std::size_t GetColorBufferCount() const override;
|
||||
|
||||
const Vector2ui& GetSize() const override;
|
||||
|
||||
OpenGLWindowFramebuffer& operator=(const OpenGLWindowFramebuffer&) = delete;
|
||||
OpenGLWindowFramebuffer& operator=(OpenGLWindowFramebuffer&&) = delete;
|
||||
|
||||
|
||||
@@ -111,10 +111,10 @@ namespace Nz::GL
|
||||
|
||||
inline void Context::ResetColorWriteMasks() const
|
||||
{
|
||||
if (!m_state.renderStates.colorWrite)
|
||||
if (m_state.renderStates.colorWriteMask != ColorComponentAll)
|
||||
{
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
m_state.renderStates.colorWrite = true;
|
||||
m_state.renderStates.colorWriteMask = ColorComponentAll;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWBUFFERPROC) (GLenum buf);
|
||||
typedef void (GL_APIENTRYP PFNGLPOLYGONMODEPROC) (GLenum face, GLenum mode);
|
||||
|
||||
// Depth clamp (OpenGL 3.2)
|
||||
#define GL_DEPTH_CLAMP 0x864F
|
||||
|
||||
// Clip control (OpenGL 4.5)
|
||||
#define GL_LOWER_LEFT 0x8CA1
|
||||
#define GL_UPPER_LEFT 0x8CA2
|
||||
|
||||
Reference in New Issue
Block a user