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

generic_surfaceprovider.cpp

Go to the documentation of this file.
00001 /*
00002         $Id: generic_surfaceprovider.cpp,v 1.1 2001/03/06 15:09:22 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         File purpose:
00015                 Generic surfaceprovider class implementing reference counting.
00016 
00017 */
00018 
00019 #include "Core/precomp.h"
00020 #include "API/Display/SurfaceProviders/generic_surfaceprovider.h"
00021 #include "API/Core/System/cl_assert.h"
00022 
00023 CL_SurfaceProvider_Generic::CL_SurfaceProvider_Generic()
00024 {
00025         ref_count = 0;
00026 }
00027 
00028 void CL_SurfaceProvider_Generic::lock()
00029 {
00030         ref_count++;
00031         if (ref_count == 1) perform_lock();
00032 }
00033 
00034 void CL_SurfaceProvider_Generic::unlock()
00035 {
00036         cl_assert(ref_count > 0);
00037 
00038         ref_count--;
00039         if (ref_count == 0) perform_unlock();
00040 }

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