1 //
2 // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // VertexBuffer9.h: Defines the D3D9 VertexBuffer implementation.
8 
9 #ifndef LIBANGLE_RENDERER_D3D_D3D9_VERTEXBUFFER9_H_
10 #define LIBANGLE_RENDERER_D3D_D3D9_VERTEXBUFFER9_H_
11 
12 #include "libANGLE/renderer/d3d/VertexBuffer.h"
13 
14 namespace rx
15 {
16 class Renderer9;
17 
18 class VertexBuffer9 : public VertexBuffer
19 {
20   public:
21     explicit VertexBuffer9(Renderer9 *renderer);
22 
23     gl::Error initialize(unsigned int size, bool dynamicUsage) override;
24 
25     // Warning: you should ensure binding really matches attrib.bindingIndex before using this
26     // function.
27     gl::Error storeVertexAttributes(const gl::VertexAttribute &attrib,
28                                     const gl::VertexBinding &binding,
29                                     GLenum currentValueType,
30                                     GLint start,
31                                     GLsizei count,
32                                     GLsizei instances,
33                                     unsigned int offset,
34                                     const uint8_t *sourceData) override;
35 
36     unsigned int getBufferSize() const override;
37     gl::Error setBufferSize(unsigned int size) override;
38     gl::Error discard() override;
39 
40     IDirect3DVertexBuffer9 *getBuffer() const;
41 
42   private:
43     ~VertexBuffer9() override;
44     Renderer9 *mRenderer;
45 
46     IDirect3DVertexBuffer9 *mVertexBuffer;
47     unsigned int mBufferSize;
48     bool mDynamicUsage;
49 };
50 
51 }
52 
53 #endif // LIBANGLE_RENDERER_D3D_D3D9_VERTEXBUFFER9_H_
54