• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2002 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 // Indexffer9.h: Defines the D3D9 IndexBuffer implementation.
8 
9 #ifndef LIBANGLE_RENDERER_D3D_D3D9_INDEXBUFFER9_H_
10 #define LIBANGLE_RENDERER_D3D_D3D9_INDEXBUFFER9_H_
11 
12 #include "libANGLE/renderer/d3d/IndexBuffer.h"
13 
14 namespace rx
15 {
16 class Renderer9;
17 
18 class IndexBuffer9 : public IndexBuffer
19 {
20   public:
21     explicit IndexBuffer9(Renderer9 *const renderer);
22     ~IndexBuffer9() override;
23 
24     angle::Result initialize(const gl::Context *context,
25                              unsigned int bufferSize,
26                              gl::DrawElementsType indexType,
27                              bool dynamic) override;
28 
29     angle::Result mapBuffer(const gl::Context *context,
30                             unsigned int offset,
31                             unsigned int size,
32                             void **outMappedMemory) override;
33     angle::Result unmapBuffer(const gl::Context *context) override;
34 
35     gl::DrawElementsType getIndexType() const override;
36     unsigned int getBufferSize() const override;
37     angle::Result setSize(const gl::Context *context,
38                           unsigned int bufferSize,
39                           gl::DrawElementsType indexType) override;
40 
41     angle::Result discard(const gl::Context *context) override;
42 
43     D3DFORMAT getIndexFormat() const;
44     IDirect3DIndexBuffer9 *getBuffer() const;
45 
46   private:
47     Renderer9 *const mRenderer;
48 
49     IDirect3DIndexBuffer9 *mIndexBuffer;
50     unsigned int mBufferSize;
51     gl::DrawElementsType mIndexType;
52     bool mDynamic;
53 };
54 
55 }  // namespace rx
56 
57 #endif  // LIBANGLE_RENDERER_D3D_D3D9_INDEXBUFFER9_H_
58