SO3Engine
SO3DeferredPermutation.h
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2012 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25#ifndef __SO3_DEFERRED_SHADING_PERMUTATION_H__
26#define __SO3_DEFERRED_SHADING_PERMUTATION_H__
27
29
30namespace SO3
31{
32
35template <typename PERMUTATION_TYPE> class SDeferredPermutation
36{
37public:
38protected:
39private:
40
41public:
45
48 PERMUTATION_TYPE GetPermutations();
49
52 PERMUTATION_TYPE GetMaterialPermutations();
53
56 PERMUTATION_TYPE GetVertexPermutations();
57
60 PERMUTATION_TYPE GetFragmentPermutations();
61
64 std::string ToString();
65protected:
68 virtual PERMUTATION_TYPE GetPermutationsImpl()=0;
69
72 virtual PERMUTATION_TYPE GetMaterialPermutationsImpl()=0;
73
76 virtual PERMUTATION_TYPE GetVertexPermutationsImpl()=0;
77
80 virtual PERMUTATION_TYPE GetFragmentPermutationsImpl()=0;
81
84 virtual std::string ToStringImpl()=0;
85private:
86};
87
89{
90}
91
92template <typename PERMUTATION_TYPE> PERMUTATION_TYPE SDeferredPermutation<PERMUTATION_TYPE>::GetPermutations()
93{
94 return GetPermutationsImpl();
95}
96
97template <typename PERMUTATION_TYPE> PERMUTATION_TYPE SDeferredPermutation<PERMUTATION_TYPE>::GetMaterialPermutations()
98{
99 return GetMaterialPermutationsImpl();
100}
101
102template <typename PERMUTATION_TYPE> PERMUTATION_TYPE SDeferredPermutation<PERMUTATION_TYPE>::GetVertexPermutations()
103{
104 return GetVertexPermutationsImpl();
105}
106
107template <typename PERMUTATION_TYPE> PERMUTATION_TYPE SDeferredPermutation<PERMUTATION_TYPE>::GetFragmentPermutations()
108{
109 return GetFragmentPermutationsImpl();
110}
111
112template <typename PERMUTATION_TYPE> std::string SDeferredPermutation<PERMUTATION_TYPE>::ToString()
113{
114 return ToStringImpl();
115}
116
117}
118
119#endif
librairies include
PERMUTATION_TYPE GetMaterialPermutations()
virtual PERMUTATION_TYPE GetPermutationsImpl()=0
PERMUTATION_TYPE GetFragmentPermutations()
virtual PERMUTATION_TYPE GetVertexPermutationsImpl()=0
virtual PERMUTATION_TYPE GetFragmentPermutationsImpl()=0
virtual PERMUTATION_TYPE GetMaterialPermutationsImpl()=0
PERMUTATION_TYPE GetVertexPermutations()
virtual std::string ToStringImpl()=0