daniel@transgaming.com | b80a190 | 2012-12-20 20:57:09 +0000 | [diff] [blame] | 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 LIBGLESV2_RENDERER_VERTEXBUFFER9_H_ |
| 10 | #define LIBGLESV2_RENDERER_VERTEXBUFFER9_H_ |
| 11 | |
| 12 | #include "libGLESv2/renderer/VertexBuffer.h" |
daniel@transgaming.com | b80a190 | 2012-12-20 20:57:09 +0000 | [diff] [blame] | 13 | |
daniel@transgaming.com | b80a190 | 2012-12-20 20:57:09 +0000 | [diff] [blame] | 14 | namespace rx |
| 15 | { |
shannon.woods@transgaming.com | 486d9e9 | 2013-02-28 23:15:41 +0000 | [diff] [blame] | 16 | class Renderer9; |
daniel@transgaming.com | b80a190 | 2012-12-20 20:57:09 +0000 | [diff] [blame] | 17 | |
| 18 | class VertexBuffer9 : public VertexBuffer |
| 19 | { |
| 20 | public: |
| 21 | explicit VertexBuffer9(rx::Renderer9 *const renderer); |
| 22 | virtual ~VertexBuffer9(); |
| 23 | |
| 24 | virtual bool initialize(unsigned int size, bool dynamicUsage); |
| 25 | |
| 26 | static VertexBuffer9 *makeVertexBuffer9(VertexBuffer *vertexBuffer); |
| 27 | |
Jamie Madill | a857c36 | 2013-07-02 11:57:02 -0400 | [diff] [blame] | 28 | virtual bool storeVertexAttributes(const gl::VertexAttribute &attrib, const gl::VertexAttribCurrentValueData ¤tValue, |
| 29 | GLint start, GLsizei count, GLsizei instances, unsigned int offset); |
daniel@transgaming.com | b80a190 | 2012-12-20 20:57:09 +0000 | [diff] [blame] | 30 | |
Geoff Lang | a36ead4 | 2013-08-02 11:54:08 -0400 | [diff] [blame] | 31 | virtual bool getSpaceRequired(const gl::VertexAttribute &attrib, GLsizei count, GLsizei instances, unsigned int *outSpaceRequired) const; |
daniel@transgaming.com | b80a190 | 2012-12-20 20:57:09 +0000 | [diff] [blame] | 32 | |
daniel@transgaming.com | b80a190 | 2012-12-20 20:57:09 +0000 | [diff] [blame] | 33 | virtual unsigned int getBufferSize() const; |
| 34 | virtual bool setBufferSize(unsigned int size); |
| 35 | virtual bool discard(); |
| 36 | |
| 37 | IDirect3DVertexBuffer9 *getBuffer() const; |
| 38 | |
| 39 | private: |
| 40 | DISALLOW_COPY_AND_ASSIGN(VertexBuffer9); |
| 41 | |
| 42 | rx::Renderer9 *const mRenderer; |
| 43 | |
| 44 | IDirect3DVertexBuffer9 *mVertexBuffer; |
| 45 | unsigned int mBufferSize; |
| 46 | bool mDynamicUsage; |
| 47 | |
Geoff Lang | a36ead4 | 2013-08-02 11:54:08 -0400 | [diff] [blame] | 48 | static bool spaceRequired(const gl::VertexAttribute &attrib, std::size_t count, GLsizei instances, |
| 49 | unsigned int *outSpaceRequired); |
daniel@transgaming.com | b80a190 | 2012-12-20 20:57:09 +0000 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | } |
| 53 | |
shannon.woods@transgaming.com | 315b640 | 2013-02-28 23:12:46 +0000 | [diff] [blame] | 54 | #endif // LIBGLESV2_RENDERER_VERTEXBUFFER9_H_ |