![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
The kernel is the main system that connects all of our various systems: windows, gfx, sfx, input, physics, timing, etc. More...
#include <Kernel.h>
Public Member Functions | |
Kernel (I32 argc, char **argv, Application &parentApp) | |
~Kernel () override | |
void | onLoop () |
Our main application rendering loop: Call input requests, physics calculations, pre-rendering, rendering,post-rendering etc. | |
void | idle (bool fast, U64 deltaTimeUSGame, U64 deltaTimeUSApp) |
bool | onKeyDown (const Input::KeyEvent &key) override |
Key pressed. | |
bool | onKeyUp (const Input::KeyEvent &key) override |
Key released. | |
bool | joystickAxisMoved (const Input::JoystickEvent &arg) override |
Joystick axis change. | |
bool | joystickPovMoved (const Input::JoystickEvent &arg) override |
Joystick direction change. | |
bool | joystickButtonPressed (const Input::JoystickEvent &arg) override |
Joystick button pressed. | |
bool | joystickButtonReleased (const Input::JoystickEvent &arg) override |
Joystick button released. | |
bool | joystickBallMoved (const Input::JoystickEvent &arg) override |
bool | joystickAddRemove (const Input::JoystickEvent &arg) override |
bool | joystickRemap (const Input::JoystickEvent &arg) override |
bool | mouseMoved (const Input::MouseMoveEvent &arg) override |
Mouse moved. | |
bool | mouseButtonPressed (const Input::MouseButtonEvent &arg) override |
Mouse button pressed. | |
bool | mouseButtonReleased (const Input::MouseButtonEvent &arg) override |
Mouse button released. | |
bool | onTextEvent (const Input::TextEvent &arg) override |
Generated by text events (e.g. for SDL: SDL_TEXTEDITING and SDL_TEXTINPUT) | |
PROPERTY_RW (LoopTimingData, timingData) | |
PROPERTY_RW (bool, keepAlive, true) | |
PROPERTY_R (std::unique_ptr< ProjectManager >, projectManager) | |
PROPERTY_R (std::unique_ptr< RenderPassManager >, renderPassManager) | |
PROPERTY_R (FrameListenerManager, frameListenerMgr) | |
PROPERTY_R (PlatformContext, platformContext) | |
FORCE_INLINE FrameListenerManager & | frameListenerMgr () noexcept |
FORCE_INLINE PlatformContext & | platformContext () noexcept |
![]() | |
virtual | ~InputAggregatorInterface ()=default |
virtual bool | onKeyDown (const KeyEvent &arg)=0 |
Keyboard: return true if input was consumed. | |
virtual bool | onKeyUp (const KeyEvent &arg)=0 |
virtual bool | mouseMoved (const MouseMoveEvent &arg)=0 |
Mouse: return true if input was consumed. | |
virtual bool | mouseButtonPressed (const MouseButtonEvent &arg)=0 |
virtual bool | mouseButtonReleased (const MouseButtonEvent &arg)=0 |
virtual bool | joystickButtonPressed (const JoystickEvent &arg)=0 |
Joystick or Gamepad: return true if input was consumed. | |
virtual bool | joystickButtonReleased (const JoystickEvent &arg)=0 |
virtual bool | joystickAxisMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickPovMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickBallMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickAddRemove (const JoystickEvent &arg)=0 |
virtual bool | joystickRemap (const JoystickEvent &arg)=0 |
virtual bool | onTextEvent (const TextEvent &arg)=0 |
Static Public Member Functions | |
static size_t | TotalThreadCount (TaskPoolType type) noexcept |
Private Types | |
enum class | InputConsumerType : U8 { Editor , GUI , Scene , COUNT } |
Private Member Functions | |
ErrorCode | initialize (const string &entryPoint) |
void | warmup () |
void | shutdown () |
void | startSplashScreen () |
void | stopSplashScreen () |
bool | mainLoopScene (FrameEvent &evt) |
bool | presentToScreen (FrameEvent &evt) |
void | onWindowSizeChange (const SizeChangeParams ¶ms) |
void | onResolutionChange (const SizeChangeParams ¶ms) |
void | remapAbsolutePosition (Input::MouseEvent &eventInOut) const noexcept |
![]() | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable (NonCopyable &&)=default | |
NonCopyable & | operator= (NonCopyable &&)=default |
NonCopyable ()=default | |
~NonCopyable ()=default | |
Private Attributes | |
std::array< InputAggregatorInterface *, to_base(InputConsumerType::COUNT)> | _inputConsumers {} |
vector< Rect< I32 > > | _targetViewports {} |
Time::ProfileTimer & | _appLoopTimerMain |
Time::ProfileTimer & | _appLoopTimerInternal |
Time::ProfileTimer & | _frameTimer |
Time::ProfileTimer & | _appIdleTimer |
Time::ProfileTimer & | _appScenePass |
Time::ProfileTimer & | _sceneUpdateTimer |
Time::ProfileTimer & | _sceneUpdateLoopTimer |
Time::ProfileTimer & | _cameraMgrTimer |
Time::ProfileTimer & | _flushToScreenTimer |
Time::ProfileTimer & | _preRenderTimer |
Time::ProfileTimer & | _postRenderTimer |
vector< Time::ProfileTimer * > | _renderTimer {} |
std::atomic_bool | _splashScreenUpdating {} |
std::unique_ptr< GUISplash > | _splashScreen |
I32 | _argc |
char ** | _argv |
Rect< I32 > | _prevViewport = { -1, -1, -1, -1 } |
U8 | _prevPlayerCount = 0u |
Friends | |
class | Attorney::KernelApplication |
class | Attorney::KernelWindowManager |
class | Attorney::KernelDebugInterface |
The kernel is the main system that connects all of our various systems: windows, gfx, sfx, input, physics, timing, etc.
|
strongprivate |
Divide::Kernel::Kernel | ( | I32 | argc, |
char ** | argv, | ||
Application & | parentApp | ||
) |
Definition at line 72 of file Kernel.cpp.
|
override |
Definition at line 107 of file Kernel.cpp.
|
inlinenoexcept |
Called after a swap-buffer call and before a clear-buffer call. In a GPU-bound application, the CPU will wait on the GPU to finish processing the frame so this should keep it busy (old-GLUT heritage)
Definition at line 154 of file Kernel.cpp.
Definition at line 662 of file Kernel.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1156 of file Kernel.cpp.
|
overridevirtual |
Joystick axis change.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1106 of file Kernel.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1146 of file Kernel.cpp.
|
overridevirtual |
Joystick button pressed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1126 of file Kernel.cpp.
|
overridevirtual |
Joystick button released.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1136 of file Kernel.cpp.
|
overridevirtual |
Joystick direction change.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1116 of file Kernel.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1166 of file Kernel.cpp.
|
private |
Definition at line 344 of file Kernel.cpp.
|
overridevirtual |
Mouse button pressed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1042 of file Kernel.cpp.
|
overridevirtual |
Mouse button released.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1064 of file Kernel.cpp.
|
overridevirtual |
Mouse moved.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1019 of file Kernel.cpp.
|
overridevirtual |
Key pressed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1086 of file Kernel.cpp.
|
overridevirtual |
Key released.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1096 of file Kernel.cpp.
void Divide::Kernel::onLoop | ( | ) |
Our main application rendering loop: Call input requests, physics calculations, pre-rendering, rendering,post-rendering etc.
Definition at line 181 of file Kernel.cpp.
|
private |
Definition at line 977 of file Kernel.cpp.
|
overridevirtual |
Generated by text events (e.g. for SDL: SDL_TEXTEDITING and SDL_TEXTINPUT)
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1176 of file Kernel.cpp.
|
private |
Definition at line 969 of file Kernel.cpp.
|
inlinenoexcept |
|
private |
Definition at line 572 of file Kernel.cpp.
Divide::Kernel::PROPERTY_R | ( | FrameListenerManager | , |
frameListenerMgr | |||
) |
Divide::Kernel::PROPERTY_R | ( | PlatformContext | , |
platformContext | |||
) |
Divide::Kernel::PROPERTY_R | ( | std::unique_ptr< ProjectManager > | , |
projectManager | |||
) |
Divide::Kernel::PROPERTY_R | ( | std::unique_ptr< RenderPassManager > | , |
renderPassManager | |||
) |
Divide::Kernel::PROPERTY_RW | ( | bool | , |
keepAlive | , | ||
true | |||
) |
Divide::Kernel::PROPERTY_RW | ( | LoopTimingData | , |
timingData | |||
) |
|
privatenoexcept |
Definition at line 992 of file Kernel.cpp.
|
private |
Definition at line 934 of file Kernel.cpp.
|
private |
Definition at line 112 of file Kernel.cpp.
|
private |
Definition at line 134 of file Kernel.cpp.
|
staticnoexcept |
Definition at line 51 of file Kernel.cpp.
|
private |
Definition at line 642 of file Kernel.cpp.
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |