• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright (c) 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 // IndexBuffer11.h: Defines the D3D11 IndexBuffer implementation.
8 
9 #ifndef LIBGLESV2_RENDERER_INDEXBUFFER11_H_
10 #define LIBGLESV2_RENDERER_INDEXBUFFER11_H_
11 
12 #include "libGLESv2/renderer/IndexBuffer.h"
13 
14 namespace rx
15 {
16 class Renderer11;
17 
18 class IndexBuffer11 : public IndexBuffer
19 {
20   public:
21     explicit IndexBuffer11(Renderer11 *const renderer);
22     virtual ~IndexBuffer11();
23 
24     virtual bool initialize(unsigned int bufferSize, GLenum indexType, bool dynamic);
25 
26     static IndexBuffer11 *makeIndexBuffer11(IndexBuffer *indexBuffer);
27 
28     virtual bool mapBuffer(unsigned int offset, unsigned int size, void** outMappedMemory);
29     virtual bool unmapBuffer();
30 
31     virtual GLenum getIndexType() const;
32     virtual unsigned int getBufferSize() const;
33     virtual bool setSize(unsigned int bufferSize, GLenum indexType);
34 
35     virtual bool discard();
36 
37     DXGI_FORMAT getIndexFormat() const;
38     ID3D11Buffer *getBuffer() const;
39 
40   private:
41     DISALLOW_COPY_AND_ASSIGN(IndexBuffer11);
42 
43     rx::Renderer11 *const mRenderer;
44 
45     ID3D11Buffer *mBuffer;
46     unsigned int mBufferSize;
47     GLenum mIndexType;
48     bool mDynamicUsage;
49 };
50 
51 }
52 
53 #endif // LIBGLESV2_RENDERER_INDEXBUFFER11_H_