PageRenderTime 11ms CodeModel.GetById 8ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/src/Assets_Assimp/tools/assimp_view/MeshRenderer.h

http://github.com/Akranar/daguerreo
C Header | 97 lines | 20 code | 17 blank | 60 comment | 0 complexity | f0afc03b3616bcb40efd3550aa9d2d74 MD5 | raw file
Possible License(s): AGPL-3.0, LGPL-2.1, LGPL-3.0, GPL-2.0
 1/*
 2---------------------------------------------------------------------------
 3Open Asset Import Library (ASSIMP)
 4---------------------------------------------------------------------------
 5
 6Copyright (c) 2006-2010, ASSIMP Development Team
 7
 8All rights reserved.
 9
10Redistribution and use of this software in source and binary forms, 
11with or without modification, are permitted provided that the following 
12conditions are met:
13
14* Redistributions of source code must retain the above
15  copyright notice, this list of conditions and the
16  following disclaimer.
17
18* Redistributions in binary form must reproduce the above
19  copyright notice, this list of conditions and the
20  following disclaimer in the documentation and/or other
21  materials provided with the distribution.
22
23* Neither the name of the ASSIMP team, nor the names of its
24  contributors may be used to endorse or promote products
25  derived from this software without specific prior
26  written permission of the ASSIMP Development Team.
27
28THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
29"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
30LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
32OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
34LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
36THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
37(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
38OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39---------------------------------------------------------------------------
40*/
41
42#if (!defined AV_MESH_RENDERER_H_INCLUDED)
43#define AV_MESH_RENDERER_H_INCLUDED
44
45
46
47//-------------------------------------------------------------------------------
48/* Helper class tp render meshes
49*/
50//-------------------------------------------------------------------------------
51class CMeshRenderer
52{
53private:
54
55	// default constructor
56	CMeshRenderer() 
57
58	{
59		// no other members to initialize
60	}
61
62public:
63
64	//------------------------------------------------------------------
65	// Singleton accessors
66	static CMeshRenderer s_cInstance;
67	inline static CMeshRenderer& Instance ()
68	{
69		return s_cInstance;
70	}
71
72
73	//------------------------------------------------------------------
74	// Draw a mesh in the global mesh list using the current pipeline state
75	// iIndex Index of the mesh to be drawn
76	//
77	// The function draws all faces in order, regardless of their distance
78	int DrawUnsorted(unsigned int iIndex);
79
80	//------------------------------------------------------------------
81	// Draw a mesh in the global mesh list using the current pipeline state
82	// iIndex Index of the mesh to be drawn
83	//
84	// The method sorts all vertices by their distance (back to front)
85	//
86	// mWorld World matrix for the node
87	int DrawSorted(unsigned int iIndex,
88		const aiMatrix4x4& mWorld);
89
90
91
92private:
93
94	
95};
96
97#endif //!! include guard