Minor - architecture rework pt.2 - V11.1.0
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include <mutex>
|
||||
|
||||
#include "shadow_map.h"
|
||||
#include "stats.h"
|
||||
|
||||
|
||||
/////////////
|
||||
@@ -77,10 +78,6 @@ public:
|
||||
render_texture_class* get_refraction_texture() const { return refraction_texture_; };
|
||||
render_texture_class* get_reflection_texture() const { return reflection_texture_; };
|
||||
|
||||
int get_total_vertex_count() const;
|
||||
int get_total_triangle_count() const;
|
||||
int get_visible_triangle_count() const;
|
||||
|
||||
void create_big_cube(int side_count);
|
||||
void process_terrain_generation();
|
||||
virtual bool initialize(int, int, HWND, bool is_vulkan);
|
||||
@@ -144,18 +141,6 @@ public:
|
||||
|
||||
physics* get_physics() const { return physics_; };
|
||||
|
||||
// ------------------------------------- //
|
||||
// --------------- Stats --------------- //
|
||||
// ------------------------------------- //
|
||||
|
||||
int get_current_fps() const { return fps_ ? fps_->GetFps() : 0; };
|
||||
int get_min_fps() const { return fps_ ? fps_->GetMinFps() : 0; };
|
||||
int get_max_fps() const { return fps_ ? fps_->GetMaxFps() : 0; };
|
||||
float get_frame_time() const { return fps_ ? fps_->GetFrameTime() : 0.0f; };
|
||||
int get_draw_calls() const { return drawcalls_; };
|
||||
void increment_draw_call_count() { drawcalls_++; };
|
||||
void reset_draw_call_count() { drawcalls_ = 0; };
|
||||
|
||||
// ----------------------------------- //
|
||||
// ------------- Culling ------------- //
|
||||
// ----------------------------------- //
|
||||
@@ -173,6 +158,8 @@ public:
|
||||
void set_can_fixed_update(bool can_fixed_update) { can_fixed_update_ = can_fixed_update; };
|
||||
|
||||
ID3D11ShaderResourceView* get_back_buffer_srv() const {return back_buffer_srv_;};
|
||||
|
||||
stats* get_stats() const { return stats_; };
|
||||
|
||||
private:
|
||||
bool render(float, float, float, float, float);
|
||||
@@ -230,7 +217,6 @@ private :
|
||||
camera_class* sun_camera_;
|
||||
camera_class* active_camera_;
|
||||
position_class* position_;
|
||||
int drawcalls_;
|
||||
|
||||
shadow_map* shadow_map_;
|
||||
ID3D11ShaderResourceView* shadow_map_srv_;
|
||||
@@ -306,6 +292,8 @@ private :
|
||||
ID3D11Texture2D* back_buffer_texture_;
|
||||
ID3D11ShaderResourceView* back_buffer_srv_;
|
||||
|
||||
stats* stats_;
|
||||
|
||||
// ------------------------------------------------- //
|
||||
// ------------------- Culling --------------------- //
|
||||
// ------------------------------------------------- //
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "scene_manager.h"
|
||||
|
||||
class application_class;
|
||||
class stats;
|
||||
|
||||
struct widget_entry
|
||||
{
|
||||
@@ -76,6 +77,7 @@ private:
|
||||
|
||||
application_class* app_;
|
||||
scene_manager* scene_manager_;
|
||||
stats* stats_;
|
||||
|
||||
bool showObjectWindow;
|
||||
bool showTerrainWindow;
|
||||
|
||||
48
enginecustom/src/inc/system/stats.h
Normal file
48
enginecustom/src/inc/system/stats.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
|
||||
#include "fps_class.h"
|
||||
#include "object.h"
|
||||
|
||||
class stats
|
||||
{
|
||||
public:
|
||||
|
||||
stats();
|
||||
~stats();
|
||||
|
||||
bool initialize(fps_class* fps, application_class* app);
|
||||
void update_stats();
|
||||
void update();
|
||||
|
||||
int get_total_vertex_count() const;
|
||||
int get_total_triangle_count() const;
|
||||
int get_visible_triangle_count() const;
|
||||
|
||||
int get_current_fps() const { return current_fps_; };
|
||||
int get_min_fps() const { return min_fps_; };
|
||||
int get_max_fps() const { return max_fps_; };
|
||||
float get_frame_time() const { return current_frame_time_;};
|
||||
int get_draw_calls() const { return drawcalls_; };
|
||||
|
||||
void increment_draw_call_count() { drawcalls_++; };
|
||||
void reset_draw_call_count() { drawcalls_ = 0; };
|
||||
|
||||
private:
|
||||
fps_class* fps_;
|
||||
int drawcalls_;
|
||||
application_class* app_;
|
||||
|
||||
std::vector<object*> object_vec_;
|
||||
std::vector<object*> cubes_vec_;
|
||||
std::vector<object*> terrain_chunk_vec_;
|
||||
|
||||
int total_vertex_count_;
|
||||
int total_triangle_count_;
|
||||
int visible_triangle_count_ = 0;
|
||||
int current_fps_ = 0;
|
||||
int min_fps_ = 0;
|
||||
int max_fps_ = 0;
|
||||
float current_frame_time_ = 0.0f;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user