Skip to content

Commit

Permalink
feat: create log ext
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Nov 19, 2024
1 parent 10ab13d commit cdb199b
Show file tree
Hide file tree
Showing 27 changed files with 452 additions and 240 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ jobs:
if not exist ../out/pl_graphics_ext.dll exit 1
if not exist ../out/pl_image_ext.dll exit 1
if not exist ../out/pl_job_ext.dll exit 1
if not exist ../out/pl_log_ext.dll exit 1
if not exist ../out/pl_model_loader_ext.dll exit 1
if not exist ../out/pl_profile_ext.dll exit 1
if not exist ../out/pl_rect_pack_ext.dll exit 1
Expand Down Expand Up @@ -240,6 +241,7 @@ jobs:
test -f ./out/pl_graphics_ext.dylib || exit 1
test -f ./out/pl_image_ext.dylib || exit 1
test -f ./out/pl_job_ext.dylib || exit 1
test -f ./out/pl_log_ext.dylib || exit 1
test -f ./out/pl_model_loader_ext.dylib || exit 1
test -f ./out/pl_profile_ext.dylib || exit 1
test -f ./out/pl_rect_pack_ext.dylib || exit 1
Expand Down Expand Up @@ -376,6 +378,7 @@ jobs:
test -f ./out/pl_graphics_ext.so || exit 1
test -f ./out/pl_image_ext.so || exit 1
test -f ./out/pl_job_ext.so || exit 1
test -f ./out/pl_log_ext.so || exit 1
test -f ./out/pl_model_loader_ext.so || exit 1
test -f ./out/pl_profile_ext.so || exit 1
test -f ./out/pl_rect_pack_ext.so || exit 1
Expand Down
14 changes: 1 addition & 13 deletions examples/example_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Index of this file:
// [SECTION] pl_app_shutdown
// [SECTION] pl_app_resize
// [SECTION] pl_app_update
// [SECTION] unity build
*/

//-----------------------------------------------------------------------------
Expand All @@ -27,13 +26,13 @@ Index of this file:
#include <stdio.h>
#include <string.h> // memset
#include "pl.h"
#include "pl_log.h"
#include "pl_ds.h"
#include "pl_memory.h"
#define PL_MATH_INCLUDE_FUNCTIONS
#include "pl_math.h"

// extensions
#include "pl_log_ext.h"
#include "pl_window_ext.h"
#include "pl_draw_ext.h"
#include "pl_shader_ext.h"
Expand Down Expand Up @@ -96,9 +95,6 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = pl_get_api_latest(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data(PL_LOG_CONTEXT_NAME));

// if "ptAppData" is a valid pointer, then this function is being called
// during a hot reload.
if(ptAppData)
Expand Down Expand Up @@ -471,11 +467,3 @@ pl_app_update(plAppData* ptAppData)
gptGfx->return_command_buffer(ptCommandBuffer);
gptProfile->end_frame();
}

//-----------------------------------------------------------------------------
// [SECTION] unity build
//-----------------------------------------------------------------------------

#define PL_LOG_IMPLEMENTATION
#include "pl_log.h"
#undef PL_LOG_IMPLEMENTATION
13 changes: 1 addition & 12 deletions examples/example_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Index of this file:
#include <stdio.h>
#include <string.h> // memset
#include "pl.h"
#include "pl_log.h"
#include "pl_ds.h"
#include "pl_memory.h"
#define PL_MATH_INCLUDE_FUNCTIONS
#include "pl_math.h"

// extensions
#include "pl_log_ext.h"
#include "pl_window_ext.h"
#include "pl_shader_ext.h"
#include "pl_draw_ext.h"
Expand Down Expand Up @@ -105,9 +105,6 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = pl_get_api_latest(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data(PL_LOG_CONTEXT_NAME));

// if "ptAppData" is a valid pointer, then this function is being called
// during a hot reload.
if(ptAppData)
Expand Down Expand Up @@ -1300,11 +1297,3 @@ pl_show_ui_demo_window(plAppData* ptAppData)
}
gptUi->end_window();
}

//-----------------------------------------------------------------------------
// [SECTION] unity build
//-----------------------------------------------------------------------------

#define PL_LOG_IMPLEMENTATION
#include "pl_log.h"
#undef PL_LOG_IMPLEMENTATION
13 changes: 1 addition & 12 deletions examples/example_4.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Index of this file:
#include <stdio.h>
#include <string.h> // memset
#include "pl.h"
#include "pl_log.h"
#include "pl_ds.h"
#include "pl_memory.h"
#define PL_MATH_INCLUDE_FUNCTIONS
#include "pl_math.h"

// extensions
#include "pl_log_ext.h"
#include "pl_window_ext.h"
#include "pl_graphics_ext.h"
#include "pl_shader_ext.h"
Expand Down Expand Up @@ -91,9 +91,6 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = pl_get_api_latest(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data(PL_LOG_CONTEXT_NAME));

// if "ptAppData" is a valid pointer, then this function is being called
// during a hot reload.
if(ptAppData)
Expand Down Expand Up @@ -436,11 +433,3 @@ pl_app_update(plAppData* ptAppData)
gptGfx->return_command_buffer(ptCommandBuffer);
gptProfile->end_frame();
}

//-----------------------------------------------------------------------------
// [SECTION] unity build
//-----------------------------------------------------------------------------

#define PL_LOG_IMPLEMENTATION
#include "pl_log.h"
#undef PL_LOG_IMPLEMENTATION
14 changes: 1 addition & 13 deletions examples/example_5.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Index of this file:
// [SECTION] pl_app_shutdown
// [SECTION] pl_app_resize
// [SECTION] pl_app_update
// [SECTION] unity build
*/

//-----------------------------------------------------------------------------
Expand All @@ -28,13 +27,13 @@ Index of this file:

#include <stdio.h>
#include "pl.h"
#include "pl_log.h"
#include "pl_ds.h"
#include "pl_memory.h"
#define PL_MATH_INCLUDE_FUNCTIONS
#include "pl_math.h"

// extensions
#include "pl_log_ext.h"
#include "pl_window_ext.h"
#include "pl_graphics_ext.h"
#include "pl_shader_ext.h"
Expand Down Expand Up @@ -93,9 +92,6 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = pl_get_api_latest(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data(PL_LOG_CONTEXT_NAME));

// if "ptAppData" is a valid pointer, then this function is being called
// during a hot reload.
if(ptAppData)
Expand Down Expand Up @@ -512,11 +508,3 @@ pl_app_update(plAppData* ptAppData)
gptGfx->return_command_buffer(ptCommandBuffer);
gptProfile->end_frame();
}

//-----------------------------------------------------------------------------
// [SECTION] unity build
//-----------------------------------------------------------------------------

#define PL_LOG_IMPLEMENTATION
#include "pl_log.h"
#undef PL_LOG_IMPLEMENTATION
13 changes: 1 addition & 12 deletions examples/example_6.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Index of this file:

#include <stdio.h>
#include "pl.h"
#include "pl_log.h"
#include "pl_ds.h"
#include "pl_memory.h"
#define PL_MATH_INCLUDE_FUNCTIONS
#include "pl_math.h"

// extensions
#include "pl_log_ext.h"
#include "pl_window_ext.h"
#include "pl_file_ext.h"
#include "pl_graphics_ext.h"
Expand Down Expand Up @@ -107,9 +107,6 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = pl_get_api_latest(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data(PL_LOG_CONTEXT_NAME));

// if "ptAppData" is a valid pointer, then this function is being called
// during a hot reload.
if(ptAppData)
Expand Down Expand Up @@ -675,11 +672,3 @@ pl_app_update(plAppData* ptAppData)
gptGfx->return_command_buffer(ptCommandBuffer);
gptProfile->end_frame();
}

//-----------------------------------------------------------------------------
// [SECTION] unity build
//-----------------------------------------------------------------------------

#define PL_LOG_IMPLEMENTATION
#include "pl_log.h"
#undef PL_LOG_IMPLEMENTATION
14 changes: 1 addition & 13 deletions examples/example_8.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Index of this file:
// [SECTION] pl_app_resize
// [SECTION] pl_app_update
// [SECTION] helper function definitions
// [SECTION] unity build
*/

//-----------------------------------------------------------------------------
Expand All @@ -27,13 +26,13 @@ Index of this file:

#include <stdio.h>
#include "pl.h"
#include "pl_log.h"
#include "pl_ds.h"
#include "pl_memory.h"
#define PL_MATH_INCLUDE_FUNCTIONS
#include "pl_math.h"

// extensions
#include "pl_log_ext.h"
#include "pl_window_ext.h"
#include "pl_graphics_ext.h"
#include "pl_draw_ext.h"
Expand Down Expand Up @@ -128,9 +127,6 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = pl_get_api_latest(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data(PL_LOG_CONTEXT_NAME));

// if "ptAppData" is a valid pointer, then this function is being called
// during a hot reload.
if(ptAppData)
Expand Down Expand Up @@ -669,11 +665,3 @@ camera_update(plCamera* ptCamera)
ptCamera->tProjMat.col[3].z = -ptCamera->fNearZ * ptCamera->fFarZ / (ptCamera->fFarZ - ptCamera->fNearZ);
ptCamera->tProjMat.col[3].w = 0.0f;
}

//-----------------------------------------------------------------------------
// [SECTION] unity build
//-----------------------------------------------------------------------------

#define PL_LOG_IMPLEMENTATION
#include "pl_log.h"
#undef PL_LOG_IMPLEMENTATION
14 changes: 1 addition & 13 deletions examples/example_9.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Index of this file:
// [SECTION] pl_app_resize
// [SECTION] pl_app_update
// [SECTION] helper function definitions
// [SECTION] unity build
*/

//-----------------------------------------------------------------------------
Expand All @@ -30,13 +29,13 @@ Index of this file:

#include <stdio.h>
#include "pl.h"
#include "pl_log.h"
#include "pl_ds.h"
#include "pl_memory.h"
#define PL_MATH_INCLUDE_FUNCTIONS
#include "pl_math.h"

// extensions
#include "pl_log_ext.h"
#include "pl_window_ext.h"
#include "pl_graphics_ext.h"
#include "pl_draw_ext.h"
Expand Down Expand Up @@ -145,9 +144,6 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = pl_get_api_latest(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data(PL_LOG_CONTEXT_NAME));

// if "ptAppData" is a valid pointer, then this function is being called
// during a hot reload.
if(ptAppData)
Expand Down Expand Up @@ -852,11 +848,3 @@ resize_offscreen_resources(plAppData* ptAppData)

gptGfx->update_render_pass_attachments(ptDevice, ptAppData->tOffscreenRenderPass, ptAppData->tOffscreenSize, atAttachmentSets);
}

//-----------------------------------------------------------------------------
// [SECTION] unity build
//-----------------------------------------------------------------------------

#define PL_LOG_IMPLEMENTATION
#include "pl_log.h"
#undef PL_LOG_IMPLEMENTATION
Loading

0 comments on commit cdb199b

Please sign in to comment.