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 class CL_API_DISPLAY CL_FrameBuffer
00063 {
00066
00067 public:
00069 CL_FrameBuffer();
00070
00074 CL_FrameBuffer(CL_GraphicContext &context);
00075
00079
00080 public:
00081
00085 CL_FrameBufferProvider *get_provider() const;
00086
00092 CL_Size get_attachment_size(int buffer_id) const;
00093
00097
00098 public:
00099
00104 void attach_color_buffer(int color_buffer, const CL_RenderBuffer &render_buffer);
00105
00112 void attach_color_buffer(int color_buffer, const CL_Texture &texture, int level = 0, int zoffset = 0);
00113
00121 void attach_color_buffer(int color_buffer, const CL_Texture &texture, CL_TextureSubtype subtype, int level = 0, int zoffset = 0);
00122
00129 void detach_color_buffer(int color_buffer, const CL_Texture &texture, int level = 0, int zoffset = 0);
00130
00134 void attach_stencil_buffer(const CL_RenderBuffer &render_buffer);
00135
00137 void detach_stencil_buffer();
00138
00142 void attach_depth_buffer(const CL_RenderBuffer &render_buffer);
00143
00150 void attach_depth_buffer(const CL_Texture &texture, CL_TextureSubtype subtype, int level = 0, int zoffset = 0);
00151
00153 void detach_depth_buffer();
00154
00158
00159 private:
00160 CL_SharedPtr<CL_FrameBuffer_Impl> impl;
00162 };
00163