Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

soundbuffer_generic.cpp

Go to the documentation of this file.
00001 /*
00002         $Id: soundbuffer_generic.cpp,v 1.1 2001/03/06 15:09:26 mbn Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00015 #ifdef WIN32
00016 #pragma warning (disable:4786)
00017 #endif
00018 
00019 #include "soundbuffer_generic.h"
00020 #include "API/Core/Resources/resource.h"
00021 #include "API/Core/System/cl_assert.h"
00022 
00023 CL_SoundBuffer_Generic::CL_SoundBuffer_Generic(CL_Resource *_resource)
00024 :
00025         resource(_resource),
00026         ref(0)
00027 {
00028 }
00029 
00030 CL_SoundBuffer_Generic::~CL_SoundBuffer_Generic()
00031 {
00032         cl_assert(ref == 0);
00033 }
00034 
00035 int CL_SoundBuffer_Generic::add_reference()
00036 {
00037         if (ref > 0 && resource != NULL) resource->load();
00038         return ++ref;
00039 }
00040 
00041 int CL_SoundBuffer_Generic::release_reference()
00042 {
00043         if (resource != NULL) resource->unload();
00044         return --ref;
00045 }

Generated at Wed Apr 4 19:54:03 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001