X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=include%2Figlrender.h;h=04b4a8078ebd2bec0124dfb708782b54eaf58189;hb=74a6e43404e8a57fa1db66f9ee701cdd72ad0bdc;hp=d5b3684a214f604c28e74ee30e90753ac6eac061;hpb=08d558e1a4d6439b2accaee830e54e8036acdc27;p=xonotic%2Fnetradiant.git diff --git a/include/iglrender.h b/include/iglrender.h index d5b3684a..04b4a807 100644 --- a/include/iglrender.h +++ b/include/iglrender.h @@ -1,29 +1,29 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. + Copyright (C) 2001-2006, William Joseph. + All Rights Reserved. -This file is part of GtkRadiant. + This file is part of GtkRadiant. -GtkRadiant is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + GtkRadiant is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -GtkRadiant is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + GtkRadiant is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with GtkRadiant; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ + You should have received a copy of the GNU General Public License + along with GtkRadiant; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ -#if !defined(INCLUDED_IGLRENDER_H) +#if !defined( INCLUDED_IGLRENDER_H ) #define INCLUDED_IGLRENDER_H #include "igl.h" -#include "math/vector.h" +#include "generic/vector.h" class AABB; class Matrix4; @@ -31,85 +31,83 @@ class Matrix4; class GLProgram { public: - virtual void enable() = 0; - virtual void disable() = 0; - virtual void setParameters(const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light) = 0; +virtual void enable() = 0; +virtual void disable() = 0; +virtual void setParameters( const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light ) = 0; }; class OpenGLFogState { public: - OpenGLFogState() : mode(GL_EXP), density(0), start(0), end(0), index(0), colour(1, 1, 1, 1) - { - } - GLenum mode; - GLfloat density; - GLfloat start; - GLfloat end; - GLint index; - Vector4 colour; +OpenGLFogState() : mode( GL_EXP ), density( 0 ), start( 0 ), end( 0 ), index( 0 ), colour( 1, 1, 1, 1 ){ +} +GLenum mode; +GLfloat density; +GLfloat start; +GLfloat end; +GLint index; +Vector4 colour; }; //! A collection of opengl state information. class OpenGLState { public: - enum ESort - { - eSortFirst = 0, - eSortOpaque = 1, - eSortMultiFirst = 2, - eSortMultiLast = 1023, - eSortOverbrighten = 1024, - eSortFullbright = 1025, - eSortHighlight = 1026, - eSortTranslucent = 1027, - eSortOverlayFirst = 1028, - eSortOverlayLast = 2047, - eSortControlFirst = 2048, - eSortControlLast = 3071, - eSortGUI0 = 3072, - eSortGUI1 = 3073, - eSortLast = 4096, - }; - - unsigned int m_state; - std::size_t m_sort; - GLint m_texture; - GLint m_texture1; - GLint m_texture2; - GLint m_texture3; - GLint m_texture4; - GLint m_texture5; - GLint m_texture6; - GLint m_texture7; - Vector4 m_colour; - GLenum m_blend_src, m_blend_dst; - GLenum m_depthfunc; - GLenum m_alphafunc; - GLfloat m_alpharef; - GLfloat m_linewidth; - GLfloat m_pointsize; - GLint m_linestipple_factor; - GLushort m_linestipple_pattern; - OpenGLFogState m_fog; - GLProgram* m_program; - - OpenGLState() : m_program(0) - { - } +enum ESort +{ + eSortFirst = 0, + eSortOpaque = 1, + eSortMultiFirst = 2, + eSortMultiLast = 1023, + eSortOverbrighten = 1024, + eSortFullbright = 1025, + eSortHighlight = 1026, + eSortTranslucent = 1027, + eSortOverlayFirst = 1028, + eSortOverlayLast = 2047, + eSortControlFirst = 2048, + eSortControlLast = 3071, + eSortGUI0 = 3072, + eSortGUI1 = 3073, + eSortLast = 4096, +}; + +unsigned int m_state; +std::size_t m_sort; +GLint m_texture; +GLint m_texture1; +GLint m_texture2; +GLint m_texture3; +GLint m_texture4; +GLint m_texture5; +GLint m_texture6; +GLint m_texture7; +Vector4 m_colour; +GLenum m_blend_src, m_blend_dst; +GLenum m_depthfunc; +GLenum m_alphafunc; +GLfloat m_alpharef; +GLfloat m_linewidth; +GLfloat m_pointsize; +GLint m_linestipple_factor; +GLushort m_linestipple_pattern; +OpenGLFogState m_fog; +GLProgram* m_program; + +OpenGLState() : m_program( 0 ){ +} }; class OpenGLStateLibrary { public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "openglshaderlibrary"); +INTEGER_CONSTANT( Version, 1 ); +STRING_CONSTANT( Name, "openglshaderlibrary" ); - virtual void getDefaultState(OpenGLState& state) const = 0; +virtual void getDefaultState( OpenGLState& state ) const = 0; - virtual void insert(const char* name, const OpenGLState& state) = 0; - virtual void erase(const char* name) = 0; +virtual void insert( const char* name, const OpenGLState& state ) = 0; +virtual void erase( const char* name ) = 0; }; #include "modulesystem.h" @@ -122,9 +120,8 @@ template class GlobalModuleRef; typedef GlobalModuleRef GlobalOpenGLStateLibraryModuleRef; -inline OpenGLStateLibrary& GlobalOpenGLStateLibrary() -{ - return GlobalOpenGLStateLibraryModule::getTable(); +inline OpenGLStateLibrary& GlobalOpenGLStateLibrary(){ + return GlobalOpenGLStateLibraryModule::getTable(); } #endif