MCPcopy Create free account
hub / github.com/defold/defold / Init

Function Init

engine/hid/src/native/hid_native.cpp:180–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 bool Init(HContext context)
181 {
182 if (context != 0x0)
183 {
184 if (!context->m_Window)
185 {
186 dmLogFatal("No window has been created.");
187 return false;
188 }
189
190 assert(context->m_Window && "No window has been set.");
191 dmPlatform::SetKeyboardCharCallback(context->m_Window, GLFWAddKeyboardChar, (void*) context);
192 dmPlatform::SetKeyboardMarkedTextCallback(context->m_Window, GLFWSetMarkedText, (void*) context);
193#if !defined(__APPLE__)
194 dmPlatform::SetKeyboardDeviceChangedCallback(context->m_Window, GLFWDeviceChangedCallback, (void*) context);
195#endif
196
197 assert(context->m_NativeContextUserData == 0);
198 context->m_Finalizing = 0;
199 context->m_NativeContextUserData = new NativeContextUserData();
200
201 InitializeGamepads(context);
202
203 return true;
204 }
205 return false;
206 }
207
208 void Final(HContext context)
209 {

Callers 3

SetUpMethod · 0.50
TEST_FFunction · 0.50
EngineCreateFunction · 0.50

Calls 5

InitializeGamepadsFunction · 0.85
assertFunction · 0.50
SetKeyboardCharCallbackFunction · 0.50

Tested by 3

SetUpMethod · 0.40
TEST_FFunction · 0.40
EngineCreateFunction · 0.40