1 | /*
|
---|
2 | -----------------------------------------------------------------------------
|
---|
3 | This source file is part of OGRE
|
---|
4 | (Object-oriented Graphics Rendering Engine)
|
---|
5 | For the latest info, see http://www.ogre3d.org/
|
---|
6 |
|
---|
7 | Copyright (c) 2000-2005 The OGRE Team
|
---|
8 | Also see acknowledgements in Readme.html
|
---|
9 |
|
---|
10 | This program is free software; you can redistribute it and/or modify it under
|
---|
11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
13 | version.
|
---|
14 |
|
---|
15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
18 |
|
---|
19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
23 | -----------------------------------------------------------------------------
|
---|
24 | */
|
---|
25 | #ifndef __D3D9VERTEXDECLARATION_H__
|
---|
26 | #define __D3D9VERTEXDECLARATION_H__
|
---|
27 |
|
---|
28 | #include "OgreD3D9Prerequisites.h"
|
---|
29 | #include "OgreHardwareVertexBuffer.h"
|
---|
30 |
|
---|
31 | namespace Ogre {
|
---|
32 |
|
---|
33 | /** Specialisation of VertexDeclaration for D3D9 */
|
---|
34 | class D3D9VertexDeclaration : public VertexDeclaration
|
---|
35 | {
|
---|
36 | protected:
|
---|
37 | LPDIRECT3DDEVICE9 mlpD3DDevice;
|
---|
38 | LPDIRECT3DVERTEXDECLARATION9 mlpD3DDecl;
|
---|
39 | bool mNeedsRebuild;
|
---|
40 | public:
|
---|
41 | D3D9VertexDeclaration(LPDIRECT3DDEVICE9 device);
|
---|
42 | ~D3D9VertexDeclaration();
|
---|
43 |
|
---|
44 | /** See VertexDeclaration */
|
---|
45 | const VertexElement& addElement(unsigned short source, size_t offset, VertexElementType theType,
|
---|
46 | VertexElementSemantic semantic, unsigned short index = 0);
|
---|
47 |
|
---|
48 | /** See VertexDeclaration */
|
---|
49 | const VertexElement& insertElement(unsigned short atPosition,
|
---|
50 | unsigned short source, size_t offset, VertexElementType theType,
|
---|
51 | VertexElementSemantic semantic, unsigned short index = 0);
|
---|
52 |
|
---|
53 | /** See VertexDeclaration */
|
---|
54 | void removeElement(unsigned short elem_index);
|
---|
55 |
|
---|
56 | /** See VertexDeclaration */
|
---|
57 | void removeElement(VertexElementSemantic semantic, unsigned short index = 0);
|
---|
58 |
|
---|
59 | /** See VertexDeclaration */
|
---|
60 | void removeAllElements(void);
|
---|
61 |
|
---|
62 |
|
---|
63 | /** See VertexDeclaration */
|
---|
64 | void modifyElement(unsigned short elem_index, unsigned short source, size_t offset, VertexElementType theType,
|
---|
65 | VertexElementSemantic semantic, unsigned short index = 0);
|
---|
66 |
|
---|
67 | /** Gets the D3D9-specific vertex declaration. */
|
---|
68 | LPDIRECT3DVERTEXDECLARATION9 getD3DVertexDeclaration(void);
|
---|
69 |
|
---|
70 |
|
---|
71 | };
|
---|
72 |
|
---|
73 | }
|
---|
74 |
|
---|
75 | #endif
|
---|