Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
VideoDX9VertexBuffer.h
Go to the documentation of this file.
1 /* Project nGenEx
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: nGenEx.lib
6  FILE: VideoDX9VertexBuffer.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Vertex and Index Buffer classes for DirectX 9
13 */
14 
15 #ifndef VideoDX9VertexBuffer_h
16 #define VideoDX9VertexBuffer_h
17 
18 #include "VideoDX9.h"
19 
20 // +--------------------------------------------------------------------+
21 
23 {
24 public:
26  UINT num_verts,
27  UINT vert_size,
28  DWORD format,
29  DWORD usage);
31 
32  BYTE* Lock(UINT count);
33  void Unlock();
34  bool Select(int stream=0);
35 
36  UINT GetNumVerts() const;
37  UINT GetVertSize() const;
38  UINT GetNextVert() const;
39 
40 private:
41  VideoDX9* video;
42  IDirect3DVertexBuffer9* vertex_buffer;
43 
44  UINT num_verts;
45  UINT num_locked;
46  UINT vert_size;
47  UINT next_vert;
48  bool is_dynamic;
49 };
50 
51 // +--------------------------------------------------------------------+
52 
54 {
55 public:
57  UINT num_indices,
58  DWORD usage);
60 
61  WORD* Lock(UINT count);
62  void Unlock();
63  bool Select();
64 
65  UINT GetNumIndices() const;
66  UINT GetNextIndex() const;
67 
68 private:
69  VideoDX9* video;
70  IDirect3DIndexBuffer9* index_buffer;
71 
72  UINT num_indices;
73  UINT num_locked;
74  UINT next_index;
75  bool is_dynamic;
76 };
77 
78 #endif VideoDX9VertexBuffer_h
79