Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
WorldEditor.h
1/*
2Copyright (C) 2017-2019,2021,2022,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
8http://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_WORLDEDITOR_H
17#define AEONGAMES_WORLDEDITOR_H
18
19#include <QMutex>
20#include <QApplication>
21#include <QSettings>
22#include <string>
23#include <filesystem>
24#include "aeongames/Pipeline.hpp"
25#include "aeongames/Mesh.hpp"
26#include "aeongames/Material.hpp"
27#include "aeongames/Renderer.hpp"
28#include "aeongames/StringId.hpp"
29Q_DECLARE_METATYPE ( AeonGames::StringId );
30Q_DECLARE_METATYPE ( std::string );
31Q_DECLARE_METATYPE ( std::filesystem::path );
32
33#define qWorldEditorApp (reinterpret_cast<WorldEditor*> ( qApp ))
34
35namespace AeonGames
36{
38 class WorldEditor final : public QApplication
39 {
40 public:
46 WorldEditor ( int &argc, char *argv[] );
48 ~WorldEditor() final;
51 const Pipeline& GetGridPipeline() const;
54 const Mesh& GetGridMesh() const;
57 const Material& GetXGridMaterial() const;
60 const Material& GetYGridMaterial() const;
63 const Pipeline& GetSolidColorPipeline() const;
66 const Material& GetSolidColorMaterial() const;
69 const Mesh& GetAABBWireMesh() const;
72 int GetStringIdMetaType() const;
75 int GetStringMetaType() const;
78 int GetPathMetaType() const;
83 void AttachWindowToRenderer ( void* aWindow );
88 void DetachWindowFromRenderer ( void* aWindow );
92 private:
93 int mStringIdMetaType{};
94 int mStringMetaType{};
95 int mPathMetaType{};
96 QMutex mMutex{};
97 std::string mRendererName{};
98 std::unique_ptr<Renderer> mRenderer{};
99 std::unique_ptr<Pipeline> mGridPipeline{};
100 std::unique_ptr<Mesh> mGridMesh{};
101 std::unique_ptr<Material> mXGridMaterial{};
102 std::unique_ptr<Material> mYGridMaterial{};
103 std::unique_ptr<Pipeline> mSolidColorPipeline{};
104 std::unique_ptr<Material> mSolidColorMaterial{};
105 std::unique_ptr<Mesh> mAABBWireMesh{};
106 };
107}
108#endif
Represents a surface material with uniform properties and texture samplers.
Definition Material.hpp:38
Represents a polygon mesh with vertex attributes and index data.
Definition Mesh.hpp:31
Rendering pipeline resource.
Definition Pipeline.hpp:122
Abstract base class for rendering backends.
Definition Renderer.hpp:44
CRC-based compile-time string identifier.
Definition StringId.hpp:31
const Material & GetYGridMaterial() const
Get the Y-axis grid material.
~WorldEditor() final
Destructor.
const Pipeline & GetGridPipeline() const
Get the grid rendering pipeline.
int GetStringIdMetaType() const
Get the Qt meta-type ID for StringId.
int GetStringMetaType() const
Get the Qt meta-type ID for std::string.
void DetachWindowFromRenderer(void *aWindow)
Detach a native window from the renderer.
const Material & GetSolidColorMaterial() const
Get the solid color material.
void AttachWindowToRenderer(void *aWindow)
Attach a native window to the renderer.
const Mesh & GetAABBWireMesh() const
Get the axis-aligned bounding box wireframe mesh.
WorldEditor(int &argc, char *argv[])
Construct the world editor application.
const Mesh & GetGridMesh() const
Get the grid mesh.
Renderer * GetRenderer()
Get the current renderer.
int GetPathMetaType() const
Get the Qt meta-type ID for std::filesystem::path.
const Pipeline & GetSolidColorPipeline() const
Get the solid color rendering pipeline.
const Material & GetXGridMaterial() const
Get the X-axis grid material.
<- This is here just for the literals
Definition AABB.hpp:31