Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Nov 13, 2024
1 parent 334434c commit b0617af
Show file tree
Hide file tree
Showing 51 changed files with 511 additions and 619 deletions.
4 changes: 2 additions & 2 deletions examples/example_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ pl_app_load(plApiRegistryI* ptApiRegistry, void* pAppData)

// retrieve the data registry API, this is the API used for sharing data
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
const plDataRegistryI* ptDataRegistry = pl_get_api(ptApiRegistry, plDataRegistryI);

// retrieve the IO API required to use plIO for "talking" with runtime)
gptIO = ptApiRegistry->first(PL_API_IO);
gptIO = pl_get_api(ptApiRegistry, plIOI);

// return optional application memory
return NULL;
Expand Down
6 changes: 3 additions & 3 deletions examples/example_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// retrieve the data registry API, this is the API used for sharing data
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
const plDataRegistryI* ptDataRegistry = pl_get_api(ptApiRegistry, plDataRegistryI);

// load required apis (NULL if not available)
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);

// if "ptAppData" is a valid pointer, then this function is being called
// during a hot reload.
Expand Down
28 changes: 14 additions & 14 deletions examples/example_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// retrieve the data registry API, this is the API used for sharing data
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
const plDataRegistryI* ptDataRegistry = pl_get_api(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data("log"));
Expand All @@ -106,12 +106,12 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// re-retrieve the apis since we are now in
// a different dll/so
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptDraw = ptApiRegistry->first(PL_API_DRAW);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptDrawBackend = ptApiRegistry->first(PL_API_DRAW_BACKEND);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptDraw = pl_get_api(ptApiRegistry, plDrawI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);
gptDrawBackend = pl_get_api(ptApiRegistry, plDrawBackendI);

return ptAppData;
}
Expand All @@ -122,18 +122,18 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
memset(ptAppData, 0, sizeof(plAppData));

// retrieve extension registry
const plExtensionRegistryI* ptExtensionRegistry = ptApiRegistry->first(PL_API_EXTENSION_REGISTRY);
const plExtensionRegistryI* ptExtensionRegistry = pl_get_api(ptApiRegistry, plExtensionRegistryI);

// load extensions
ptExtensionRegistry->load("pilot_light", NULL, NULL, true);

// load required apis (NULL if not available)
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptDraw = ptApiRegistry->first(PL_API_DRAW);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptDrawBackend = ptApiRegistry->first(PL_API_DRAW_BACKEND);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptDraw = pl_get_api(ptApiRegistry, plDrawI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);
gptDrawBackend = pl_get_api(ptApiRegistry, plDrawBackendI);

// initialize shader compiler
static const plShaderOptions tDefaultShaderOptions = {
Expand Down
30 changes: 14 additions & 16 deletions examples/example_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// retrieve the data registry API, this is the API used for sharing data
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
const plDataRegistryI* ptDataRegistry = pl_get_api(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data("log"));
Expand All @@ -107,13 +107,12 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// re-retrieve the apis since we are now in
// a different dll/so
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptDraw = ptApiRegistry->first(PL_API_DRAW);
gptUi = ptApiRegistry->first(PL_API_UI);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptDrawBackend = ptApiRegistry->first(PL_API_DRAW_BACKEND);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptDraw = pl_get_api(ptApiRegistry, plDrawI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);
gptDrawBackend = pl_get_api(ptApiRegistry, plDrawBackendI);

return ptAppData;
}
Expand All @@ -124,19 +123,18 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
memset(ptAppData, 0, sizeof(plAppData));

// retrieve extension registry
const plExtensionRegistryI* ptExtensionRegistry = ptApiRegistry->first(PL_API_EXTENSION_REGISTRY);
const plExtensionRegistryI* ptExtensionRegistry = pl_get_api(ptApiRegistry, plExtensionRegistryI);

// load extensions
ptExtensionRegistry->load("pilot_light", NULL, NULL, true);

// load required apis (NULL if not available)
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptDraw = ptApiRegistry->first(PL_API_DRAW);
gptUi = ptApiRegistry->first(PL_API_UI);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptDrawBackend = ptApiRegistry->first(PL_API_DRAW_BACKEND);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptDraw = pl_get_api(ptApiRegistry, plDrawI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);
gptDrawBackend = pl_get_api(ptApiRegistry, plDrawBackendI);

// initialize shader compiler
static const plShaderOptions tDefaultShaderOptions = {
Expand Down
20 changes: 10 additions & 10 deletions examples/example_4.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// retrieve the data registry API, this is the API used for sharing data
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
const plDataRegistryI* ptDataRegistry = pl_get_api(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data("log"));
Expand All @@ -100,10 +100,10 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
{
// re-retrieve the apis since we are now in
// a different dll/so
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);

return ptAppData;
}
Expand All @@ -114,16 +114,16 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
memset(ptAppData, 0, sizeof(plAppData));

// retrieve extension registry
const plExtensionRegistryI* ptExtensionRegistry = ptApiRegistry->first(PL_API_EXTENSION_REGISTRY);
const plExtensionRegistryI* ptExtensionRegistry = pl_get_api(ptApiRegistry, plExtensionRegistryI);

// load extensions
ptExtensionRegistry->load("pilot_light", NULL, NULL, true);

// load required apis (NULL if not available)
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);

// use window API to create a window
const plWindowDesc tWindowDesc = {
Expand Down
20 changes: 10 additions & 10 deletions examples/example_5.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// retrieve the data registry API, this is the API used for sharing data
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
const plDataRegistryI* ptDataRegistry = pl_get_api(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data("log"));
Expand All @@ -102,10 +102,10 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
{
// re-retrieve the apis since we are now in
// a different dll/so
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);

return ptAppData;
}
Expand All @@ -116,16 +116,16 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
memset(ptAppData, 0, sizeof(plAppData));

// retrieve extension registry
const plExtensionRegistryI* ptExtensionRegistry = ptApiRegistry->first(PL_API_EXTENSION_REGISTRY);
const plExtensionRegistryI* ptExtensionRegistry = pl_get_api(ptApiRegistry, plExtensionRegistryI);

// load extensions
ptExtensionRegistry->load("pilot_light", NULL, NULL, true);

// load required apis (NULL if not available)
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);

// use window API to create a window
const plWindowDesc tWindowDesc = {
Expand Down
24 changes: 12 additions & 12 deletions examples/example_6.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// retrieve the data registry API, this is the API used for sharing data
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
const plDataRegistryI* ptDataRegistry = pl_get_api(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data("log"));
Expand All @@ -114,11 +114,11 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
{
// re-retrieve the apis since we are now in
// a different dll/so
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptImage = ptApiRegistry->first(PL_API_IMAGE);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);
gptImage = pl_get_api(ptApiRegistry, plImageI);

return ptAppData;
}
Expand All @@ -129,17 +129,17 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
memset(ptAppData, 0, sizeof(plAppData));

// retrieve extension registry
const plExtensionRegistryI* ptExtensionRegistry = ptApiRegistry->first(PL_API_EXTENSION_REGISTRY);
const plExtensionRegistryI* ptExtensionRegistry = pl_get_api(ptApiRegistry, plExtensionRegistryI);

// load extensions
ptExtensionRegistry->load("pilot_light", NULL, NULL, true);

// load required apis (NULL if not available)
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptImage = ptApiRegistry->first(PL_API_IMAGE);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);
gptImage = pl_get_api(ptApiRegistry, plImageI);

// use window API to create a window
const plWindowDesc tWindowDesc = {
Expand Down
28 changes: 14 additions & 14 deletions examples/example_8.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// retrieve the data registry API, this is the API used for sharing data
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
const plDataRegistryI* ptDataRegistry = pl_get_api(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data("log"));
Expand All @@ -137,12 +137,12 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
{
// re-retrieve the apis since we are now in
// a different dll/so
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptDraw = ptApiRegistry->first(PL_API_DRAW);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptDrawBackend = ptApiRegistry->first(PL_API_DRAW_BACKEND);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptDraw = pl_get_api(ptApiRegistry, plDrawI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);
gptDrawBackend = pl_get_api(ptApiRegistry, plDrawBackendI);

return ptAppData;
}
Expand All @@ -153,18 +153,18 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
memset(ptAppData, 0, sizeof(plAppData));

// retrieve extension registry
const plExtensionRegistryI* ptExtensionRegistry = ptApiRegistry->first(PL_API_EXTENSION_REGISTRY);
const plExtensionRegistryI* ptExtensionRegistry = pl_get_api(ptApiRegistry, plExtensionRegistryI);

// load extensions (makes their APIs available)
ptExtensionRegistry->load("pilot_light", NULL, NULL, true);

// load required apis (NULL if not available)
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptDraw = ptApiRegistry->first(PL_API_DRAW);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptDrawBackend = ptApiRegistry->first(PL_API_DRAW_BACKEND);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptDraw = pl_get_api(ptApiRegistry, plDrawI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);
gptDrawBackend = pl_get_api(ptApiRegistry, plDrawBackendI);

// use window API to create a window
const plWindowDesc tWindowDesc = {
Expand Down
28 changes: 14 additions & 14 deletions examples/example_9.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)

// retrieve the data registry API, this is the API used for sharing data
// between extensions & the runtime
const plDataRegistryI* ptDataRegistry = ptApiRegistry->first(PL_API_DATA_REGISTRY);
const plDataRegistryI* ptDataRegistry = pl_get_api(ptApiRegistry, plDataRegistryI);

// set log & profile contexts
pl_set_log_context(ptDataRegistry->get_data("log"));
Expand All @@ -154,12 +154,12 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
{
// re-retrieve the apis since we are now in
// a different dll/so
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptDraw = ptApiRegistry->first(PL_API_DRAW);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptDrawBackend = ptApiRegistry->first(PL_API_DRAW_BACKEND);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptDraw = pl_get_api(ptApiRegistry, plDrawI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);
gptDrawBackend = pl_get_api(ptApiRegistry, plDrawBackendI);

return ptAppData;
}
Expand All @@ -170,18 +170,18 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
memset(ptAppData, 0, sizeof(plAppData));

// retrieve extension registry
const plExtensionRegistryI* ptExtensionRegistry = ptApiRegistry->first(PL_API_EXTENSION_REGISTRY);
const plExtensionRegistryI* ptExtensionRegistry = pl_get_api(ptApiRegistry, plExtensionRegistryI);

// load extensions (makes their APIs available)
ptExtensionRegistry->load("pilot_light", NULL, NULL, true);

// load required apis (NULL if not available)
gptIO = ptApiRegistry->first(PL_API_IO);
gptWindows = ptApiRegistry->first(PL_API_WINDOW);
gptGfx = ptApiRegistry->first(PL_API_GRAPHICS);
gptDraw = ptApiRegistry->first(PL_API_DRAW);
gptShader = ptApiRegistry->first(PL_API_SHADER);
gptDrawBackend = ptApiRegistry->first(PL_API_DRAW_BACKEND);
gptIO = pl_get_api(ptApiRegistry, plIOI);
gptWindows = pl_get_api(ptApiRegistry, plWindowI);
gptGfx = pl_get_api(ptApiRegistry, plGraphicsI);
gptDraw = pl_get_api(ptApiRegistry, plDrawI);
gptShader = pl_get_api(ptApiRegistry, plShaderI);
gptDrawBackend = pl_get_api(ptApiRegistry, plDrawBackendI);

// use window API to create a window
const plWindowDesc tWindowDesc = {
Expand Down
Loading

0 comments on commit b0617af

Please sign in to comment.