GLLenseFlare.h

Go to the documentation of this file.
00001 ////////////////////////////////////////////////////////////////////////////////
00002 //    Scorched3D (c) 2000-2009
00003 //
00004 //    This file is part of Scorched3D.
00005 //
00006 //    Scorched3D is free software; you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation; either version 2 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    Scorched3D is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with Scorched3D; if not, write to the Free Software
00018 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 ////////////////////////////////////////////////////////////////////////////////
00020 
00021 
00022 // GLLenseFlare.h: interface for the GLLenseFlare class.
00023 //
00024 //////////////////////////////////////////////////////////////////////
00025 
00026 #if !defined(AFX_GLLENSEFLARE_H__34C2D198_3739_4402_B9FD_BEE4DF738466__INCLUDED_)
00027 #define AFX_GLLENSEFLARE_H__34C2D198_3739_4402_B9FD_BEE4DF738466__INCLUDED_
00028 
00029 #include <common/Vector.h>
00030 #include <common/ProgressCounter.h>
00031 #include <GLEXT/GLTexture.h>
00032 
00033 class GLLenseFlare  
00034 {
00035 public:
00036         static GLLenseFlare *instance();
00037         void init(ProgressCounter *counter = 0);
00038 
00039         void draw(Vector &flarePos, bool fullFlare, 
00040                 int color=0, float size = 1.0f, float alpha = 1.0f);
00041         void draw(Vector &flarePos, Vector &flareDirection, int color=0);
00042 
00043 protected:
00044         struct Flare
00045         {
00046                 int type;
00047                 float scale;
00048                 float loc;            /* postion on axis */
00049                 Vector color1;
00050                 Vector color2;
00051                 Vector color3;
00052                 Vector color4;
00053         } flare_[12];
00054 
00055         static bool flaresEnabled_;
00056         static GLLenseFlare *instance_;
00057         GLTexture flares_[6];
00058         GLTexture shines_[10];
00059         int shineTic_;
00060 
00061         void setFlare(int index, int type, float scale, float loc, 
00062                 Vector &color1, Vector &color2, Vector &color3, Vector &color4, float colorScale);
00063 
00064 private:
00065         GLLenseFlare();
00066         virtual ~GLLenseFlare();
00067 };
00068 
00069 #endif // !defined(AFX_GLLENSEFLARE_H__34C2D198_3739_4402_B9FD_BEE4DF738466__INCLUDED_)

Generated on Mon Feb 16 15:14:44 2009 for Scorched3D by  doxygen 1.5.3