]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - include/irender.h
Merge remote-tracking branch 'illwieckz/pakpath'
[xonotic/netradiant.git] / include / irender.h
index d9c40b6f41a72155e1339beff1d3f806043898a2..5199454287cb9081797c61cfddc7a96461df0baf 100644 (file)
@@ -1,25 +1,25 @@
 /*
-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_IRENDER_H)
+#if !defined( INCLUDED_IRENDER_H )
 #define INCLUDED_IRENDER_H
 
 #include "generic/constant.h"
@@ -67,26 +67,24 @@ class Shader;
 class RendererLight
 {
 public:
-  virtual Shader* getShader() const = 0;
-  virtual const AABB& aabb() const = 0;
-  virtual bool testAABB(const AABB& other) const = 0;
-  virtual const Matrix4& rotation() const = 0;
-  virtual const Vector3& offset() const = 0;
-  virtual const Vector3& colour() const = 0;
-  virtual bool isProjected() const = 0;
-  virtual const Matrix4& projection() const = 0;
+virtual Shader* getShader() const = 0;
+virtual const AABB& aabb() const = 0;
+virtual bool testAABB( const AABB& other ) const = 0;
+virtual const Matrix4& rotation() const = 0;
+virtual const Vector3& offset() const = 0;
+virtual const Vector3& colour() const = 0;
+virtual bool isProjected() const = 0;
+virtual const Matrix4& projection() const = 0;
 };
 
 class LightCullable
 {
 public:
-  virtual bool testLight(const RendererLight& light) const = 0;
-  virtual void insertLight(const RendererLight& light)
-  {
-  }
-  virtual void clearLights()
-  {
-  }
+virtual bool testLight( const RendererLight& light ) const = 0;
+virtual void insertLight( const RendererLight& light ){
+}
+virtual void clearLights(){
+}
 };
 
 class Renderable;
@@ -97,9 +95,9 @@ typedef Callback1<const RendererLight&> RendererLightCallback;
 class LightList
 {
 public:
-  virtual void evaluateLights() const = 0;
-  virtual void lightsChanged() const = 0;
-  virtual void forEachLight(const RendererLightCallback& callback) const = 0;
+virtual void evaluateLights() const = 0;
+virtual void lightsChanged() const = 0;
+virtual void forEachLight( const RendererLightCallback& callback ) const = 0;
 };
 
 const int c_attr_TexCoord0 = 1;
@@ -109,7 +107,7 @@ const int c_attr_Binormal = 4;
 class OpenGLRenderable
 {
 public:
-  virtual void render(RenderStateFlags state) const = 0;
+virtual void render( RenderStateFlags state ) const = 0;
 };
 
 class Matrix4;
@@ -121,42 +119,42 @@ class ModuleObserver;
 class Shader
 {
 public:
-  virtual void addRenderable(const OpenGLRenderable& renderable, const Matrix4& modelview, const LightList* lights = 0) = 0;
-  virtual void incrementUsed() = 0;
-  virtual void decrementUsed() = 0;
-  virtual void attach(ModuleObserver& observer) = 0;
-  virtual void detach(ModuleObserver& observer) = 0;
-  virtual qtexture_t& getTexture() const = 0;
-  virtual unsigned int getFlags() const = 0;
+virtual void addRenderable( const OpenGLRenderable& renderable, const Matrix4& modelview, const LightList* lights = 0 ) = 0;
+virtual void incrementUsed() = 0;
+virtual void decrementUsed() = 0;
+virtual void attach( ModuleObserver& observer ) = 0;
+virtual void detach( ModuleObserver& observer ) = 0;
+virtual qtexture_t& getTexture() const = 0;
+virtual unsigned int getFlags() const = 0;
 };
 
 class ShaderCache
 {
 public:
-  INTEGER_CONSTANT(Version, 1);
-  STRING_CONSTANT(Name, "renderstate");
-
-  virtual Shader* capture(const char* name) = 0;
-  virtual void release(const char* name) = 0;
-  /*! Render all Shader objects. */
-  virtual void render(RenderStateFlags globalstate, const Matrix4& modelview, const Matrix4& projection, const Vector3& viewer = Vector3(0, 0, 0)) = 0;
-
-  virtual void realise() = 0;
-  virtual void unrealise() = 0;
-
-  virtual bool lightingSupported() const = 0;
-  virtual bool useShaderLanguage() const = 0;
-
-  virtual const LightList& attach(LightCullable& cullable) = 0;
-  virtual void detach(LightCullable& cullable) = 0;
-  virtual void changed(LightCullable& cullable) = 0;
-  virtual void attach(RendererLight& light) = 0;
-  virtual void detach(RendererLight& light) = 0;
-  virtual void changed(RendererLight& light) = 0;
-
-  virtual void attachRenderable(const Renderable& renderable) = 0;
-  virtual void detachRenderable(const Renderable& renderable) = 0;
-  virtual void forEachRenderable(const RenderableCallback& callback) const = 0;
+INTEGER_CONSTANT( Version, 1 );
+STRING_CONSTANT( Name, "renderstate" );
+
+virtual Shader* capture( const char* name ) = 0;
+virtual void release( const char* name ) = 0;
+/*! Render all Shader objects. */
+virtual void render( RenderStateFlags globalstate, const Matrix4& modelview, const Matrix4& projection, const Vector3& viewer = Vector3( 0, 0, 0 ) ) = 0;
+
+virtual void realise() = 0;
+virtual void unrealise() = 0;
+
+virtual bool lightingSupported() const = 0;
+virtual bool useShaderLanguage() const = 0;
+
+virtual const LightList& attach( LightCullable& cullable ) = 0;
+virtual void detach( LightCullable& cullable ) = 0;
+virtual void changed( LightCullable& cullable ) = 0;
+virtual void attach( RendererLight& light ) = 0;
+virtual void detach( RendererLight& light ) = 0;
+virtual void changed( RendererLight& light ) = 0;
+
+virtual void attachRenderable( const Renderable& renderable ) = 0;
+virtual void detachRenderable( const Renderable& renderable ) = 0;
+virtual void forEachRenderable( const RenderableCallback& callback ) const = 0;
 };
 
 #include "modulesystem.h"
@@ -169,9 +167,8 @@ template<typename Type>
 class GlobalModuleRef;
 typedef GlobalModuleRef<ShaderCache> GlobalShaderCacheModuleRef;
 
-inline ShaderCache& GlobalShaderCache()
-{
-  return GlobalShaderCacheModule::getTable();
+inline ShaderCache& GlobalShaderCache(){
+       return GlobalShaderCacheModule::getTable();
 }
 
 #endif