Files
DNF_DEV/source/EngineFrame/Actor/Debug_Actor.h
2025-10-06 04:18:49 +08:00

36 lines
782 B
C++

#pragma once
#include "EngineFrame/Actor/Actor.h"
#include "EngineFrame/Component/Text.h"
#include <SDL_ttf.h>
#include <cstdint>
class Debug_Actor : public Actor
{
private:
TTF_Font *m_debugFont;
RefPtr<Text> FPS_Text;
RefPtr<Text> DT_Text;
RefPtr<Text> RC_Text;
public:
Debug_Actor();
~Debug_Actor() override;
void Update(float deltaTime) override;
void Render() override;
uint32_t FPS = 0;
uint32_t RenderCount = 0;
SDL_Color bgColor = {0, 0, 0, 90};
int cornerRadius = 4;
int padding = 12;
#ifdef __SWITCH__
double M_PI = 3.14159265358979323846;
double M_PI_2 = 1.57079632679489661923;
#endif
private:
void DrawRoundedRect(SDL_Renderer *renderer, int x, int y, int w, int h, int radius, SDL_Color color);
};