//- // ========================================================================== // Copyright (C) 2005 ATI Technologies Inc. All rights reserved. // // Copyright (C) 1995 - 2005 Alias Systems Corp. and/or its licensors. All // rights reserved. // // The coded instructions, statements, computer programs, and/or related // material (collectively the "Data") in these files are provided by Alias // Systems Corp. ("Alias") and/or its licensors for the exclusive use of the // Customer (as defined in the Alias Software License Agreement that // accompanies this Alias software). Such Customer has the right to use, // modify, and incorporate the Data into other products and to distribute such // products for use by end-users. // // THE DATA IS PROVIDED "AS IS". ALIAS HEREBY DISCLAIMS ALL WARRANTIES // RELATING TO THE DATA, INCLUDING, WITHOUT LIMITATION, ANY AND ALL EXPRESS OR // IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. IN NO EVENT SHALL ALIAS BE LIABLE FOR ANY DAMAGES // WHATSOEVER, WHETHER DIRECT, INDIRECT, SPECIAL, OR PUNITIVE, WHETHER IN AN // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, OR IN EQUITY, // ARISING OUT OF ACCESS TO, USE OF, OR RELIANCE UPON THE DATA. // ========================================================================== //+ #ifndef DEFAULT_SHADER_H #define DEFAULT_SHADER_H #include "glExtensions.h" #include "Shader.h" class defaultShader : public shader { public: defaultShader(); //no GL cleanup, because we may not have a context at shutdown virtual ~defaultShader() {}; virtual bool valid() {return true;}; virtual int passCount() {return 1;}; virtual int techniqueCount() {return 1;}; virtual const char* techniqueName( int n) { return NULL;}; virtual bool build() { return true;}; virtual void bind(); virtual void unbind(); virtual void setTechnique( int t) {}; virtual void setPass( int p) {}; virtual const char* getVertexShader( int pass) {return NULL;}; virtual const char* getPixelShader( int pass) {return NULL;}; virtual int uniformCount() {return 0;}; virtual int samplerCount() {return 0;}; virtual int attributeCount() {return 0;}; virtual const char* uniformName(int i) {return NULL;}; virtual DataType uniformType(int i) { return dtUnknown;}; virtual Semantic uniformSemantic(int i) { return smNone;}; virtual float* uniformDefault(int i) { return NULL;}; virtual const char* samplerName(int i) {return NULL;}; virtual SamplerType samplerType(int i) {return stUnknown;}; virtual const char* attributeName(int i) {return NULL;}; virtual DataType attributeType(int i) {return dtUnknown;}; virtual int attributeHandle(int i) {return 0;}; //need set functions for current values virtual void updateUniformBool( int i, bool val) {}; virtual void updateUniformInt( int i, int val) {}; virtual void updateUniformFloat( int i, float val) {}; virtual void updateUniformBVec( int i, const bool* val) {}; virtual void updateUniformIVec( int i, const int* val) {}; virtual void updateUniformVec( int i, const float* val) {}; virtual void updateUniformMat( int i, const float* val) {}; virtual void updateUniformMat( int i, const double* val) {}; virtual void updateSampler( int i, unsigned int val) {}; //predefined attributes virtual bool usesColor() {return false;}; virtual bool usesNormal() {return true;}; virtual bool usesTexCoord( int set) {return set==0;}; virtual bool usesTangent() {return false;}; virtual bool usesBinormal() {return false;}; virtual int tangentSlot() {return 0;}; virtual int binormalSlot() {return 0;}; //error reporting virtual const char* errorString() { return "";}; private: static const char vShader[]; static const char fShader[]; GLuint m_program; GLuint m_fShader; GLuint m_vShader; }; #endif //DEFAULT_SHADER_H