Panda3D
Loading...
Searching...
No Matches
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"
19
20struct EXPCL_PANDA_DISPLAY DisplayMode {
21PUBLISHED:
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 */
36class EXPCL_PANDA_DISPLAY DisplayInformation {
37PUBLISHED:
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 int get_current_display_mode_index() const;
61
62 // Older interface for display modes.
63 int get_display_mode_width(int display_index);
64 int get_display_mode_height(int display_index);
65 int get_display_mode_bits_per_pixel(int display_index);
66 int get_display_mode_refresh_rate(int display_index);
67 int get_display_mode_fullscreen_only(int display_index);
68
69 GraphicsStateGuardian::ShaderModel get_shader_model();
70 int get_video_memory();
71 int get_texture_memory();
72
73 void update_memory_information();
74 uint64_t get_physical_memory();
75 uint64_t get_available_physical_memory();
76 uint64_t get_page_file_size();
77 uint64_t get_available_page_file_size();
78 uint64_t get_process_virtual_memory();
79 uint64_t get_available_process_virtual_memory();
80 int get_memory_load();
81 uint64_t get_page_fault_count();
82 uint64_t get_process_memory();
83 uint64_t get_peak_process_memory();
84 uint64_t get_page_file_usage();
85 uint64_t get_peak_page_file_usage();
86
87 int get_vendor_id();
88 int get_device_id();
89
90 int get_driver_product();
91 int get_driver_version();
92 int get_driver_sub_version();
93 int get_driver_build();
94
95 int get_driver_date_month();
96 int get_driver_date_day();
97 int get_driver_date_year();
98
99 const std::string &get_cpu_vendor_string() const;
100 const std::string &get_cpu_brand_string() const;
101 unsigned int get_cpu_version_information();
102 unsigned int get_cpu_brand_index();
103
104 uint64_t get_cpu_frequency();
105 static uint64_t get_cpu_time();
106
107 uint64_t get_maximum_cpu_frequency();
108 uint64_t get_current_cpu_frequency();
109 void update_cpu_frequency(int processor_number);
110
111 int get_num_cpu_cores();
112 int get_num_logical_cpus();
113
114 int get_os_version_major();
115 int get_os_version_minor();
116 int get_os_version_build();
117 int get_os_platform_id();
118
119public:
120 DetectionState _state;
121 int _current_display_mode_index;
122 int _get_device_caps_state;
123 int _maximum_window_width;
124 int _maximum_window_height;
125 int _window_bits_per_pixel;
126 int _total_display_modes;
127 DisplayMode *_display_mode_array;
128 GraphicsStateGuardian::ShaderModel _shader_model;
129 int _video_memory;
130 int _texture_memory;
131
132 uint64_t _physical_memory;
133 uint64_t _available_physical_memory;
134 uint64_t _page_file_size;
135 uint64_t _available_page_file_size;
136 uint64_t _process_virtual_memory;
137 uint64_t _available_process_virtual_memory;
138
139 uint64_t _page_fault_count;
140 uint64_t _process_memory;
141 uint64_t _peak_process_memory;
142 uint64_t _page_file_usage;
143 uint64_t _peak_page_file_usage;
144
145 int _memory_load;
146
147 int _vendor_id;
148 int _device_id;
149
150 int _driver_product;
151 int _driver_version;
152 int _driver_sub_version;
153 int _driver_build;
154
155 int _driver_date_month;
156 int _driver_date_day;
157 int _driver_date_year;
158
159
160 std::string _cpu_vendor_string;
161 std::string _cpu_brand_string;
162 unsigned int _cpu_version_information;
163 unsigned int _cpu_brand_index;
164
165 uint64_t _cpu_frequency;
166
167 uint64_t _maximum_cpu_frequency;
168 uint64_t _current_cpu_frequency;
169
170 int _num_cpu_cores;
171 int _num_logical_cpus;
172
173 void (*_get_memory_information_function) (DisplayInformation *display_information);
174 int (*_update_cpu_frequency_function) (int processor_number, DisplayInformation *display_information);
175
176 int _os_version_major;
177 int _os_version_minor;
178 int _os_version_build;
179 int _os_platform_id;
180};
181
182#endif
This class contains various display information.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.