Khaotic Engine Reborn
Loading...
Searching...
No Matches
stats.h
1#pragma once
2#include <thread>
3#include <vector>
4
5#include "fps_class.h"
6#include "object.h"
7#include <intrin.h> // Pour __cpuid
8#include <dxgi.h> // Pour DXGI
9#include <mutex>
10#pragma comment(lib, "dxgi.lib")
11
12class stats
13{
14public:
15
16 stats();
17 ~stats();
18
19 bool initialize(application_class* app);
20 void update_geometric_stats();
21 void update_visible_count();
22 void update_display_stats();
23
24 int get_total_vertex_count() const;
25 int get_total_triangle_count() const;
26 int get_visible_triangle_count() const;
27
28 int get_current_fps() const { return current_fps_; };
29 int get_min_fps() const { return min_fps_; };
30 int get_max_fps() const { return max_fps_; };
31 float get_frame_time() const { return current_frame_time_;};
32 int get_draw_calls() const { return drawcalls_; };
33
34 void increment_draw_call_count() { drawcalls_++; };
35 void reset_draw_call_count() { drawcalls_ = 0; };
36
37 std::string get_cpu_name();
38 std::string get_gpu_driver_version(ID3D11Device* device);
39
40 std::shared_ptr<int>& get_vertex_count_ptr() { return total_vertex_count_; }
41 std::shared_ptr<int>& get_triangle_count_ptr() { return total_triangle_count_; }
42
43
44private:
45 std::thread update_display_thread_;
46
47 fps_class* fps_;
48 int drawcalls_;
50
51 std::vector<object*> object_vec_;
52 std::vector<object*> cubes_vec_;
53 std::vector<object*> terrain_chunk_vec_;
54
55 std::shared_ptr<int> total_vertex_count_;
56 std::shared_ptr<int> total_triangle_count_;
57
58 int visible_triangle_count_ = 0;
59 int current_fps_ = 0;
60 int min_fps_ = 0;
61 int max_fps_ = 0;
62 float current_frame_time_ = 0.0f;
63
64};
Definition stats.h:13