Panda3D

shaderContext.h

00001 // Filename: shaderContext.h
00002 // Created by: jyelon (01Sep05)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef SHADERCONTEXT_H
00016 #define SHADERCONTEXT_H
00017 
00018 #include "pandabase.h"
00019 #include "internalName.h"
00020 #include "savedContext.h"
00021 #include "shader.h"
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //       Class : ShaderContext
00025 // Description : The ShaderContext is meant to contain the compiled
00026 //               version of a shader string.  ShaderContext is an
00027 //               abstract base class, there will be a subclass of it
00028 //               for each shader language and graphics API.
00029 //               Since the languages are so different and the
00030 //               graphics APIs have so little in common, the base
00031 //               class contains almost nothing.  All the implementation
00032 //               details are in the subclasses.
00033 ////////////////////////////////////////////////////////////////////
00034 
00035 class EXPCL_PANDA_GOBJ ShaderContext: public SavedContext {
00036 public:
00037   INLINE ShaderContext(Shader *se);
00038 
00039 PUBLISHED:
00040   INLINE Shader *get_shader() const;
00041 
00042 public:  
00043   Shader *_shader;
00044 
00045 public:
00046   static TypeHandle get_class_type() {
00047     return _type_handle;
00048   }
00049   static void init_type() {
00050     TypedObject::init_type();
00051     register_type(_type_handle, "ShaderContext",
00052                   TypedObject::get_class_type());
00053   }
00054   virtual TypeHandle get_type() const {
00055     return get_class_type();
00056   }
00057   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00058 
00059 private:
00060   static TypeHandle _type_handle;
00061 };
00062 
00063 #include "shaderContext.I"
00064 
00065 #endif
 All Classes Functions Variables Enumerations