Skylicht Engine
Loading...
Searching...
No Matches
SkylichtHeader.h
1/*
2!@
3MIT License
4
5Copyright (c) 2024 Skylicht Technology CO., LTD
6
7Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
8(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
9merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
10subject to the following conditions:
11
12The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19
20This file is part of the "Skylicht Engine".
21https://github.com/skylicht-lab/skylicht-engine
22!#
23*/
24#pragma once
25
26#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64)
27
28#ifdef BUILD_SKYLICHT_NETWORK
29#include <Ws2tcpip.h>
30#include <Winsock2.h>
31#endif
32
33#include <memory.h>
34#include <stdlib.h>
35
36#include <Windows.h>
37
38#else
39
40#include <memory.h>
41#include <unistd.h>
42
43#ifdef BUILD_SKYLICHT_NETWORK
44#include <netinet/in.h>
45#include <net/if.h>
46#include <arpa/inet.h>
47#include <fcntl.h>
48#include <errno.h>
49#include <sys/ioctl.h>
50#include <sys/types.h>
51#include <sys/select.h>
52#include <sys/socket.h>
53#include <netdb.h>
54
55#define SOCKET int
56#define INVALID_SOCKET -1
57#define SOCKET_ERROR -1
58#endif
59
60#endif
61
62// IRRLICHT 3D ENGINE
63#include "irrlicht.h"
64#include "IRandomizer.h"
65#include "ILogger.h"
66#include "irrOS.h"
67
68using namespace irr;
69using namespace irr::scene;
70using namespace irr::video;
71
72// STL C++
73#include <algorithm>
74#include <vector>
75#include <list>
76#include <map>
77#include <stack>
78#include <queue>
79#include <fstream>
80#include <string>
81#include <cstdint>
82
83#ifdef ANDROID
84#include <android/log.h>
85#include <jni.h>
86#endif
87
88namespace Skylicht
89{
94 extern IrrlichtDevice* getIrrlichtDevice();
95
100 extern IVideoDriver* getVideoDriver();
101
108 extern float getTimeStep();
109
114 extern float getNonScaledTimestep();
115
120 extern float getTotalTime();
121
128 extern void enableFixedTimeStep(bool b);
129
135 extern void setFixedTimeStep(float s);
136
143 extern void setTimeScale(float scale);
144
150 extern float getTimeScale();
151
152#ifdef ANDROID
153 /*
154 * @brief Set the JavaVM used to resolve JNIEnv for the current Android thread.
155 *
156 * @param vm Pointer to the process JavaVM instance.
157 */
158 extern void setJavaVM(JavaVM* vm);
159
160 /*
161 * @brief Get the JNI environment for the current Android thread.
162 *
163 * @return Pointer to the JNIEnv instance for the calling thread, or NULL if JavaVM is unavailable.
164 */
165 extern JNIEnv* getJniEnv();
166
167 /*
168 * @brief Get the main activity object for Android platform.
169 *
170 * @return The jobject representing the main activity.
171 */
172 extern jobject getMainActivity();
173
174 /*
175 * @brief Set the main activity object for Android platform.
176 *
177 * @param activity The jobject representing the main activity.
178 */
179 extern void setMainActivity(jobject activity);
180#endif
181}
Main header file of the irrlicht, the only file needed to include.
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition AudioDebugLog.h:29
float getNonScaledTimestep()
Get the current time step in milliseconds, without time scale applied.
IVideoDriver * getVideoDriver()
Get the video driver used for rendering.
void setFixedTimeStep(float s)
Set the value of the fixed time step in milliseconds.
void setTimeScale(float scale)
Set the time scale multiplier for time-based updates.
float getTimeScale()
Get the current time scale multiplier.
float getTotalTime()
Get the total elapsed application time in milliseconds.
float getTimeStep()
Get the current time step in milliseconds, scaled by the time scale.
void enableFixedTimeStep(bool b)
Enable or disable the use of fixed time step for updates.
IrrlichtDevice * getIrrlichtDevice()
Get the currently active Irrlicht device.
All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees a...
Definition CIndexBuffer.h:13
The video namespace contains classes for accessing the video driver. All 2d and 3d rendering is done ...
Definition EDriverFeatures.h:11
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33