MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / init

Method init

Engine/source/platformWin32/winInput.cpp:78–157  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

76
77//------------------------------------------------------------------------------
78void Input::init()
79{
80 Con::printf( "Input Init:" );
81
82 destroy();
83
84#ifdef LOG_INPUT
85 struct tm* newTime;
86 time_t aclock;
87 time( &aclock );
88 newTime = localtime( &aclock );
89 asctime( newTime );
90
91 gInputLog = CreateFile( L"input.log", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL );
92 log( "Input log opened at %s\n", asctime( newTime ) );
93#endif
94
95 smActive = false;
96 smLastKeyboardActivated = true;
97 smLastMouseActivated = true;
98 smLastJoystickActivated = true;
99
100 OSVERSIONINFO OSVersionInfo;
101 dMemset( &OSVersionInfo, 0, sizeof( OSVERSIONINFO ) );
102 OSVersionInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
103 if ( GetVersionEx( &OSVersionInfo ) )
104 {
105#ifdef LOG_INPUT
106 log( "Operating System:\n" );
107 switch ( OSVersionInfo.dwPlatformId )
108 {
109 case VER_PLATFORM_WIN32s:
110 log( " Win32s on Windows 3.1 version %d.%d\n", OSVersionInfo.dwMajorVersion, OSVersionInfo.dwMinorVersion );
111 break;
112
113 case VER_PLATFORM_WIN32_WINDOWS:
114 log( " Windows 95 version %d.%d\n", OSVersionInfo.dwMajorVersion, OSVersionInfo.dwMinorVersion );
115 log( " Build number %d\n", LOWORD( OSVersionInfo.dwBuildNumber ) );
116 break;
117
118 case VER_PLATFORM_WIN32_NT:
119 log( " WinNT version %d.%d\n", OSVersionInfo.dwMajorVersion, OSVersionInfo.dwMinorVersion );
120 log( " Build number %d\n", OSVersionInfo.dwBuildNumber );
121 break;
122 }
123
124 if ( OSVersionInfo.szCSDVersion != NULL )
125 log( " %s\n", OSVersionInfo.szCSDVersion );
126
127 log( "\n" );
128#endif
129
130 if ( !( OSVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && OSVersionInfo.dwMajorVersion < 5 ) )
131 {
132 smManager = new DInputManager;
133 if ( !smManager->enable() )
134 {
135 Con::printf( " DirectInput not enabled." );

Callers

nothing calls this directly

Calls 8

printfFunction · 0.85
CreateFileFunction · 0.85
dMemsetFunction · 0.70
fillAsciiTableFunction · 0.70
destroyFunction · 0.50
logFunction · 0.50
initFunction · 0.50
enableMethod · 0.45

Tested by

no test coverage detected