texture_provider.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 "../Render/texture.h"
00036 #include "../api_display.h"
00037 #include "../../Core/System/sharedptr.h"
00038 #include "../../Core/Text/string_types.h"
00039 
00040 enum CL_TextureWrapMode;
00041 enum CL_TextureFilter;
00042 enum CL_TextureDepthMode;
00043 enum CL_TextureCompareMode;
00044 enum CL_CompareFunction;
00045 class CL_PixelBuffer;
00046 class CL_PixelFormat;
00047 class CL_GraphicContextProvider;
00048 
00052 class CL_API_DISPLAY CL_TextureProvider
00053 {
00056 
00057 public:
00058         virtual ~CL_TextureProvider() { return; }
00059 
00063 
00064 public:
00065 
00069 
00070 public:
00072         virtual void destroy() = 0;
00073 
00075         virtual void create(int width, int height, CL_TextureFormat internal_format, int depth) = 0;
00076 
00078         virtual CL_PixelBuffer get_pixeldata(CL_PixelFormat &format, int level) const = 0;
00079 
00081         virtual void set_image(CL_PixelBuffer &image, int level, CL_TextureFormat internal_format) = 0;
00082 
00084         virtual void set_cube_map(
00085                 CL_PixelBuffer &cube_map_positive_x,
00086                 CL_PixelBuffer &cube_map_negative_x,
00087                 CL_PixelBuffer &cube_map_positive_y,
00088                 CL_PixelBuffer &cube_map_negative_y,
00089                 CL_PixelBuffer &cube_map_positive_z,
00090                 CL_PixelBuffer &cube_map_negative_z,
00091                 int level,
00092                 CL_TextureFormat internal_format) = 0;
00093 
00094         virtual void set_compressed_image(
00095                 int level,
00096                 CL_TextureFormat internal_format,
00097                 int width,
00098                 int height,
00099                 CL_DataBuffer &image) = 0;
00100 
00102         virtual void set_subimage(
00103                 int x,
00104                 int y,
00105                 const CL_PixelBufferRef &image,
00106                 int level) = 0;
00107 
00109         virtual void copy_image_from(
00110                 int x,
00111                 int y,
00112                 int width,
00113                 int height,
00114                 int level,
00115                 CL_TextureFormat internal_format,
00116                 CL_GraphicContextProvider *gc) = 0;
00117 
00119         virtual void copy_subimage_from(
00120                 int offset_x,
00121                 int offset_y,
00122                 int x,
00123                 int y,
00124                 int width,
00125                 int height,
00126                 int level,
00127                 CL_GraphicContextProvider *gc) = 0;
00128 
00130         virtual void set_min_lod(double min_lod) = 0;
00131 
00133         virtual void set_max_lod(double max_lod) = 0;
00134 
00136         virtual void set_lod_bias(double lod_bias) = 0;
00137 
00139         virtual void set_base_level(int base_level) = 0;
00140 
00142         virtual void set_max_level(int max_level) = 0;
00143 
00145         virtual void set_generate_mipmap(bool generate_mipmap) = 0;
00146 
00148         virtual void set_wrap_mode(
00149                 CL_TextureWrapMode wrap_s,
00150                 CL_TextureWrapMode wrap_t,
00151                 CL_TextureWrapMode wrap_r) = 0;
00152 
00153         virtual void set_wrap_mode(
00154                 CL_TextureWrapMode wrap_s,
00155                 CL_TextureWrapMode wrap_t) = 0;
00156 
00157         virtual void set_wrap_mode(
00158                 CL_TextureWrapMode wrap_s) = 0;
00159 
00161         virtual void set_min_filter(CL_TextureFilter filter) = 0;
00162 
00164         virtual void set_mag_filter(CL_TextureFilter filter) = 0;
00165 
00167         virtual void set_max_anisotropy(float v) = 0;
00168 
00170         virtual void set_depth_mode(CL_TextureDepthMode depth_mode) = 0;
00171 
00173         virtual void set_texture_compare(CL_TextureCompareMode mode, CL_CompareFunction func) = 0;
00174 
00178 
00179 private:
00181 };
00182 

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