Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

vertexprog.h

Go to the documentation of this file.
00001 // vertexprog.h
00002 //
00003 // Copyright (C) 2001 Chris Laurel <claurel@shatters.net>
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 
00010 #ifndef _VERTEXPROG_H_
00011 #define _VERTEXPROG_H_
00012 
00013 #include <celmath/vecmath.h>
00014 #include <celutil/color.h>
00015 #include <celengine/gl.h>
00016 
00017 class VertexProcessor;
00018 
00019 namespace vp
00020 {
00021     VertexProcessor* initNV();
00022     VertexProcessor* initARB();
00023     void enable();
00024     void disable();
00025     void use(unsigned int);
00026 
00027     void parameter(unsigned int, const Vec3f&);
00028     void parameter(unsigned int, const Point3f&);
00029     void parameter(unsigned int, const Color&);
00030     void parameter(unsigned int, float, float, float, float);
00031 
00032     enum Parameter {
00033         LightDirection0    = 0,
00034         EyePosition        = 1,
00035         DiffuseColor0      = 2,
00036         SpecularColor0     = 3,
00037         SpecularExponent   = 4,
00038         AmbientColor       = 5,
00039         HazeColor          = 6,
00040         TextureTranslation = 7,
00041         Constant0          = 8,
00042         TexGen_S           = 10,
00043         TexGen_T           = 11,
00044         TexGen_S2          = 12,
00045         TexGen_T2          = 13,
00046         TexGen_S3          = 14,
00047         TexGen_T3          = 15,
00048         TexGen_S4          = 16,
00049         TexGen_T4          = 17,
00050         LightDirection1    = 18,
00051         DiffuseColor1      = 19,
00052         SpecularColor1     = 20,
00053         Scale              = 21,
00054         InverseScale       = 22
00055     };
00056 
00057     extern unsigned int specular;
00058     extern unsigned int diffuse;
00059     extern unsigned int diffuseHaze;
00060     extern unsigned int diffuseBump;
00061     extern unsigned int diffuseBumpHaze;
00062     extern unsigned int everything;
00063     extern unsigned int shadowTexture;
00064     extern unsigned int multiShadow;
00065     extern unsigned int diffuseTexOffset;
00066     extern unsigned int ringIllum;
00067     extern unsigned int ringShadow;
00068     extern unsigned int cometTail;
00069     extern unsigned int nightLights;
00070     extern unsigned int glossMap;
00071     extern unsigned int perFragmentSpecular;
00072     extern unsigned int perFragmentSpecularAlpha;
00073     extern unsigned int diffuse_2light;
00074     extern unsigned int diffuseTexOffset_2light;
00075     extern unsigned int diffuseHaze_2light;
00076     extern unsigned int specular_2light;
00077     extern unsigned int nightLights_2light;
00078     extern unsigned int ellipticalGalaxy;
00079 };
00080 
00081 
00082 namespace arbvp
00083 {
00084     void parameter(unsigned int, const Vec3f&);
00085     void parameter(unsigned int, const Point3f&);
00086     void parameter(unsigned int, const Color&);
00087     void parameter(unsigned int, float, float, float, float);
00088     void parameter(unsigned int, const float*);
00089 };
00090 
00091 
00092 class VertexProcessor
00093 {
00094  public:
00095     VertexProcessor();
00096     virtual ~VertexProcessor();
00097 
00098     virtual void enable() = 0;
00099     virtual void disable() = 0;
00100     virtual void use(unsigned int) = 0;
00101     virtual void parameter(vp::Parameter, const Vec3f&);
00102     virtual void parameter(vp::Parameter, const Point3f&);
00103     virtual void parameter(vp::Parameter, const Color&);
00104     virtual void parameter(vp::Parameter, float, float, float, float) = 0;
00105     virtual void parameter(vp::Parameter, const float*) = 0;
00106 
00107     virtual void enableAttribArray(unsigned int) = 0;
00108     virtual void disableAttribArray(unsigned int) = 0;
00109     virtual void attribArray(unsigned int index,
00110                              int size,
00111                              GLenum type,
00112                              unsigned int strude,
00113                              const void* pointer) = 0;
00114 
00115  private:
00116     int dummy;
00117 };
00118 
00119 
00120 #endif // _VERTEXPROG_H_

Generated on Sat Jan 14 22:30:29 2006 for Celestia by  doxygen 1.4.1