Panda3D
config_device.cxx
1 // Filename: config_device.cxx
2 // Created by: drose (04May00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 #include "config_device.h"
17 #include "analogNode.h"
18 #include "buttonNode.h"
19 #include "clientAnalogDevice.h"
20 #include "clientBase.h"
21 #include "clientButtonDevice.h"
22 #include "clientDevice.h"
23 #include "clientDialDevice.h"
24 #include "clientTrackerDevice.h"
25 #include "dialNode.h"
26 #include "mouseAndKeyboard.h"
27 #include "trackerNode.h"
28 #include "virtualMouse.h"
29 
30 #include "dconfig.h"
31 
32 Configure(config_device);
33 NotifyCategoryDef(device, "");
34 
35 ConfigVariableBool asynchronous_clients
36 ("asynchronous-clients", true);
37 
38 ConfigureFn(config_device) {
39  init_libdevice();
40 }
41 
42 ////////////////////////////////////////////////////////////////////
43 // Function: init_libdevice
44 // Description: Initializes the library. This must be called at
45 // least once before any of the functions or classes in
46 // this library can be used. Normally it will be
47 // called by the static initializers and need not be
48 // called explicitly, but special cases exist.
49 ////////////////////////////////////////////////////////////////////
50 void
51 init_libdevice() {
52  static bool initialized = false;
53  if (initialized) {
54  return;
55  }
56  initialized = true;
57 
58  AnalogNode::init_type();
59  ButtonNode::init_type();
60  ClientAnalogDevice::init_type();
61  ClientBase::init_type();
62  ClientButtonDevice::init_type();
63  ClientDevice::init_type();
64  ClientDialDevice::init_type();
65  ClientTrackerDevice::init_type();
66  DialNode::init_type();
67  MouseAndKeyboard::init_type();
68  TrackerNode::init_type();
69  VirtualMouse::init_type();
70 }
This is a convenience class to specialize ConfigVariable as a boolean type.