00001 // Filename: dxGeomNodeContext7.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 DXGEOMNODECONTEXT7_H 00020 #define DXGEOMNODECONTEXT7_H 00021 00022 #include "dxgsg7base.h" 00023 00024 #include "geomNodeContext.h" 00025 #include "geomNode.h" 00026 #include "pvector.h" 00027 00028 typedef struct { 00029 DWORD nVerts; 00030 D3DPRIMITIVETYPE primtype; 00031 } DPInfo; 00032 00033 //////////////////////////////////////////////////////////////////// 00034 // Class : DXGeomNodeContext7 00035 // Description : 00036 //////////////////////////////////////////////////////////////////// 00037 class EXPCL_PANDADX DXGeomNodeContext7 : public GeomNodeContext { 00038 public: 00039 INLINE DXGeomNodeContext7(GeomNode *node); 00040 ~DXGeomNodeContext7(); 00041 00042 // A list of the dynamic Geoms within the GeomNode; these aren't 00043 // part of the above display list and must be drawn separately 00044 typedef pvector< PT(Geom) > Geoms; 00045 Geoms _cached_geoms,_other_geoms; 00046 00047 // VB's are already reference-counted by D3D, no need to make separate panda object to do that 00048 // but we will want a way to know if VB has already been xformed by ProcessVerts this frame 00049 // if multiple geomnodes share VBs 00050 00051 LPDIRECT3DVERTEXBUFFER7 _pVB; 00052 LPDIRECT3DVERTEXBUFFER7 _pXformed_VB; 00053 00054 int _start_index; // starting offset of this geom's verts within the VB 00055 int _num_verts; // number of verts used by this geomcontext within the VB 00056 00057 BYTE *_pEndofVertData; // ptr to end of current vert data in VB (note: only used/valid during setup) 00058 00059 // for multiple geoms per VB, either will have to regen lengths based on per* flags, or store 00060 // per geom vector of perprim vectors lengths 00061 vector<DPInfo> _PrimInfo; 00062 00063 public: 00064 static TypeHandle get_class_type() { 00065 return _type_handle; 00066 } 00067 static void init_type() { 00068 GeomNodeContext::init_type(); 00069 register_type(_type_handle, "DXGeomNodeContext7", 00070 GeomNodeContext::get_class_type()); 00071 } 00072 virtual TypeHandle get_type() const { 00073 return get_class_type(); 00074 } 00075 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00076 00077 private: 00078 static TypeHandle _type_handle; 00079 }; 00080 00081 #include "dxGeomNodeContext7.I" 00082 00083 #endif 00084