Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
ProtoBufUtils.hpp
1/*
2Copyright (C) 2018,2019,2021,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#ifndef AEONGAMES_PROTOBUFUTILS_H
17#define AEONGAMES_PROTOBUFUTILS_H
18#include <cstdint>
19#include <string>
21#include "aeongames/Vector3.hpp"
25#include "aeongames/Material.hpp"
26namespace AeonGames
27{
28 class ReferenceMsg;
29 class PipelineMsg;
30 class Vector3Msg;
31 class QuaternionMsg;
32 class TransformMsg;
33 class ComponentPropertyMsg;
34 class PipelineMsg;
39 DLL uint32_t GetReferenceMsgId ( const ReferenceMsg& reference_buffer );
44 DLL uint32_t GetAttributes ( const PipelineMsg& aPipelineMsg );
49 DLL std::string GetAttributesGLSL ( const PipelineMsg& aPipelineMsg );
54 DLL std::string GetPropertiesGLSL ( const PipelineMsg& aPipelineMsg );
59 Vector3 GetVector3 ( const Vector3Msg& aVector3 );
64 Quaternion GetQuaternion ( const QuaternionMsg& aQuaternion );
69 Transform GetTransform ( const TransformMsg& aTransform );
74 Property GetProperty ( const ComponentPropertyMsg& aComponentPropertyMsg );
79 size_t GetUniformBufferSize ( const PipelineMsg& aPipelineMsg );
84 DLL Material::UniformKeyValue PropertyToKeyValue ( const PropertyMsg& aProperty );
85}
86#endif
Platform-specific macros, includes, and DLL export/import definitions.
Defines the Property variant type used for generic value storage.
Header for the quaternion class.
Header for Transform component class.
Header for the 3D vector class.
std::tuple< std::string, UniformValue > UniformKeyValue
Key-value pair mapping a uniform name to its value.
Definition Material.hpp:43
Quaternion class.
Component class for any object that requires space transformations.
Definition Transform.hpp:34
3D vector class.
Definition Vector3.hpp:32
<- This is here just for the literals
Definition AABB.hpp:31
DLL std::string GetPropertiesGLSL(const PipelineMsg &aPipelineMsg)
Generate GLSL property/uniform declarations from a pipeline message.
Property GetProperty(const ComponentPropertyMsg &aComponentPropertyMsg)
Convert a ComponentPropertyMsg protobuf message to a Property.
Transform GetTransform(const TransformMsg &aTransform)
Convert a TransformMsg protobuf message to a Transform.
std::variant< int, long, long long, unsigned, unsigned long, unsigned long long, float, double, std::string, std::filesystem::path > Property
A variant type that can hold any commonly used property value.
Definition Property.hpp:31
DLL uint32_t GetAttributes(const PipelineMsg &aPipelineMsg)
Get the packed attribute flags from a pipeline message.
DLL Material::UniformKeyValue PropertyToKeyValue(const PropertyMsg &aProperty)
Convert a PropertyMsg to a Material uniform key-value pair.
Vector3 GetVector3(const Vector3Msg &aVector3)
Convert a Vector3Msg protobuf message to a Vector3.
DLL uint32_t GetReferenceMsgId(const ReferenceMsg &reference_buffer)
Retrieve the identifier from a ReferenceMsg.
Quaternion GetQuaternion(const QuaternionMsg &aQuaternion)
Convert a QuaternionMsg protobuf message to a Quaternion.
DLL std::string GetAttributesGLSL(const PipelineMsg &aPipelineMsg)
Generate GLSL attribute declarations from a pipeline message.
size_t GetUniformBufferSize(const PipelineMsg &aPipelineMsg)
Calculate the uniform buffer size required by a pipeline.