Estella
0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
EngineState.hpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
3
#pragma once
4
5
#include <glm/glm.hpp>
6
#include "
../core/Types.hpp
"
7
8
namespace
esengine
{
9
10
struct
EngineState
{
11
int
webgl_context
= 0;
12
bool
owns_webgl_context
=
false
;
13
bool
initialized
=
false
;
14
bool
immediate_draw_active
=
false
;
15
// Off by default: glGetError is a SYNCHRONOUS round-trip to the GPU process,
16
// and the per-frame drain (renderer_flush/renderer_end) pays it on every
17
// frame of every shipped game. Under a slow or contended GPU process those
18
// round-trips starve the renderer's event loop — measured as the editor's
19
// automation surface timing out while `getError` topped the profile. Opt in
20
// via GLDebug.enable(); gl_checkErrors() probes force a check regardless.
21
bool
gl_error_check_enabled
=
false
;
22
u32
viewport_width
= 1280;
23
u32
viewport_height
= 720;
24
glm::vec4
clear_color
{0.0f, 0.0f, 0.0f, 1.0f};
25
glm::mat4
current_view_projection
{1.0f};
26
};
27
28
}
// namespace esengine
Types.hpp
Core type definitions and utilities for ESEngine.
esengine
Definition
EasingFunctions.hpp:10
esengine::u32
std::uint32_t u32
Unsigned 32-bit integer.
Definition
Types.hpp:45
esengine::EngineState
Definition
EngineState.hpp:10
esengine::EngineState::initialized
bool initialized
Definition
EngineState.hpp:13
esengine::EngineState::webgl_context
int webgl_context
Definition
EngineState.hpp:11
esengine::EngineState::current_view_projection
glm::mat4 current_view_projection
Definition
EngineState.hpp:25
esengine::EngineState::viewport_width
u32 viewport_width
Definition
EngineState.hpp:22
esengine::EngineState::owns_webgl_context
bool owns_webgl_context
Definition
EngineState.hpp:12
esengine::EngineState::clear_color
glm::vec4 clear_color
Definition
EngineState.hpp:24
esengine::EngineState::gl_error_check_enabled
bool gl_error_check_enabled
Definition
EngineState.hpp:21
esengine::EngineState::viewport_height
u32 viewport_height
Definition
EngineState.hpp:23
esengine::EngineState::immediate_draw_active
bool immediate_draw_active
Definition
EngineState.hpp:14
src
esengine
bindings
EngineState.hpp
Generated by
1.15.0