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

Function NewContext

engine/input/src/input.cpp:44–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 bool g_Init = false;
43
44 HContext NewContext(const NewContextParams& params)
45 {
46 if (!g_Init)
47 {
48 InitKeyMap();
49 InitMouseButtonMap();
50 g_Init = true;
51 }
52 Context* context = new Context();
53 context->m_GamepadIndices.SetCapacity(16);
54 context->m_UnmappedGamepads.SetCapacity(7, 16);
55 context->m_HidContext = params.m_HidContext;
56 context->m_RepeatDelay = params.m_RepeatDelay;
57 context->m_RepeatInterval = params.m_RepeatInterval;
58 context->m_PressedThreshold = 0.9f;
59 return context;
60 }
61
62 void DeleteContext(HContext context)
63 {

Callers 2

SetUpMethod · 0.50
TEST_FFunction · 0.50

Calls 3

InitKeyMapFunction · 0.85
InitMouseButtonMapFunction · 0.85
SetCapacityMethod · 0.45

Tested by 2

SetUpMethod · 0.40
TEST_FFunction · 0.40