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

fragmentprog.h

Go to the documentation of this file.
00001 // fragmentprog.h
00002 //
00003 // Copyright (C) 2003 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 _CELENGINE_FRAGMENTPROG_H_
00011 #define _CELENGINE_FRAGMENTPROG_H_
00012 
00013 #include <celmath/vecmath.h>
00014 #include <celutil/color.h>
00015 #include <celutil/util.h>
00016 #include <celengine/gl.h>
00017 
00018 class FragmentProcessor;
00019 
00020 namespace fp
00021 {
00022     FragmentProcessor* initNV();
00023     FragmentProcessor* initARB();
00024     void enable();
00025     void disable();
00026     void use(unsigned int);
00027 
00028     void parameter(unsigned int, const Vec3f&);
00029     void parameter(unsigned int, const Point3f&);
00030     void parameter(unsigned int, const Color&);
00031     void parameter(unsigned int, float, float, float, float);
00032 
00033     enum Parameter {
00034         SunDirection       = 0,
00035         EyePosition        = 1,
00036         DiffuseColor       = 2,
00037         SpecularColor      = 3,
00038         SpecularExponent   = 4,
00039         AmbientColor       = 5,
00040         HazeColor          = 6,
00041         TextureTranslation = 7,
00042         TexGen_S           = 8,
00043         TexGen_T           = 9,
00044         ShadowParams0      = 20,
00045         ShadowParams1      = 21,
00046     };
00047 
00048     extern unsigned int sphereShadowOnRings;
00049     extern unsigned int eclipseShadow1;
00050     extern unsigned int eclipseShadow2;
00051     extern unsigned int texDiffuse;
00052     extern unsigned int texDiffuseBump;
00053     extern unsigned int texSpecular;
00054     extern unsigned int texSpecularAlpha;
00055 };
00056 
00057 
00058 class FragmentProcessor
00059 {
00060  public:
00061     FragmentProcessor();
00062     virtual ~FragmentProcessor();
00063 
00064     virtual void enable() = 0;
00065     virtual void disable() = 0;
00066     virtual void use(unsigned int) = 0;
00067     virtual void parameter(fp::Parameter, const Vec3f&);
00068     virtual void parameter(fp::Parameter, const Point3f&);
00069     virtual void parameter(fp::Parameter, const Color&);
00070     virtual void parameter(fp::Parameter, float, float, float, float) = 0;
00071     virtual void parameter(fp::Parameter, const float*) = 0;
00072 
00073  private:
00074     int dummy;
00075 };
00076 
00077 #endif // _CELENGINE_FRAGMENTPROG_H_

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