michael@0: // michael@0: // Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: // HandleAllocator.h: Defines the gl::HandleAllocator class, which is used to michael@0: // allocate GL handles. michael@0: michael@0: #ifndef LIBGLESV2_HANDLEALLOCATOR_H_ michael@0: #define LIBGLESV2_HANDLEALLOCATOR_H_ michael@0: michael@0: #define GL_APICALL michael@0: #include michael@0: michael@0: #include michael@0: michael@0: #include "common/angleutils.h" michael@0: michael@0: namespace gl michael@0: { michael@0: michael@0: class HandleAllocator michael@0: { michael@0: public: michael@0: HandleAllocator(); michael@0: virtual ~HandleAllocator(); michael@0: michael@0: void setBaseHandle(GLuint value); michael@0: michael@0: GLuint allocate(); michael@0: void release(GLuint handle); michael@0: michael@0: private: michael@0: DISALLOW_COPY_AND_ASSIGN(HandleAllocator); michael@0: michael@0: GLuint mBaseValue; michael@0: GLuint mNextValue; michael@0: typedef std::vector HandleList; michael@0: HandleList mFreeValues; michael@0: }; michael@0: michael@0: } michael@0: michael@0: #endif // LIBGLESV2_HANDLEALLOCATOR_H_