Torque3D Documentation / _generateds / shaderGenGLSL.h

shaderGenGLSL.h

Engine/source/shaderGen/GLSL/shaderGenGLSL.h

More...

Classes:

Detailed Description

 1
 2//-----------------------------------------------------------------------------
 3// Copyright (c) 2012 GarageGames, LLC
 4//
 5// Permission is hereby granted, free of charge, to any person obtaining a copy
 6// of this software and associated documentation files (the "Software"), to
 7// deal in the Software without restriction, including without limitation the
 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 9// sell copies of the Software, and to permit persons to whom the Software is
10// furnished to do so, subject to the following conditions:
11//
12// The above copyright notice and this permission notice shall be included in
13// all copies or substantial portions of the Software.
14//
15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21// IN THE SOFTWARE.
22//-----------------------------------------------------------------------------
23
24#ifndef _SHADERGEN_GLSL_H_
25#define _SHADERGEN_GLSL_H_
26
27#ifndef _SHADERGEN_H_
28#include "shaderGen/shaderGen.h"
29#endif
30
31
32class ShaderGenPrinterGLSL : public ShaderGenPrinter
33{
34        bool extraRTs[3];
35 
36public:
37        ShaderGenPrinterGLSL() { for (int i = 0; i < 3; i++) extraRTs[i] = false; }
38 
39   // ShaderGenPrinter
40   virtual void printShaderHeader(Stream& stream);
41   virtual void printMainComment(Stream& stream);
42   virtual void printVertexShaderCloser(Stream& stream);
43   virtual void printPixelShaderOutputStruct(Stream& stream, const MaterialFeatureData &featureData);
44   virtual void printPixelShaderCloser(Stream& stream);
45   virtual void printLine(Stream& stream, const String& line);
46};
47
48class ShaderGenComponentFactoryGLSL : public ShaderGenComponentFactory
49{
50public:
51
52   /// Helper function for converting a vertex decl 
53   /// type to an GLSL type string.
54   static const char* typeToString( GFXDeclType type );
55
56   // ShaderGenComponentFactory
57   virtual ShaderComponent* createVertexInputConnector( const GFXVertexFormat &vertexFormat );
58   virtual ShaderComponent* createVertexPixelConnector();
59   virtual ShaderComponent* createVertexParamsDef();
60   virtual ShaderComponent* createPixelParamsDef();
61};
62
63#endif
64