00001 // Filename: spheretexShader.h 00002 // Created by: mike (09Jan97) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 #ifndef SPHERETEXSHADER_H 00019 #define SPHERETEXSHADER_H 00020 // 00021 //////////////////////////////////////////////////////////////////// 00022 // Includes 00023 //////////////////////////////////////////////////////////////////// 00024 #include <pandabase.h> 00025 00026 #include "shader.h" 00027 #include <texture.h> 00028 #include <colorBlendTransition.h> 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Defines 00032 //////////////////////////////////////////////////////////////////// 00033 00034 //////////////////////////////////////////////////////////////////// 00035 // Class : SpheretexShader 00036 // Description : 00037 //////////////////////////////////////////////////////////////////// 00038 class EXPCL_SHADER SpheretexShader : public Shader 00039 { 00040 public: 00041 00042 SpheretexShader(Texture* texture = NULL); 00043 ~SpheretexShader() { } 00044 00045 virtual void config(void); 00046 virtual void apply(Node *node, const AllAttributesWrapper &init_state, 00047 const AllTransitionsWrapper &net_trans, 00048 GraphicsStateGuardian *gsg); 00049 00050 INLINE void set_texture(Texture* texture) { 00051 _texture = texture; 00052 make_dirty(); 00053 } 00054 INLINE Texture* get_texture(void) { return _texture; } 00055 INLINE void set_blend_mode(ColorBlendProperty::Mode mode) { 00056 _blend_mode = mode; 00057 } 00058 00059 protected: 00060 00061 PT(Texture) _texture; 00062 ColorBlendProperty::Mode _blend_mode; 00063 00064 public: 00065 00066 static TypeHandle get_class_type() { 00067 return _type_handle; 00068 } 00069 static void init_type() { 00070 Shader::init_type(); 00071 register_type(_type_handle, "SpheretexShader", 00072 Shader::get_class_type()); 00073 } 00074 virtual TypeHandle get_type() const { 00075 return get_class_type(); 00076 } 00077 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00078 00079 private: 00080 00081 static TypeHandle _type_handle; 00082 }; 00083 00084 #endif