00001 // Filename: outlineShader.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 OUTILNESHADER_H 00019 #define OUTLINESHADER_H 00020 // 00021 //////////////////////////////////////////////////////////////////// 00022 // Includes 00023 //////////////////////////////////////////////////////////////////// 00024 #include <pandabase.h> 00025 00026 #include "shader.h" 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Defines 00030 //////////////////////////////////////////////////////////////////// 00031 00032 //////////////////////////////////////////////////////////////////// 00033 // Class : OutlineShader 00034 // Description : 00035 //////////////////////////////////////////////////////////////////// 00036 class EXPCL_SHADER OutlineShader : public Shader { 00037 public: 00038 OutlineShader(void); 00039 OutlineShader(const Colorf &color); 00040 ~OutlineShader() { } 00041 00042 virtual void config(void); 00043 virtual void apply(Node *node, const AllAttributesWrapper &init_state, 00044 const AllTransitionsWrapper &net_trans, 00045 GraphicsStateGuardian *gsg); 00046 00047 INLINE void set_color(const Colorf &color) { _color = color; } 00048 00049 protected: 00050 Colorf _color; 00051 00052 public: 00053 static TypeHandle get_class_type() { 00054 return _type_handle; 00055 } 00056 static void init_type() { 00057 Shader::init_type(); 00058 register_type(_type_handle, "OutlineShader", 00059 Shader::get_class_type()); 00060 } 00061 virtual TypeHandle get_type() const { 00062 return get_class_type(); 00063 } 00064 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00065 00066 private: 00067 static TypeHandle _type_handle; 00068 }; 00069 00070 #endif