Panda3D
|
00001 // Filename: displayInformation.h 00002 // Created by: aignacio (17Jan07) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef DISPLAYINFORMATION_H 00016 #define DISPLAYINFORMATION_H 00017 00018 #include "typedef.h" 00019 00020 typedef struct { 00021 int width; 00022 int height; 00023 int bits_per_pixel; 00024 int refresh_rate; 00025 int fullscreen_only; 00026 } 00027 DisplayMode; 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Class : DisplayInformation 00031 // Description : This class contains various display information. 00032 //////////////////////////////////////////////////////////////////// 00033 00034 class EXPCL_PANDA_DISPLAY DisplayInformation { 00035 00036 PUBLISHED: 00037 00038 enum DetectionState { 00039 DS_unknown, 00040 DS_success, 00041 00042 DS_direct_3d_create_error, 00043 DS_create_window_error, 00044 DS_create_device_error, 00045 }; 00046 00047 ~DisplayInformation(); 00048 DisplayInformation(); 00049 00050 int get_display_state(); 00051 00052 int get_maximum_window_width(); 00053 int get_maximum_window_height(); 00054 int get_window_bits_per_pixel(); 00055 00056 int get_total_display_modes(); 00057 int get_display_mode_width(int display_index); 00058 int get_display_mode_height(int display_index); 00059 int get_display_mode_bits_per_pixel(int display_index); 00060 int get_display_mode_refresh_rate(int display_index); 00061 int get_display_mode_fullscreen_only(int display_index); 00062 00063 int get_shader_model(); 00064 int get_video_memory(); 00065 int get_texture_memory(); 00066 00067 void update_memory_information(); 00068 PN_uint64 get_physical_memory(); 00069 PN_uint64 get_available_physical_memory(); 00070 PN_uint64 get_page_file_size(); 00071 PN_uint64 get_available_page_file_size(); 00072 PN_uint64 get_process_virtual_memory(); 00073 PN_uint64 get_available_process_virtual_memory(); 00074 int get_memory_load(); 00075 PN_uint64 get_page_fault_count(); 00076 PN_uint64 get_process_memory(); 00077 PN_uint64 get_peak_process_memory(); 00078 PN_uint64 get_page_file_usage(); 00079 PN_uint64 get_peak_page_file_usage(); 00080 00081 int get_vendor_id(); 00082 int get_device_id(); 00083 00084 int get_driver_product(); 00085 int get_driver_version(); 00086 int get_driver_sub_version(); 00087 int get_driver_build(); 00088 00089 int get_driver_date_month(); 00090 int get_driver_date_day(); 00091 int get_driver_date_year(); 00092 00093 int get_cpu_id_version(); 00094 int get_cpu_id_size(); 00095 unsigned int get_cpu_id_data(int index); 00096 00097 const char *get_cpu_vendor_string(); 00098 const char *get_cpu_brand_string(); 00099 unsigned int get_cpu_version_information(); 00100 unsigned int get_cpu_brand_index(); 00101 00102 PN_uint64 get_cpu_frequency(); 00103 PN_uint64 get_cpu_time(); 00104 00105 PN_uint64 get_maximum_cpu_frequency(); 00106 PN_uint64 get_current_cpu_frequency(); 00107 void update_cpu_frequency(int processor_number); 00108 00109 int get_num_cpu_cores(); 00110 int get_num_logical_cpus(); 00111 00112 int get_os_version_major(); 00113 int get_os_version_minor(); 00114 int get_os_version_build(); 00115 int get_os_platform_id(); 00116 00117 public: 00118 DetectionState _state; 00119 int _get_adapter_display_mode_state; 00120 int _get_device_caps_state; 00121 int _maximum_window_width; 00122 int _maximum_window_height; 00123 int _window_bits_per_pixel; 00124 int _total_display_modes; 00125 DisplayMode *_display_mode_array; 00126 int _shader_model; 00127 int _video_memory; 00128 int _texture_memory; 00129 00130 PN_uint64 _physical_memory; 00131 PN_uint64 _available_physical_memory; 00132 PN_uint64 _page_file_size; 00133 PN_uint64 _available_page_file_size; 00134 PN_uint64 _process_virtual_memory; 00135 PN_uint64 _available_process_virtual_memory; 00136 00137 PN_uint64 _page_fault_count; 00138 PN_uint64 _process_memory; 00139 PN_uint64 _peak_process_memory; 00140 PN_uint64 _page_file_usage; 00141 PN_uint64 _peak_page_file_usage; 00142 00143 int _memory_load; 00144 00145 int _vendor_id; 00146 int _device_id; 00147 00148 int _driver_product; 00149 int _driver_version; 00150 int _driver_sub_version; 00151 int _driver_build; 00152 00153 int _driver_date_month; 00154 int _driver_date_day; 00155 int _driver_date_year; 00156 00157 int _cpu_id_version; 00158 int _cpu_id_size; 00159 unsigned int *_cpu_id_data; 00160 00161 char *_cpu_vendor_string; 00162 char *_cpu_brand_string; 00163 unsigned int _cpu_version_information; 00164 unsigned int _cpu_brand_index; 00165 00166 PN_uint64 _cpu_frequency; 00167 00168 PN_uint64 _maximum_cpu_frequency; 00169 PN_uint64 _current_cpu_frequency; 00170 00171 int _num_cpu_cores; 00172 int _num_logical_cpus; 00173 00174 void (*_get_memory_information_function) (DisplayInformation *display_information); 00175 PN_uint64 (*_cpu_time_function) (void); 00176 int (*_update_cpu_frequency_function) (int processor_number, DisplayInformation *display_information); 00177 00178 int _os_version_major; 00179 int _os_version_minor; 00180 int _os_version_build; 00181 int _os_platform_id; 00182 }; 00183 00184 #endif