FCT
载入中...
搜索中...
未找到
UniformWrapper.h
浏览该文件的文档.
1#ifndef UNIFORMWRAPPER_H
2#define UNIFORMWRAPPER_H
3#include "./Uniform.h"
4namespace FCT {
5 class Context;
6 namespace RHI {
7 class UniformBuffer;
8 class ConstBuffer;
9 }
10
11 struct Uniform
12 {
13 public:
14 Uniform();
15 Uniform(Uniform&& other) noexcept;
16 Uniform& operator=(Uniform&& other) noexcept;
17 Uniform(FCT::Context* ctx, const FCT::ConstLayout& layout);
18 ~Uniform();
19 template<typename T>
20 void setValue(const char* name, const T& value)
21 {
22 m_uniformBuffer->setValue(name, value);
23 }
24 template<typename T>
25 void setValue(UniformType type, const T& value)
26 {
27 m_uniformBuffer->setValue(type, value);
28 }
29 void update();
30 operator FCT::RHI::ConstBuffer*() const;
32 private:
35 };
36}
37#endif //UNIFORMWRAPPER_H
FCT::ConstType UniformType
FCT::UniformBuffer * m_uniformBuffer
Uniform & operator=(Uniform &&other) noexcept
FCT::RHI::ConstBuffer * getConstBuffer() const
FCT::RHI::ConstBuffer * m_constBuffer
void setValue(UniformType type, const T &value)
void setValue(const char *name, const T &value)