Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00032
00033 #pragma once
00034
00035 #include "../api_display.h"
00036 #include "../../Core/System/sharedptr.h"
00037
00038 class CL_Size;
00039 class CL_Rect;
00040 class CL_Texture;
00041 class CL_RenderBuffer;
00042 class CL_GraphicContext;
00043 class CL_FrameBufferProvider;
00044 class CL_FrameBuffer_Impl;
00045
00049 enum CL_TextureSubtype
00050 {
00051 cl_subtype_cube_map_positive_x,
00052 cl_subtype_cube_map_negative_x,
00053 cl_subtype_cube_map_positive_y,
00054 cl_subtype_cube_map_negative_y,
00055 cl_subtype_cube_map_positive_z,
00056 cl_subtype_cube_map_negative_z
00057 };
00058
00062 enum CL_FrameBufferBindTarget
00063 {
00064 cl_framebuffer_draw,
00065 cl_framebuffer_read
00066 };
00067
00071 class CL_API_DISPLAY CL_FrameBuffer
00072 {
00075 public:
00077 CL_FrameBuffer();
00078
00084 CL_FrameBuffer(CL_GraphicContext &context);
00085
00089 public:
00091 bool is_null() const { return !impl; }
00092
00094 void throw_if_null() const;
00095
00099 CL_FrameBufferProvider *get_provider() const;
00100
00104 CL_Size get_size() const;
00105
00109 CL_FrameBufferBindTarget get_bind_target() const;
00110
00114 public:
00116 bool operator==(const CL_FrameBuffer &other) const;
00117
00122 void attach_color_buffer(int attachment_index, const CL_RenderBuffer &render_buffer);
00123
00128 void detach_color_buffer(int attachment_index, const CL_RenderBuffer &render_buffer);
00129
00136 void attach_color_buffer(int attachment_index, const CL_Texture &texture, int level = 0, int zoffset = 0);
00137
00145 void attach_color_buffer(int attachment_index, const CL_Texture &texture, CL_TextureSubtype subtype, int level = 0, int zoffset = 0);
00146
00153 void detach_color_buffer(int attachment_index, const CL_Texture &texture, int level = 0, int zoffset = 0);
00154
00155 void attach_stencil_buffer(const CL_RenderBuffer &render_buffer);
00156 void detach_stencil_buffer(const CL_RenderBuffer &render_buffer);
00157 void attach_stencil_buffer(const CL_Texture &texture, int level = 0, int zoffset = 0);
00158 void attach_stencil_buffer(const CL_Texture &texture, CL_TextureSubtype subtype, int level = 0, int zoffset = 0);
00159 void detach_stencil_buffer(const CL_Texture &texture, int level = 0, int zoffset = 0);
00160
00161 void attach_depth_buffer(const CL_RenderBuffer &render_buffer);
00162 void detach_depth_buffer(const CL_RenderBuffer &render_buffer);
00163 void attach_depth_buffer(const CL_Texture &texture, int level = 0, int zoffset = 0);
00164 void attach_depth_buffer(const CL_Texture &texture, CL_TextureSubtype subtype, int level = 0, int zoffset = 0);
00165 void detach_depth_buffer(const CL_Texture &texture, int level = 0, int zoffset = 0);
00166
00167 void attach_depth_stencil_buffer(const CL_RenderBuffer &render_buffer);
00168 void detach_depth_stencil_buffer(const CL_RenderBuffer &render_buffer);
00169 void attach_depth_stencil_buffer(const CL_Texture &texture, int level = 0, int zoffset = 0);
00170 void attach_depth_stencil_buffer(const CL_Texture &texture, CL_TextureSubtype subtype, int level = 0, int zoffset = 0);
00171 void detach_depth_stencil_buffer(const CL_Texture &texture, int level = 0, int zoffset = 0);
00172
00178 void set_bind_target(CL_FrameBufferBindTarget target);
00179
00183 private:
00184 CL_SharedPtr<CL_FrameBuffer_Impl> impl;
00186 };
00187