Update debug data architecture and methods
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define WT_DEBUG
|
||||
|
||||
typedef uint8_t u8;
|
||||
typedef uint32_t u32;
|
||||
typedef uint64_t u64;
|
||||
@@ -26,10 +24,9 @@ typedef double f64;
|
||||
#define CAST(type) (type)
|
||||
#define ASSERT(expr) if(!(expr)) { *(int *)0 = 0; }
|
||||
|
||||
#define DENGINE_DEBUG
|
||||
|
||||
i32 common_strlen(const char *const string);
|
||||
|
||||
#ifdef WT_DEBUG
|
||||
#define INVALID_CODE_PATH TRUE
|
||||
#endif
|
||||
i32 common_strcmp(const char *a, const char *b);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#ifndef DENGINE_DEBUG_H
|
||||
#define DENGINE_DEBUG_H
|
||||
|
||||
#include "Dengine/Renderer.h"
|
||||
|
||||
#define INVALID_CODE_PATH TRUE
|
||||
#define DEBUG_PUSH_STRING(formatString, data, type) \
|
||||
debug_pushString(formatString, CAST(void *) data, type)
|
||||
|
||||
enum DebugCallCount
|
||||
{
|
||||
debugcallcount_drawArrays,
|
||||
debugcallcount_num,
|
||||
};
|
||||
|
||||
typedef struct DebugState
|
||||
{
|
||||
/* Debug strings rendered in top left corner */
|
||||
char debugStrings[256][64];
|
||||
i32 numDebugStrings;
|
||||
f32 stringUpdateTimer;
|
||||
f32 stringUpdateRate;
|
||||
|
||||
v2 initialStringPos;
|
||||
v2 stringPos;
|
||||
|
||||
f32 stringLineGap;
|
||||
} DebugState;
|
||||
|
||||
extern DebugState GLOBAL_debugState;
|
||||
|
||||
void debug_init();
|
||||
void debug_pushString(char *formatString, void *data, char *dataType);
|
||||
void debug_stringUpdateAndRender(Renderer *renderer, Font *font, f32 dt);
|
||||
#endif
|
||||
@@ -14,32 +14,14 @@ typedef struct Renderer
|
||||
v2 size;
|
||||
} Renderer;
|
||||
|
||||
typedef struct DebugRenderer
|
||||
{
|
||||
b32 init;
|
||||
v2 stringPos;
|
||||
|
||||
} DebugRenderer;
|
||||
|
||||
typedef struct RenderQuad
|
||||
{
|
||||
v4 vertex[4];
|
||||
} RenderQuad;
|
||||
|
||||
extern DebugRenderer debugRenderer;
|
||||
|
||||
#if 0
|
||||
void renderer_backgroundTiles(Renderer *const renderer, const v2 tileSize,
|
||||
World *const world, TexAtlas *const atlasTexture,
|
||||
Texture *const tex);
|
||||
#endif
|
||||
|
||||
void renderer_string(Renderer *const renderer, Font *const font,
|
||||
const char *const string, v2 pos, f32 rotate, v4 color);
|
||||
|
||||
void renderer_debugString(Renderer *const renderer, Font *const font,
|
||||
const char *const string);
|
||||
|
||||
void renderer_entity(Renderer *renderer, v4 cameraBounds, Entity *entity,
|
||||
f32 dt, f32 rotate, v4 color);
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef DENGINE_TEXTURE_H
|
||||
#define DENGINE_TEXTURE_H
|
||||
|
||||
#include "Dengine/Common.h"
|
||||
#include "Dengine/OpenGL.h"
|
||||
#include "Dengine/Common.h"
|
||||
|
||||
#define TARGET_TEXTURE_SIZE 1024
|
||||
#define TARGET_BYTES_PER_PIXEL 4
|
||||
|
||||
Reference in New Issue
Block a user