00001 // Filename: glGeomNodeContext.h 00002 // Created by: drose (12Jun01) 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 00019 #ifndef GLGEOMNODECONTEXT_H 00020 #define GLGEOMNODECONTEXT_H 00021 00022 #include "pandabase.h" 00023 #include "geomNodeContext.h" 00024 #include "geomNode.h" 00025 #include "pvector.h" 00026 00027 #ifdef WIN32_VC 00028 // Must include windows.h before gl.h on NT 00029 #define WIN32_LEAN_AND_MEAN 00030 #include <windows.h> 00031 #undef WIN32_LEAN_AND_MEAN 00032 #endif 00033 00034 #include <GL/gl.h> 00035 00036 //////////////////////////////////////////////////////////////////// 00037 // Class : GLGeomNodeContext 00038 // Description : 00039 //////////////////////////////////////////////////////////////////// 00040 class EXPCL_PANDAGL GLGeomNodeContext : public GeomNodeContext { 00041 public: 00042 INLINE GLGeomNodeContext(GeomNode *node); 00043 00044 // The GL display list index that draws the contents of this 00045 // GeomNode. 00046 GLuint _index; 00047 00048 // A list of the dynamic Geoms within the GeomNode; these aren't 00049 // part of the above display list. 00050 typedef pvector< PT(Geom) > Geoms; 00051 Geoms _dynamic_geoms; 00052 00053 // The number of vertices represented by the display list. This is 00054 // strictly for the benefit of PStats reporting. 00055 DO_PSTATS_STUFF(int _num_verts;) 00056 00057 public: 00058 static TypeHandle get_class_type() { 00059 return _type_handle; 00060 } 00061 static void init_type() { 00062 GeomNodeContext::init_type(); 00063 register_type(_type_handle, "GLGeomNodeContext", 00064 GeomNodeContext::get_class_type()); 00065 } 00066 virtual TypeHandle get_type() const { 00067 return get_class_type(); 00068 } 00069 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00070 00071 private: 00072 static TypeHandle _type_handle; 00073 }; 00074 00075 #include "glGeomNodeContext.I" 00076 00077 #endif 00078