gl_object.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 * MeshLab                                                           o o     *
00003 * An extendible mesh processor                                    o     o   *
00004 *                                                                _   O  _   *
00005 * Copyright(C) 2005, 2009                                          \/)\/    *
00006 * Visual Computing Lab                                            /\/|      *
00007 * ISTI - Italian National Research Council                           |      *
00008 *                                                                    \      *
00009 * All rights reserved.                                                      *
00010 *                                                                           *
00011 * This program is free software; you can redistribute it and/or modify      *
00012 * it under the terms of the GNU General Public License as published by      *
00013 * the Free Software Foundation; either version 2 of the License, or         *
00014 * (at your option) any later version.                                       *
00015 *                                                                           *
00016 * This program is distributed in the hope that it will be useful,           *
00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
00019 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)          *
00020 * for more details.                                                         *
00021 *                                                                           *
00022 ****************************************************************************/
00023 
00024 #ifndef __GL_OBJECT_H__
00025 #define __GL_OBJECT_H__
00026 
00027 class GLObject
00028 {
00029 public:
00030         GLObject(void)
00031         {
00032                 this->objectID = 0;
00033         }
00034 
00035         virtual ~GLObject(void)
00036         {
00037         }
00038 
00039         GLuint ObjectID(void) const
00040         {
00041                 return this->objectID;
00042         }
00043 
00044         bool ValidObject(void) const
00045         {
00046                 return (this->objectID != 0);
00047         }
00048 
00049         virtual void Gen(void) = 0;
00050         virtual void Del(void) = 0;
00051 
00052 protected:
00053         GLuint objectID;
00054 };
00055 
00056 class Bindable
00057 {
00058 public:
00059         Bindable(void)
00060         {
00061                 this->bound = false;
00062         }
00063 
00064         void Bind(void)
00065         {
00066                 this->bound = true;
00067                 this->DoBind();
00068         }
00069 
00070         void Unbind(void)
00071         {
00072                 this->DoUnbind();
00073                 this->bound = false;
00074         }
00075 
00076         bool IsBound(void) const
00077         {
00078                 return this->bound;
00079         }
00080 
00081 protected:
00082         bool bound;
00083 
00084         virtual void DoBind(void) = 0;
00085         virtual void DoUnbind(void) = 0;
00086 };
00087 
00088 #endif //__GL_OBJECT_H__


shape_reconstruction
Author(s): Roberto Martín-Martín
autogenerated on Sat Jun 8 2019 18:31:25