]> git.lizzy.rs Git - irrlicht.git/blob - include/SVertexIndex.h
Merging r5975 through r6036 from trunk to ogl-es branch.
[irrlicht.git] / include / SVertexIndex.h
1 // Copyright (C) 2008-2012 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __S_VERTEX_INDEX_H_INCLUDED__\r
6 #define __S_VERTEX_INDEX_H_INCLUDED__\r
7 \r
8 #include "irrTypes.h"\r
9 \r
10 \r
11 namespace irr\r
12 {\r
13 namespace video\r
14 {\r
15 enum E_INDEX_TYPE\r
16 {\r
17         EIT_16BIT = 0,\r
18         EIT_32BIT\r
19 };\r
20 \r
21 \r
22 /*\r
23 //! vertex index used by the Irrlicht engine.\r
24 template <class T>\r
25 struct SSpecificVertexIndex\r
26 {\r
27         T Index;\r
28 \r
29         //! default constructor\r
30         SSpecificVertexIndex() {}\r
31 \r
32         //! constructor\r
33         SSpecificVertexIndex(u32 _index) :Index(_index) {}\r
34 \r
35         bool operator==(const SSpecificVertexIndex& other) const\r
36         {\r
37                 return (Index == other.Index);\r
38         }\r
39 \r
40         bool operator!=(const SSpecificVertexIndex& other) const\r
41         {\r
42                 return (Index != other.Index);\r
43         }\r
44 \r
45         bool operator<(const SSpecificVertexIndex& other) const\r
46         {\r
47                 return (Index < other.Index);\r
48         }\r
49 \r
50         SSpecificVertexIndex operator+(const u32& other) const\r
51         {\r
52                 return SSpecificVertexIndex(Index + other);\r
53         }\r
54 \r
55         operator const u32() const\r
56         {\r
57                 return (const u32)Index;\r
58         }\r
59 \r
60         E_INDEX_TYPE getType() const\r
61         {\r
62                 if (sizeof(T)==sizeof(u16))\r
63                         return video::EIT_16BIT;\r
64                 return video::EIT_32BIT;\r
65         }\r
66 \r
67 };\r
68 \r
69 //typedef SSpecificVertexIndex<u16> SVertexIndex;\r
70 \r
71 typedef u32 SVertexIndex;\r
72 */\r
73 \r
74 \r
75 } // end namespace video\r
76 } // end namespace irr\r
77 \r
78 #endif\r
79 \r