MCPcopy Create free account
hub / github.com/SFML/SFML / open

Method open

src/SFML/Window/Win32/JoystickImpl.cpp:276–295  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

274
275////////////////////////////////////////////////////////////
276bool JoystickImpl::open(unsigned int index)
277{
278 if (directInput)
279 return openDInput(index);
280
281 // No explicit "open" action is required
282 m_index = JOYSTICKID1 + index;
283
284 // Store the joystick capabilities
285 const bool success = joyGetDevCaps(m_index, &m_caps, sizeof(m_caps)) == JOYERR_NOERROR;
286
287 if (success)
288 {
289 m_identification.name = getDeviceName(m_index, m_caps);
290 m_identification.productId = m_caps.wPid;
291 m_identification.vendorId = m_caps.wMid;
292 }
293
294 return success;
295}
296
297
298////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 1

getDeviceNameFunction · 0.85

Tested by

no test coverage detected