Panda3D
displayInformation.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file displayInformation.h
10  * @author aignacio
11  * @date 2007-01-17
12  */
13 
14 #ifndef DISPLAYINFORMATION_H
15 #define DISPLAYINFORMATION_H
16 
17 #include "typedef.h"
18 #include "graphicsStateGuardian.h"
19 
20 struct EXPCL_PANDA_DISPLAY DisplayMode {
21 PUBLISHED:
22  int width;
23  int height;
24  int bits_per_pixel;
25  int refresh_rate;
26  int fullscreen_only;
27 
28  bool operator == (const DisplayMode &other) const;
29  bool operator != (const DisplayMode &other) const;
30  void output(std::ostream &out) const;
31 };
32 
33 /**
34  * This class contains various display information.
35  */
36 class EXPCL_PANDA_DISPLAY DisplayInformation {
37 PUBLISHED:
38  enum DetectionState {
39  DS_unknown,
40  DS_success,
41 
42  DS_direct_3d_create_error,
43  DS_create_window_error,
44  DS_create_device_error,
45  };
46 
49 
50  int get_display_state();
51 
52  int get_maximum_window_width();
53  int get_maximum_window_height();
54  int get_window_bits_per_pixel();
55 
56  int get_total_display_modes();
57  const DisplayMode &get_display_mode(int display_index);
58  MAKE_SEQ(get_display_modes, get_total_display_modes, get_display_mode);
59 
60  // Older interface for display modes.
61  int get_display_mode_width(int display_index);
62  int get_display_mode_height(int display_index);
63  int get_display_mode_bits_per_pixel(int display_index);
64  int get_display_mode_refresh_rate(int display_index);
65  int get_display_mode_fullscreen_only(int display_index);
66 
67  GraphicsStateGuardian::ShaderModel get_shader_model();
68  int get_video_memory();
69  int get_texture_memory();
70 
71  void update_memory_information();
72  uint64_t get_physical_memory();
73  uint64_t get_available_physical_memory();
74  uint64_t get_page_file_size();
75  uint64_t get_available_page_file_size();
76  uint64_t get_process_virtual_memory();
77  uint64_t get_available_process_virtual_memory();
78  int get_memory_load();
79  uint64_t get_page_fault_count();
80  uint64_t get_process_memory();
81  uint64_t get_peak_process_memory();
82  uint64_t get_page_file_usage();
83  uint64_t get_peak_page_file_usage();
84 
85  int get_vendor_id();
86  int get_device_id();
87 
88  int get_driver_product();
89  int get_driver_version();
90  int get_driver_sub_version();
91  int get_driver_build();
92 
93  int get_driver_date_month();
94  int get_driver_date_day();
95  int get_driver_date_year();
96 
97  const std::string &get_cpu_vendor_string() const;
98  const std::string &get_cpu_brand_string() const;
99  unsigned int get_cpu_version_information();
100  unsigned int get_cpu_brand_index();
101 
102  uint64_t get_cpu_frequency();
103  static uint64_t get_cpu_time();
104 
105  uint64_t get_maximum_cpu_frequency();
106  uint64_t get_current_cpu_frequency();
107  void update_cpu_frequency(int processor_number);
108 
109  int get_num_cpu_cores();
110  int get_num_logical_cpus();
111 
112  int get_os_version_major();
113  int get_os_version_minor();
114  int get_os_version_build();
115  int get_os_platform_id();
116 
117 public:
118  DetectionState _state;
119  int _get_adapter_display_mode_state;
120  int _get_device_caps_state;
121  int _maximum_window_width;
122  int _maximum_window_height;
123  int _window_bits_per_pixel;
124  int _total_display_modes;
125  DisplayMode *_display_mode_array;
126  GraphicsStateGuardian::ShaderModel _shader_model;
127  int _video_memory;
128  int _texture_memory;
129 
130  uint64_t _physical_memory;
131  uint64_t _available_physical_memory;
132  uint64_t _page_file_size;
133  uint64_t _available_page_file_size;
134  uint64_t _process_virtual_memory;
135  uint64_t _available_process_virtual_memory;
136 
137  uint64_t _page_fault_count;
138  uint64_t _process_memory;
139  uint64_t _peak_process_memory;
140  uint64_t _page_file_usage;
141  uint64_t _peak_page_file_usage;
142 
143  int _memory_load;
144 
145  int _vendor_id;
146  int _device_id;
147 
148  int _driver_product;
149  int _driver_version;
150  int _driver_sub_version;
151  int _driver_build;
152 
153  int _driver_date_month;
154  int _driver_date_day;
155  int _driver_date_year;
156 
157 
158  std::string _cpu_vendor_string;
159  std::string _cpu_brand_string;
160  unsigned int _cpu_version_information;
161  unsigned int _cpu_brand_index;
162 
163  uint64_t _cpu_frequency;
164 
165  uint64_t _maximum_cpu_frequency;
166  uint64_t _current_cpu_frequency;
167 
168  int _num_cpu_cores;
169  int _num_logical_cpus;
170 
171  void (*_get_memory_information_function) (DisplayInformation *display_information);
172  int (*_update_cpu_frequency_function) (int processor_number, DisplayInformation *display_information);
173 
174  int _os_version_major;
175  int _os_version_minor;
176  int _os_version_build;
177  int _os_platform_id;
178 };
179 
180 #endif
This class contains various display information.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.