Skylicht Engine
Loading...
Searching...
No Matches
Skylicht.h
1/*
2!@
3MIT License
4
5Copyright (c) 2019 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
25#pragma once
26
27#ifdef ANDROID
28#include <android/log.h>
29#include <jni.h>
30#endif
31
32namespace irr
33{
34 class IrrlichtDevice;
35}
36
41
46
51
56
61
66
71
76
81
87
93
99
105
111
117
122
127
132
137
142
147
196
198namespace Skylicht
199{
209 SKYLICHT_API void initSkylicht(IrrlichtDevice* device, bool server = false);
210
216 SKYLICHT_API void releaseSkylicht();
217
224 SKYLICHT_API void updateSkylicht();
225
230 SKYLICHT_API IrrlichtDevice* getIrrlichtDevice();
231
236 SKYLICHT_API IVideoDriver* getVideoDriver();
237
244 SKYLICHT_API float getTimeStep();
245
251 SKYLICHT_API void setTimeStep(float timestep);
252
258 SKYLICHT_API void setTotalTime(float t);
259
264 SKYLICHT_API float getNonScaledTimestep();
265
270 SKYLICHT_API float getTotalTime();
271
278 SKYLICHT_API void enableFixedTimeStep(bool b);
279
285 SKYLICHT_API void setFixedTimeStep(float s);
286
293 SKYLICHT_API void setTimeScale(float scale);
294
300 SKYLICHT_API float getTimeScale();
301
302#ifdef ANDROID
303 /*
304 * @brief Set the JavaVM used to resolve JNIEnv for the current Android thread.
305 *
306 * @param vm Pointer to the process JavaVM instance.
307 */
308 SKYLICHT_API void setJavaVM(JavaVM* vm);
309
310 /*
311 * @brief Get the JNI environment for the current Android thread.
312 *
313 * @return Pointer to the JNIEnv instance for the calling thread, or NULL if JavaVM is unavailable.
314 */
315 SKYLICHT_API JNIEnv* getJniEnv();
316
317 /*
318 * @brief Get the main activity object for Android platform.
319 *
320 * @return The jobject representing the main activity.
321 */
322 SKYLICHT_API jobject getMainActivity();
323#endif
324}
The Irrlicht device. You can create it with createDevice() or createDeviceEx().
Definition IrrlichtDevice.h:44
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.
void updateSkylicht()
Update input managers and tween system, clear debug scenes.
void initSkylicht(IrrlichtDevice *device, bool server=false)
Initialize the Skylicht Engine core systems and all required managers.
IVideoDriver * getVideoDriver()
Get the video driver used for rendering.
void setFixedTimeStep(float s)
Set the value of the fixed time step in milliseconds.
void releaseSkylicht()
Release and clean up all Skylicht Engine core resources and managers.
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.
void setTotalTime(float t)
Set the total elapsed application time in milliseconds.
IrrlichtDevice * getIrrlichtDevice()
Get the currently active Irrlicht device.
void setTimeStep(float timestep)
Set the time step for the current frame.
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33