Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 911 vs 912 for /trunk/Source Code/Platform/Video/Buffers/RenderTarget/Headers/RTAttachment.h

Diff revisions: vs.
  @@ -38,19 +38,24 @@
38 38
39 39 FWD_DECLARE_MANAGED_CLASS(Texture);
40 40
41 - class RTAttachment {
42 - public:
43 - /// This enum is used when creating render targets to define the channel that
44 - /// the texture will attach to
45 - enum class Type : U8 {
46 - Colour = 0,
47 - Depth = 1,
48 - Stencil = 2,
49 - COUNT
50 - };
41 + /// This enum is used when creating render targets to define the channel that the texture will attach to
42 + enum class RTAttachmentType : U8 {
43 + Colour = 0,
44 + Depth = 1,
45 + Stencil = 2,
46 + COUNT
47 + };
48 +
49 + struct RTAttachmentDescriptor {
50 + TextureDescriptor _texDescriptor;
51 + RTAttachmentType _type = RTAttachmentType::COUNT;
52 + U8 _index = 0;
53 + vec4<F32> _clearColour = DefaultColours::WHITE();
54 + };
51 55
56 + class RTAttachment {
52 57 public:
53 - RTAttachment();
58 + explicit RTAttachment(const RTAttachmentDescriptor& descriptor);
54 59 virtual ~RTAttachment();
55 60
56 61 bool used() const;
  @@ -73,24 +78,20 @@
73 78 U32 binding() const;
74 79 void binding(U32 binding);
75 80
81 + const RTAttachmentDescriptor& descriptor() const;
82 +
76 83 protected:
77 84 bool _changed;
78 85 U32 _binding;
79 86 U16 _mipWriteLevel;
80 87 U16 _writeLayer;
81 - vec4<F32> _clearColour;
82 88 Texture_ptr _texture;
89 +
90 + RTAttachmentDescriptor _descriptor;
83 91 };
84 92
85 93 TYPEDEF_SMART_POINTERS_FOR_CLASS(RTAttachment);
86 94
87 - struct RTAttachmentDescriptor {
88 - TextureDescriptor _texDescriptor;
89 - RTAttachment::Type _type = RTAttachment::Type::COUNT;
90 - U8 _index = 0;
91 - vec4<F32> _clearColour = DefaultColours::WHITE();
92 - };
93 -
94 95 }; //namespace Divide
95 96
96 97 #endif //_RENDER_TARGET_ATTACHMENT_H_