frame_buffer.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2009 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 **    Harry Storbacka
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 

Generated on Thu Dec 3 02:39:29 2009 for ClanLib by  doxygen 1.4.6