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