00001 /* 00002 spacegameengine is a portable easy to use game engine written in C++. 00003 Copyright (C) 2006-2007 Carl Philipp Reh (sefi@s-e-f-i.de) 00004 00005 This program is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public License 00007 as published by the Free Software Foundation; either version 2 00008 of the License, or (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public License 00016 along with this program; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 00021 #ifndef SGE_IMAGE_LOADER_HPP_INCLUDED 00022 #define SGE_IMAGE_LOADER_HPP_INCLUDED 00023 00024 #include "../string.hpp" 00025 #include "../shared_ptr.hpp" 00026 #include "../plugin/traits.hpp" 00027 #include "../plugin/capabilities.hpp" 00028 #include "../path.hpp" 00029 #include "../export.hpp" 00030 #include "../renderer/image_view.hpp" 00031 #include "object.hpp" 00032 #include "format.hpp" 00033 #include <boost/noncopyable.hpp> 00034 00035 namespace sge 00036 { 00037 namespace image 00038 { 00039 00040 class SGE_CLASS_SYMBOL loader : boost::noncopyable { 00041 public: 00042 virtual const object_ptr 00043 load_image( 00044 const path&) = 0; 00045 00046 virtual const object_ptr 00047 load_image( 00048 format::type type, 00049 object::const_pointer format_data, 00050 object::size_type size) = 0; 00051 00052 virtual const object_ptr 00053 create_image( 00054 renderer::const_image_view const &) = 0; 00055 00056 SGE_SYMBOL virtual ~loader(); 00057 }; 00058 00059 typedef shared_ptr<loader> loader_ptr; 00060 00061 } 00062 00063 namespace plugin 00064 { 00065 namespace detail 00066 { 00067 00068 template<> struct traits<image::loader> { 00069 SGE_SYMBOL static address_name plugin_loader_name(); 00070 SGE_SYMBOL static capabilities::type get_plugin_type(); 00071 typedef image::loader* (*loader_fun)(); 00072 }; 00073 00074 } 00075 } 00076 00077 } 00078 00079 #endif
1.5.5