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 }
1.2.6 written by Dimitri van Heesch,
© 1997-2001