Ocean
rendering/Rendering.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_RENDERING_RENDERING_H
9 #define META_OCEAN_RENDERING_RENDERING_H
10 
11 #include "ocean/base/Base.h"
12 #include "ocean/base/Exception.h"
13 #include "ocean/base/Messenger.h"
14 
15 #include "ocean/math/Vector2.h"
16 #include "ocean/math/Vector3.h"
17 
18 #include <vector>
19 
20 namespace Ocean
21 {
22 
23 namespace Rendering
24 {
25 
26 /**
27  * @defgroup rendering Ocean Rendering Abstraction Library
28  * @{
29  * The Ocean Rendering Library is the base library and organizer of all rendering libraries / plugins.<br>
30  * In major, this library holds abstract objects only and therefore is used as an interface to provide access to different rendering plugins.<br>
31  * Each rendering plugin provides a framebuffer as well as a scenegraph.<br>
32  *
33  * Two different framebuffers can be chosen: a standard window framebuffer or a bitmap framebuffer.<br>
34  * The scenegraph provides standard scenegraph elements like e.g. nodes, groups, transform nodes, geometry nodes, shapes, materials and textures.<br>
35  * Derived rendering libraries use this abstract base library to implement rendering plugins with e.g. different 3rdparty frameworks.<br>
36  * Use the manager to get access to a specific rendering plugin.<br>
37  * Beware: Never use the specific rendering plugin directly.<br>
38  * Using the abstract rendering objects guarantees that different rendering plugins can be used by the same code.<br>
39  *
40  * Each engine provides an object factory to create object and nodes necessary for scene graph building.<br>
41  * Implemented (not abstract) rendering plugins are e.g. the NvidiaSceniX or GLESceneGraph rendering pludings.<br>
42  *
43  * However, a rendering plugin is allowed to implement a subset of the entire functionality only.<br>
44  * Therefore, not supported functions will throw an exception.<br>
45  * The library is platform independent.<br>
46  * @see Manager, Engine, Factory, Framebuffer, Object, Node, NotSupportedException.
47  * @}
48  */
49 
50 /**
51  * @namespace Ocean::Rendering Namespace of the Rendering library.<p>
52  * The Namespace Ocean::Rendering is used in the entire Ocean Rendering Library.
53  */
54 
55 /**
56  * Definition of a object id.
57  * @ingroup rendering
58  */
59 typedef size_t ObjectId;
60 
61 /**
62  * Definition of an invalid object id.
63  * @ingroup rendering
64  */
66 
67 /**
68  * Definition of a vertex index.
69  * @ingroup rendering
70  */
71 typedef unsigned int VertexIndex;
72 
73 /**
74  * Definition of an invalid vertex index.
75  * @ingroup rendering
76  */
78 
79 /**
80  * Definition of a 3D normal.
81  * @ingroup rendering
82  */
83 typedef Vector3 Normal;
84 
85 /**
86  * Definition of a 2D texture coordinate.
87  * @ingroup rendering
88  */
90 
91 /**
92  * Definition of a 3D vertex.
93  * @ingroup rendering
94  */
95 typedef Vector3 Vertex;
96 
97 /**
98  * Definition of a vector holding vertex indices.
99  * @ingroup rendering
100  */
101 typedef std::vector<VertexIndex> VertexIndices;
102 
103 /**
104  * Definition of a vector holding normals.
105  * @ingroup rendering
106  */
107 typedef std::vector<Normal> Normals;
108 
109 /**
110  * Definition of a vector holding texture coordinates.
111  * @ingroup rendering
112  */
113 typedef std::vector<TextureCoordinate> TextureCoordinates;
114 
115 /**
116  * Definition of a vector holding vertices.
117  * @ingroup rendering
118  */
119 typedef std::vector<Vertex> Vertices;
120 
121 /**
122  * Definition of a vector holding vertex indices.
123  * @ingroup rendering
124  */
125 typedef std::vector<VertexIndices> VertexIndexGroups;
126 
127 // Defines OCEAN_RENDERING_EXPORT for dll export and import.
128 #if defined(_WINDOWS) && defined(OCEAN_RUNTIME_SHARED)
129  #ifdef USE_OCEAN_RENDERING_EXPORT
130  #define OCEAN_RENDERING_EXPORT __declspec(dllexport)
131  #else
132  #define OCEAN_RENDERING_EXPORT __declspec(dllimport)
133  #endif
134 #else
135  #define OCEAN_RENDERING_EXPORT
136 #endif
137 
138 }
139 
140 }
141 
142 #endif // META_OCEAN_RENDERING_RENDERING_H
std::vector< Vertex > Vertices
Definition of a vector holding vertices.
Definition: rendering/Rendering.h:119
Vector3 Normal
Definition of a 3D normal.
Definition: rendering/Rendering.h:83
size_t ObjectId
Definition of a object id.
Definition: rendering/Rendering.h:59
std::vector< TextureCoordinate > TextureCoordinates
Definition of a vector holding texture coordinates.
Definition: rendering/Rendering.h:113
std::vector< Normal > Normals
Definition of a vector holding normals.
Definition: rendering/Rendering.h:107
const ObjectId invalidObjectId
Definition of an invalid object id.
Definition: rendering/Rendering.h:65
std::vector< VertexIndices > VertexIndexGroups
Definition of a vector holding vertex indices.
Definition: rendering/Rendering.h:125
std::vector< VertexIndex > VertexIndices
Definition of a vector holding vertex indices.
Definition: rendering/Rendering.h:101
constexpr VertexIndex invalidIndex
Definition of an invalid vertex index.
Definition: rendering/Rendering.h:77
Vector2 TextureCoordinate
Definition of a 2D texture coordinate.
Definition: rendering/Rendering.h:89
Vector3 Vertex
Definition of a 3D vertex.
Definition: rendering/Rendering.h:95
unsigned int VertexIndex
Definition of a vertex index.
Definition: rendering/Rendering.h:71
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15