]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - include/ishadersmanager.h
set eol-style
[xonotic/netradiant.git] / include / ishadersmanager.h
index a9bf0f03aaad754666fd0cce600be75adefef7cb..06ac9d32fac5d05b05a947867b57edeee894ca0e 100644 (file)
-/*\r
-Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
-For a list of contributors, see the accompanying CONTRIBUTORS file.\r
-\r
-This file is part of GtkRadiant.\r
-\r
-GtkRadiant is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-GtkRadiant is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with GtkRadiant; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
-*/\r
-\r
-#ifndef _ISHADERSMANAGER_H_\r
-#define _ISHADERSMANAGER_H_\r
-\r
-class IShadersManager\r
-{\r
- public:\r
-  IShadersManager ();\r
-  virtual ~IShadersManager ();\r
-\r
-  // Increment the number of references to this object\r
-  virtual void IncRef () = 0;\r
-  // Decrement the reference count\r
-  virtual void DecRef () = 0;\r
-\r
-  // free all shaders\r
-  // free the shaders, will not free the qtexture_t*\r
-  virtual void FreeShaders () = 0;\r
-\r
-  // reload all the shaders\r
-  // this will free everything (shaders and their textures), then reload all in use stuff\r
-  virtual void ReloadShaders () = 0;\r
-\r
-  // load all shaders in a given directory\r
-  // this will scan the list of in-memory shaders, and load the related qtexture_t if needed\r
-  virtual void LoadShadersFromDir (const char* path) = 0;\r
-\r
-  // load a shader file (ie a set of shaders)\r
-  // after LoadShaderFile shaders will be in memory, next step is to load the qtexture_t Radiant uses\r
-  // to represent them if a shader with the same name exists, new one will not be loaded\r
-  // don't use this to refresh the shaders!\r
-  virtual void LoadShaderFile (const char* filename) = 0;\r
-\r
-  // tell if a given shader exists in our shader table\r
-  // NOTE: this doesn't tell wether it's corresponding qtexture is loaded \r
-  virtual int HasShader (const char* name) = 0;\r
-\r
-  // return the shader for a given name\r
-  // if the qtexture is not already in memory, will try loading it\r
-  // if the qtexture could not be found, will use default\r
-  // will return NULL on shader not found\r
-  virtual IShader* Try_Shader_ForName (const char* name) = 0;\r
-\r
-  // return the shader for a given name\r
-  // if the qtexture is not already in memory, will try loading it\r
-  // will create a default shader if not found (will use a default texture)\r
-  virtual IShader* Shader_ForName (const char* name) = 0;\r
-\r
-  // query / load a texture\r
-  // will not try loading a shader, will look for the actual image file ..\r
-  // returns NULL on file not found\r
-  // NOTE: strategy for file lookup:\r
-  //   paths must be relative, ie. textures/me/myfile\r
-  //   if a 3-letters filename extension (such as .jpg or .tga) is provided, it will get loaded first\r
-  //   if not found or no extension, will try loading after adding .tga and .jpg (in this order)\r
-  virtual qtexture_t* Try_Texture_ForName (const char* filename) = 0;\r
-\r
-  // query / load a texture\r
-  // will not try loading a shader, will look for the actual image file ..\r
-  // on file not found will use the "texture not found"\r
-  virtual qtexture_t* Texture_ForName (const char* filename) = 0;\r
-\r
-  // get the number of active shaders\r
-  // these are the shaders currently loaded, that have an associated qtexture_t*\r
-  virtual int GetActiveShaderCount () = 0;\r
-\r
-  // for stuff that needs to be represented by a plain texture\r
-  // the shader will get a "color" name, use GetColor to get the actual color\r
-  virtual IShader* ColorShader_ForName (const char* name) = 0;\r
-\r
-  // reload a shaderfile - update shaders and their display properties/qtexture_t if needed\r
-  // will not reload the texture files\r
-  // will switch to "show in use" atfer use\r
-  // filename must be reletive path of the shader, ex. scripts/gothic_wall.shader\r
-  virtual void ReloadShaderFile (const char* filename) = 0;\r
-\r
-  // retrieve a shader if exists, without loading the textures for it etc.\r
-  // use this function if you want special info on a shader\r
-  virtual IShader* Shader_ForName_NoLoad (const char* name) = 0;\r
-};\r
-\r
-#endif // _ISHADERSMANAGER_H_\r
+/*
+Copyright (C) 1999-2007 id Software, Inc. and contributors.
+For a list of contributors, see the accompanying CONTRIBUTORS file.
+
+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 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
+*/
+
+#ifndef _ISHADERSMANAGER_H_
+#define _ISHADERSMANAGER_H_
+
+class IShadersManager
+{
+ public:
+  IShadersManager ();
+  virtual ~IShadersManager ();
+
+  // Increment the number of references to this object
+  virtual void IncRef () = 0;
+  // Decrement the reference count
+  virtual void DecRef () = 0;
+
+  // free all shaders
+  // free the shaders, will not free the qtexture_t*
+  virtual void FreeShaders () = 0;
+
+  // reload all the shaders
+  // this will free everything (shaders and their textures), then reload all in use stuff
+  virtual void ReloadShaders () = 0;
+
+  // load all shaders in a given directory
+  // this will scan the list of in-memory shaders, and load the related qtexture_t if needed
+  virtual void LoadShadersFromDir (const char* path) = 0;
+
+  // load a shader file (ie a set of shaders)
+  // after LoadShaderFile shaders will be in memory, next step is to load the qtexture_t Radiant uses
+  // to represent them if a shader with the same name exists, new one will not be loaded
+  // don't use this to refresh the shaders!
+  virtual void LoadShaderFile (const char* filename) = 0;
+
+  // tell if a given shader exists in our shader table
+  // NOTE: this doesn't tell wether it's corresponding qtexture is loaded 
+  virtual int HasShader (const char* name) = 0;
+
+  // return the shader for a given name
+  // if the qtexture is not already in memory, will try loading it
+  // if the qtexture could not be found, will use default
+  // will return NULL on shader not found
+  virtual IShader* Try_Shader_ForName (const char* name) = 0;
+
+  // return the shader for a given name
+  // if the qtexture is not already in memory, will try loading it
+  // will create a default shader if not found (will use a default texture)
+  virtual IShader* Shader_ForName (const char* name) = 0;
+
+  // query / load a texture
+  // will not try loading a shader, will look for the actual image file ..
+  // returns NULL on file not found
+  // NOTE: strategy for file lookup:
+  //   paths must be relative, ie. textures/me/myfile
+  //   if a 3-letters filename extension (such as .jpg or .tga) is provided, it will get loaded first
+  //   if not found or no extension, will try loading after adding .tga and .jpg (in this order)
+  virtual qtexture_t* Try_Texture_ForName (const char* filename) = 0;
+
+  // query / load a texture
+  // will not try loading a shader, will look for the actual image file ..
+  // on file not found will use the "texture not found"
+  virtual qtexture_t* Texture_ForName (const char* filename) = 0;
+
+  // get the number of active shaders
+  // these are the shaders currently loaded, that have an associated qtexture_t*
+  virtual int GetActiveShaderCount () = 0;
+
+  // for stuff that needs to be represented by a plain texture
+  // the shader will get a "color" name, use GetColor to get the actual color
+  virtual IShader* ColorShader_ForName (const char* name) = 0;
+
+  // reload a shaderfile - update shaders and their display properties/qtexture_t if needed
+  // will not reload the texture files
+  // will switch to "show in use" atfer use
+  // filename must be reletive path of the shader, ex. scripts/gothic_wall.shader
+  virtual void ReloadShaderFile (const char* filename) = 0;
+
+  // retrieve a shader if exists, without loading the textures for it etc.
+  // use this function if you want special info on a shader
+  virtual IShader* Shader_ForName_NoLoad (const char* name) = 0;
+};
+
+#endif // _ISHADERSMANAGER_H_