Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/Core/Headers/Kernel.h

Diff revisions: vs.
  @@ -61,54 +61,64 @@
61 61 ErrorCode initialize(const stringImpl& entryPoint);
62 62
63 63 void runLogicLoop();
64 - ///Our main application rendering loop. Call input requests, physics calculations, pre-rendering, rendering,post-rendering etc
65 - static void mainLoopApp();
66 - ///Called after a swap-buffer call and before a clear-buffer call.
67 - ///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)
68 - static void idle();
69 - ///Update all engine components that depend on the current resolution
70 - static void updateResolutionCallback(I32 w, I32 h);
64 + /// Our main application rendering loop.
65 + /// Call input requests, physics calculations, pre-rendering, rendering,post-rendering etc
66 + static void mainLoopApp();
67 + /// Called after a swap-buffer call and before a clear-buffer call.
68 + /// In a GPU-bound application, the CPU will wait on the GPU to finish processing the frame
69 + /// so this should keep it busy (old-GLUT heritage)
70 + static void idle();
71 + /// Update all engine components that depend on the current resolution
72 + static void updateResolutionCallback(I32 w, I32 h);
71 73
72 74 GFXDevice& getGFXDevice() const {return _GFX;}
73 75 SFXDevice& getSFXDevice() const {return _SFX;}
74 76 PXDevice& getPXDevice() const {return _PFX;}
75 - /// get elapsed time since kernel initialization
77 + /// Get elapsed time since kernel initialization
76 78 inline U64 getCurrentTime() const {return _currentTime;}
77 79 inline U64 getCurrentTimeDelta() const {return _currentTimeDelta;}
78 - /// get a pointer to the kernel's threadpool to add,remove,pause or stop tasks
79 - inline boost::threadpool::pool* const getThreadPool() {assert(_mainTaskPool != nullptr); return _mainTaskPool;}
80 + /// Get a pointer to the kernel's threadpool to add,remove,pause or stop tasks
81 + inline boost::threadpool::pool* const getThreadPool() {
82 + assert(_mainTaskPool != nullptr);
83 + return _mainTaskPool;
84 + }
80 85
81 86 CameraManager& getCameraMgr() { return *_cameraMgr; }
82 87
83 88 bool setCursorPosition(U16 x, U16 y) const;
84 - ///Key pressed
89 + /// Key pressed
85 90 bool onKeyDown(const Input::KeyEvent& key);
86 - ///Key released
91 + /// Key released
87 92 bool onKeyUp(const Input::KeyEvent& key);
88 - ///Joystick axis change
93 + /// Joystick axis change
89 94 bool joystickAxisMoved(const Input::JoystickEvent& arg,I8 axis);
90 - ///Joystick direction change
95 + /// Joystick direction change
91 96 bool joystickPovMoved(const Input::JoystickEvent& arg,I8 pov);
92 - ///Joystick button pressed
97 + /// Joystick button pressed
93 98 bool joystickButtonPressed(const Input::JoystickEvent& arg,I8 button);
94 - ///Joystick button released
99 + /// Joystick button released
95 100 bool joystickButtonReleased(const Input::JoystickEvent& arg, I8 button);
96 101 bool joystickSliderMoved( const Input::JoystickEvent &arg, I8 index);
97 102 bool joystickVector3DMoved( const Input::JoystickEvent &arg, I8 index);
98 - ///Mouse moved
103 + /// Mouse moved
99 104 bool mouseMoved(const Input::MouseEvent& arg);
100 - ///Mouse button pressed
105 + /// Mouse button pressed
101 106 bool mouseButtonPressed(const Input::MouseEvent& arg, Input::MouseButton button);
102 - ///Mouse button released
107 + /// Mouse button released
103 108 bool mouseButtonReleased(const Input::MouseEvent& arg, Input::MouseButton button);
104 109
105 - inline Task* AddTask(U64 tickInterval, I32 numberOfTicks, const DELEGATE_CBK<>& threadedFunction, const DELEGATE_CBK<>& onCompletionFunction = DELEGATE_CBK<>()) {
106 - Task* taskPtr = New Task(getThreadPool(), tickInterval, numberOfTicks, threadedFunction);
107 - taskPtr->connect(DELEGATE_BIND(&Kernel::threadPoolCompleted, this, std::placeholders::_1));
108 - if (!onCompletionFunction){
109 - emplace(_threadedCallbackFunctions, static_cast<U64>(taskPtr->getGUID()), onCompletionFunction);
110 - }
111 - return taskPtr;
110 + inline Task* AddTask(U64 tickInterval,
111 + I32 numberOfTicks,
112 + const DELEGATE_CBK<>& threadedFunction,
113 + const DELEGATE_CBK<>& onCompletionFunction = DELEGATE_CBK<>()) {
114 + Task* taskPtr = MemoryManager_NEW Task(getThreadPool(), tickInterval, numberOfTicks, threadedFunction);
115 + taskPtr->connect(DELEGATE_BIND(&Kernel::threadPoolCompleted, this, std::placeholders::_1));
116 + if (onCompletionFunction){
117 + emplace(_threadedCallbackFunctions,
118 + static_cast<U64>(taskPtr->getGUID()), onCompletionFunction);
119 + }
120 +
121 + return taskPtr;
112 122 }
113 123
114 124 private:
  @@ -122,7 +132,9 @@
122 132
123 133 private:
124 134 friend class SceneManager;
125 - void submitRenderCall(const RenderStage& stage, const SceneRenderState& sceneRenderState, const DELEGATE_CBK<>& sceneRenderCallback) const;
135 + void submitRenderCall(const RenderStage& stage,
136 + const SceneRenderState& sceneRenderState,
137 + const DELEGATE_CBK<>& sceneRenderCallback) const;
126 138
127 139 private:
128 140 Application& _APP;