• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // Indexffer9.h: Defines the D3D9 IndexBuffer implementation.
8 
9 #ifndef LIBGLESV2_RENDERER_INDEXBUFFER9_H_
10 #define LIBGLESV2_RENDERER_INDEXBUFFER9_H_
11 
12 #include "libGLESv2/renderer/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     virtual ~IndexBuffer9();
23 
24     virtual bool initialize(unsigned int bufferSize, GLenum indexType, bool dynamic);
25 
26     static IndexBuffer9 *makeIndexBuffer9(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     D3DFORMAT getIndexFormat() const;
38     IDirect3DIndexBuffer9 *getBuffer() const;
39 
40   private:
41     DISALLOW_COPY_AND_ASSIGN(IndexBuffer9);
42 
43     rx::Renderer9 *const mRenderer;
44 
45     IDirect3DIndexBuffer9 *mIndexBuffer;
46     unsigned int mBufferSize;
47     GLenum mIndexType;
48     bool mDynamic;
49 };
50 
51 }
52 
53 #endif // LIBGLESV2_RENDERER_INDEXBUFFER9_H_
54