glc_selectionmaterial.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  http://glc-lib.sourceforge.net
00006 
00007  GLC-lib is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU Lesser General Public License as published by
00009  the Free Software Foundation; either version 3 of the License, or
00010  (at your option) any later version.
00011 
00012  GLC-lib is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public License
00018  along with GLC-lib; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021 *****************************************************************************/
00023 
00024 #ifndef GLC_SELECTIONMATERIAL_H_
00025 #define GLC_SELECTIONMATERIAL_H_
00026 
00027 #include <QColor>
00028 #include <QtOpenGL>
00029 #include <QHash>
00030 
00031 #include "../glc_ext.h"
00032 #include "glc_shader.h"
00033 
00034 #include "../glc_config.h"
00035 
00036 class QGLContext;
00037 class GLC_Material;
00038 
00041 
00043 
00044 
00045 class GLC_LIB_EXPORT GLC_SelectionMaterial
00046 {
00047 private:
00048         GLC_SelectionMaterial();
00049 
00050 
00052 
00054 
00055 public:
00057         static void useMaterial(GLC_Material* pMaterial);
00058 
00060 
00061         static void useDefautSelectionColor();
00062 
00064 
00066 
00068 
00069 public:
00071         static void glExecute();
00073         static void initShader(const QGLContext* pContext);
00075         static void deleteShader(const QGLContext* pContext);
00077         static void setShaders(QFile& vertex, QFile& fragment, const QGLContext* pContext);
00079         static void useShader();
00081         static void unUseShader();
00082 
00084 
00086 // Private services fonction
00088 private:
00090         static QGLContext* sharingContext(const QGLContext* pContext);
00091 
00093 // Private members
00095 
00096 private:
00098                 static QHash<const QGLContext*, GLC_Shader*> m_SelectionShaderHash;
00099 
00101                 static GLC_uint m_SelectionMaterialId;
00102 
00104                 static GLC_Material* m_pMaterial;
00105 
00106 };
00107 
00108 #endif /*GLC_SELECTIONMATERIAL_H_*/

SourceForge.net Logo

©2005-2011 Laurent Ribon