StaticState.h
1 /*
2 
3 Copyright (c) 2018, Johnathan Corkery. (jcorkery@umich.edu)
4 All rights reserved.
5 
6 This file is part of the Dynacoe project (https://github.com/jcorks/Dynacoe)
7 Dynacoe was released under the MIT License, as detailed below.
8 
9 
10 
11 Permission is hereby granted, free of charge, to any person obtaining a copy
12 of this software and associated documentation files (the "Software"), to deal
13 in the Software without restriction, including without limitation the rights
14 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 copies of the Software, and to permit persons to whom the Software is furnished
16 to do so, subject to the following conditions:
17 
18 The above copyright notice and this permission notice shall
19 be included in all copies or substantial portions of the Software.
20 
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27 DEALINGS IN THE SOFTWARE.
28 
29 
30 
31 */
32 
33 #ifndef H_DC_BACKENDS_RENDERER_STATIC_STATE
34 #define H_DC_BACKENDS_RENDERER_STATIC_STATE
35 
36 #include <Dynacoe/Backends/Renderer/Renderer.h>
37 
38 namespace Dynacoe {
39 
40 
41 
42 // conventional rendering object for working with statically
43 // drawn objects and information.
44 
45 struct StaticState {
46 
47  // Vertices points to a renderbuffer containing all the vertex dat a pertinent to the RenderObject.
48  // Each vertex consists of:
49  // 3-components for position,
50  // 3-components for the normal.
51  // 2-copmonents for UVs (texture coordinates)
52  // 4-components for user-defined data. Meant to be unitlized with custom programs.
53  RenderBufferID vertices;
54 
55  // Specifies how to render the vertices
56  ProgramID program;
57 
58  // material matrix , 48-components containing
59  // lighting material and arbitrary data setup.
60  RenderBufferID materialData;
61 
62  // local transform matrix (scale + rotation), 32-component
63  // Normal matrix (inverse transpose of modelData)
64  RenderBufferID modelData;
65 
66  // the source framebuffer optionally accessible
67  // during rendering. If the samplebuffer is null,
68  // the no source framebuffer will be made available
69  Framebuffer * samplebuffer;
70 
71 
72  // specifies the textures to be used. Each pair is a slot referred to by
73  // each program and the ID of the texture.
74  std::vector<std::pair<int, int>> * textures;
75 
76 
77  /* Static index list */
78  // Index lists are used to build the geometry of the StaticState.
79  // Each index refer to the index of the vertex to be used to build the triangle.
80  // every 3 vertices, a triangle is formed. If a multiple of three is not used,
81  // the behavior is implementation defined.
82  std::vector<uint32_t> * indices;
83 
84 
85 
86 };
87 
88 
89 
90 
91 
92 
93 }
94 
95 
96 
97 #endif
Definition: AssetID.h:37