Skip to content

Commit f2ea5e6

Browse files
hoffstadthoffstadt-nasa
authored andcommitted
WIP
Update pl_graphics_ext.h
1 parent b0d8985 commit f2ea5e6

114 files changed

Lines changed: 5128 additions & 3252 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/backend_linux.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def generate_build(name, user_options = None):
278278

279279
helper.add_raw('PL_STATIC_LINK_LIBRARIES="')
280280
for link in settings.static_link_libraries:
281-
helper.add_raw('-l:' + link + '.a ')
281+
helper.add_raw('-l' + link + ' ')
282282
helper.add_raw('"\n')
283283

284284
helper.add_raw('PL_DYNAMIC_LINK_LIBRARIES="')
@@ -328,7 +328,7 @@ def generate_build(name, user_options = None):
328328
helper.print_line('${YELLOW}Step: ' + settings.target_name +'${NC}')
329329
helper.print_line('${YELLOW}~~~~~~~~~~~~~~~~~~~${NC}')
330330
helper.print_line('${CYAN}Compiling and Linking...${NC}')
331-
helper.add_line('gcc -shared $PL_SOURCES $PL_INCLUDE_DIRECTORIES $PL_DEFINES $PL_COMPILER_FLAGS $PL_INCLUDE_DIRECTORIES $PL_LINK_DIRECTORIES $PL_STATIC_LINK_LIBRARIES $PL_DYNAMIC_LINK_LIBRARIES $PL_LINKER_FLAGS -o "./' + settings.output_directory + '/' + settings.output_binary + settings.output_binary_extension +'"')
331+
helper.add_line('gcc -shared $PL_SOURCES $PL_INCLUDE_DIRECTORIES $PL_DEFINES $PL_COMPILER_FLAGS $PL_INCLUDE_DIRECTORIES $PL_LINK_DIRECTORIES $PL_STATIC_LINK_LIBRARIES $PL_DYNAMIC_LINK_LIBRARIES $PL_LINKER_FLAGS -o "./' + settings.output_directory + '/lib' + settings.output_binary + settings.output_binary_extension +'"')
332332
helper.add_spacing()
333333

334334
# check build status
@@ -374,7 +374,7 @@ def generate_build(name, user_options = None):
374374
if settings.target_type == pl.TargetType.STATIC_LIBRARY:
375375
helper.add_spacing()
376376
helper.add_comment('combine object files into a static lib')
377-
helper.add_line('ar rcs ./' + settings.output_directory + '/' + settings.output_binary + '.a ./' + settings.output_directory + '/*.o')
377+
helper.add_line('ar rcs ./' + settings.output_directory + '/lib' + settings.output_binary + '.a ./' + settings.output_directory + '/*.o')
378378
helper.add_line('rm ./' + settings.output_directory + '/*.o')
379379
helper.add_spacing()
380380
helper.add_spacing()

build/backend_macos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def generate_build(name, user_options = None):
342342
helper.print_line('${YELLOW}Step: ' + settings.target_name +'${NC}')
343343
helper.print_line('${YELLOW}~~~~~~~~~~~~~~~~~~~${NC}')
344344
helper.print_line('${CYAN}Compiling and Linking...${NC}')
345-
helper.add_line('clang -shared $PL_SOURCES $PL_INCLUDE_DIRECTORIES $PL_DEFINES $PL_COMPILER_FLAGS $PL_INCLUDE_DIRECTORIES $PL_LINK_DIRECTORIES $PL_STATIC_LINK_LIBRARIES $PL_DYNAMIC_LINK_LIBRARIES $PL_LINK_FRAMEWORKS $PL_LINKER_FLAGS -o "./' + settings.output_directory + '/' + settings.output_binary + settings.output_binary_extension +'"')
345+
helper.add_line('clang -shared $PL_SOURCES $PL_INCLUDE_DIRECTORIES $PL_DEFINES $PL_COMPILER_FLAGS $PL_INCLUDE_DIRECTORIES $PL_LINK_DIRECTORIES $PL_STATIC_LINK_LIBRARIES $PL_DYNAMIC_LINK_LIBRARIES $PL_LINK_FRAMEWORKS $PL_LINKER_FLAGS -o "./' + settings.output_directory + '/lib' + settings.output_binary + settings.output_binary_extension +'"')
346346
helper.add_spacing()
347347

348348
# check build status

build/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# [SECTION] version
1515
#-----------------------------------------------------------------------------
1616

17-
__version__ = "1.4.0"
17+
__version__ = "1.4.1"
1818

1919
#-----------------------------------------------------------------------------
2020
# [SECTION] imports

build/deploy_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from codecs import open
33
import os
44

5-
wip_version = "1.4.0"
5+
wip_version = "1.4.1"
66

77
def version_number():
88
"""This function reads the version number which is populated by github actions"""

editor/app.c

Lines changed: 337 additions & 406 deletions
Large diffs are not rendered by default.

editor/editor.cpp

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Index of this file:
2424

2525
#include "editor.h"
2626

27+
PL_API void pl_load_ext(plApiRegistryI* ptApiRegistry, bool bReload);
28+
PL_API void pl_unload_ext(plApiRegistryI* ptApiRegistry, bool bReload);
29+
2730
//-----------------------------------------------------------------------------
2831
// [SECTION] pl_app_load
2932
//-----------------------------------------------------------------------------
@@ -104,9 +107,10 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
104107
const plExtensionRegistryI* ptExtensionRegistry = pl_get_api_latest(ptApiRegistry, plExtensionRegistryI);
105108

106109
// load extensions
107-
ptExtensionRegistry->load("pl_unity_ext", nullptr, nullptr, true);
108-
ptExtensionRegistry->load("pl_platform_ext", "pl_load_platform_ext", "pl_unload_platform_ext", false);
109-
ptExtensionRegistry->load("pl_dear_imgui_ext", "pl_load_dear_imgui_ext", "pl_unload_dear_imgui_ext", false);
110+
pl_load_ext(ptApiRegistry, false);
111+
pl_load_platform_ext(ptApiRegistry, false);
112+
pl_load_dear_imgui_ext(ptApiRegistry, false);
113+
// ptExtensionRegistry->load("pl_dear_imgui_ext", "pl_load_dear_imgui_ext", "pl_unload_dear_imgui_ext", false);
110114

111115
// load apis
112116
gptWindows = pl_get_api_latest(ptApiRegistry, plWindowI);
@@ -194,10 +198,10 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
194198
gptWindows->create(tWindowDesc, &ptAppData->ptWindow);
195199
gptWindows->show(ptAppData->ptWindow);
196200

197-
plFullScreenDesc tFullScreen = {};
198-
tFullScreen.iMonitor = 1;
199-
tFullScreen.tMode = PL_FULLSCREEN_MODE_EXCLUSIVE;
200-
gptWindows->set_fullscreen(ptAppData->ptWindow, &tFullScreen);
201+
// plFullScreenDesc tFullScreen = {};
202+
// tFullScreen.iMonitor = 1;
203+
// tFullScreen.tMode = PL_FULLSCREEN_MODE_EXCLUSIVE;
204+
// gptWindows->set_fullscreen(ptAppData->ptWindow, &tFullScreen);
201205

202206
plStarterInit tStarterInit = {};
203207
tStarterInit.tFlags = PL_STARTER_FLAGS_NONE;
@@ -317,7 +321,7 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
317321

318322
pl__find_models(ptAppData);
319323

320-
gptDearImGui->initialize(ptAppData->ptDevice, gptStarter->get_swapchain(), gptStarter->get_render_pass());
324+
pl_dear_imgui_initialize(ptAppData->ptDevice, gptStarter->get_swapchain(), gptStarter->get_render_pass());
321325
// ImGui::GetIO().ConfigFlags &= ~ImGuiBackendFlags_PlatformHasViewports;
322326
ImPlot::SetCurrentContext((ImPlotContext*)ptDataRegistry->get_data("implot"));
323327
ImGuiIO& tImGuiIO = ImGui::GetIO();
@@ -342,9 +346,9 @@ pl_app_shutdown(plAppData* ptAppData)
342346
pl_sb_free(ptAppData->sbcTempBuffer);
343347

344348
// ensure GPU is finished before cleanup
345-
gptGfx->flush_device(ptAppData->ptDevice);
349+
pl_graphics_flush_device(ptAppData->ptDevice);
346350

347-
gptDearImGui->cleanup();
351+
pl_dear_imgui_cleanup();
348352

349353
gptConfig->set_bool("bShowEntityWindow", ptAppData->bShowEntityWindow);
350354
gptConfig->set_bool("bPhysicsDebugDraw", ptAppData->bPhysicsDebugDraw);
@@ -406,7 +410,7 @@ pl_app_update(plAppData* ptAppData)
406410

407411
gptRenderer->begin_frame();
408412

409-
gptDearImGui->new_frame(ptAppData->ptDevice, gptStarter->get_render_pass());
413+
pl_dear_imgui_new_frame(ptAppData->ptDevice, gptStarter->get_render_pass());
410414

411415
if(ptAppData->bResize)
412416
{
@@ -489,7 +493,7 @@ pl_app_update(plAppData* ptAppData)
489493

490494
if(ptAppData->bShowEntityWindow)
491495
{
492-
if(gptEcsTools->show_ecs_window(ptAppData->ptCompLibrary, &ptAppData->tSelectedEntity, ptAppData->ptScene, &ptAppData->bShowEntityWindow))
496+
if(gptEcsTools->show_window(ptAppData->ptCompLibrary, &ptAppData->tSelectedEntity, ptAppData->ptScene, &ptAppData->bShowEntityWindow))
493497
{
494498
if(ptAppData->tSelectedEntity.uData == UINT64_MAX)
495499
{
@@ -713,7 +717,7 @@ pl_app_update(plAppData* ptAppData)
713717

714718
plVec2 tUV = {};
715719
plBindGroupHandle tTextureHandle = gptRenderer->get_view_texture(ptAppData->ptView, &tUV);
716-
ImTextureRef tTexture = ImTextureRef(gptDearImGui->get_texture_id_from_bindgroup(ptAppData->ptDevice, tTextureHandle));
720+
ImTextureRef tTexture = ImTextureRef(pl_dear_imgui_get_texture_id_from_bindgroup(ptAppData->ptDevice, tTextureHandle));
717721
ImGui::Image(tTexture, tContextSize, ImVec2(0, 0), ImVec2(tUV.x, tUV.y));
718722

719723
}
@@ -730,7 +734,7 @@ pl_app_update(plAppData* ptAppData)
730734
ImVec2 tContextSize = ImGui::GetContentRegionAvail();
731735
gptCamera->set_aspect((plCamera*)gptEcs->get_component(ptAppData->ptCompLibrary, gptCamera->get_ecs_type_key(), ptAppData->tSecondaryCamera), tContextSize.x / tContextSize.y);
732736

733-
ImTextureRef tTexture = ImTextureRef(gptDearImGui->get_texture_id_from_bindgroup(ptAppData->ptDevice, tTextureHandle));
737+
ImTextureRef tTexture = ImTextureRef(pl_dear_imgui_get_texture_id_from_bindgroup(ptAppData->ptDevice, tTextureHandle));
734738
ImGui::Image(tTexture, tContextSize, ImVec2(0, 0), ImVec2(tUV.x, tUV.y));
735739
}
736740
ImGui::End();
@@ -743,12 +747,12 @@ pl_app_update(plAppData* ptAppData)
743747
ImGui::ShowDemoWindow(&ptAppData->bShowImGuiDemo);
744748

745749
plRenderEncoder* ptRenderEncoder = gptStarter->begin_main_pass();
746-
gptDearImGui->render(ptRenderEncoder, gptGfx->get_encoder_command_buffer(ptRenderEncoder));
750+
pl_dear_imgui_render(ptRenderEncoder, pl_graphics_get_encoder_command_buffer(ptRenderEncoder));
747751

748752
float fWidth = ptIO->tMainViewportSize.x;
749753
float fHeight = ptIO->tMainViewportSize.y;
750754
plDrawList2D* ptMessageDrawlist = gptScreenLog->get_drawlist(tLogOffset.x, tLogOffset.y, fWidth * 0.2f, fHeight);
751-
gptDraw->submit_2d_drawlist(ptMessageDrawlist, ptRenderEncoder, fWidth, fHeight, gptGfx->get_swapchain_info(gptStarter->get_swapchain()).tSampleCount);
755+
gptDraw->submit_2d_drawlist(ptMessageDrawlist, ptRenderEncoder, fWidth, fHeight, pl_graphics_get_swapchain_info(gptStarter->get_swapchain()).tSampleCount);
752756
gptStarter->end_main_pass();
753757
pl_end_cpu_sample(gptProfile, 0);
754758
gptStarter->end_frame();
@@ -952,7 +956,7 @@ pl__show_editor_window(plAppData* ptAppData)
952956
if(ImGui::CollapsingHeader(ICON_FA_CIRCLE_INFO " Information"))
953957
{
954958
ImGui::Text("Pilot Light %s", PILOT_LIGHT_VERSION_STRING);
955-
ImGui::Text("Graphics Backend: %s", gptGfx->get_backend_string());
959+
ImGui::Text("Graphics Backend: %s", pl_graphics_get_backend_string());
956960
if(ImGui::Button("Show Camera Controls"))
957961
{
958962
const char* acMouseInfo = "Camera Controls\n"
@@ -1277,7 +1281,8 @@ pl__show_editor_window(plAppData* ptAppData)
12771281

12781282
if(ImGui::CollapsingHeader(ICON_FA_BOXES_STACKED " Physics", 0))
12791283
{
1280-
plPhysicsEngineSettings tPhysicsSettings = gptPhysics->get_settings();
1284+
plPhysicsEngineSettings tPhysicsSettings = {};
1285+
gptPhysics->get_settings(&tPhysicsSettings);
12811286

12821287
ImGui::Checkbox("Enabled", &tPhysicsSettings.bEnabled);
12831288
ImGui::Checkbox("Debug Draw", &ptAppData->bPhysicsDebugDraw);

editor/editor.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ Index of this file:
4040
#include "pl_profile_ext.h"
4141
#include "pl_log_ext.h"
4242
#include "pl_stats_ext.h"
43+
4344
#include "pl_graphics_ext.h"
45+
#include "pl_vfs_ext.h"
46+
#include "pl_datetime_ext.h"
47+
#include "pl_physics_ext.h"
48+
4449
#include "pl_tools_ext.h"
4550
#include "pl_job_ext.h"
4651
#include "pl_draw_ext.h"
@@ -51,10 +56,8 @@ Index of this file:
5156
#include "pl_console_ext.h"
5257
#include "pl_screen_log_ext.h"
5358
#include "pl_starter_ext.h"
54-
#include "pl_vfs_ext.h"
5559
#include "pl_compress_ext.h"
5660
#include "pl_pak_ext.h"
57-
#include "pl_datetime_ext.h"
5861

5962
// unstable extensions
6063
#include "pl_ecs_ext.h"
@@ -67,7 +70,7 @@ Index of this file:
6770
#include "pl_renderer_ext.h"
6871
#include "pl_ecs_tools_ext.h"
6972
#include "pl_gizmo_ext.h"
70-
#include "pl_physics_ext.h"
73+
7174
#include "pl_collision_ext.h"
7275
#include "pl_bvh_ext.h"
7376
#include "pl_shader_variant_ext.h"
@@ -82,6 +85,8 @@ Index of this file:
8285
#include "imgui.h"
8386
#include "implot.h"
8487

88+
89+
8590
//-----------------------------------------------------------------------------
8691
// [SECTION] global apis
8792
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)