shared_gc_data.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 **    Mark Page
00029 */
00030 
00033 
00034 #pragma once
00035 
00036 #include "../api_display.h"
00037 #include "../../Core/IOData/virtual_directory.h"
00038 #include "../../Core/Signals/signal_v0.h"
00039 #include "texture.h"
00040 #include <vector>
00041 #include <map>
00042 
00043 class CL_GraphicContext;
00044 class CL_DisposableObject;
00045 class CL_SharedGCData_Impl;
00046 
00050 class CL_SharedGCData
00051 {
00052 public:
00053 
00055         static void add_ref();
00056 
00058         static void release_ref();
00059 
00063         static CL_SharedGCData *get_instance();
00064 
00065         static std::vector<CL_GraphicContextProvider*> &get_gc_providers();
00066 
00068         static void dispose_objects();
00069 
00073         static void add_disposable(CL_DisposableObject *disposable);
00074 
00078         static void remove_disposable(CL_DisposableObject *disposable);
00079 
00083         static CL_Signal_v0 &func_gc_destruction_imminent();
00084 
00092         static CL_Texture load_texture(CL_GraphicContext &gc, const CL_String &filename, const CL_VirtualDirectory &virtual_directory = CL_VirtualDirectory());
00093 
00098         static void unload_texture(const CL_String &filename, const CL_VirtualDirectory &virtual_directory = CL_VirtualDirectory());
00099 
00101         static void unload_all_textures();
00102 
00103 private:
00104         CL_SharedGCData();
00105         ~CL_SharedGCData();
00106 
00107         CL_SharedPtr<CL_SharedGCData_Impl> impl;
00108 };
00109 
00111 

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