Skip to content

Commit df8262d

Browse files
feat: improve windows api to remove experimental flags & add full screen support in experimental
Co-authored-by: Dan Wulczynski <dantheman.py@gmail.com>
1 parent 8f75af1 commit df8262d

19 files changed

Lines changed: 847 additions & 400 deletions

editor/editor.cpp

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
194194
gptWindows->create(tWindowDesc, &ptAppData->ptWindow);
195195
gptWindows->show(ptAppData->ptWindow);
196196

197+
plFullScreenDesc tFullScreen = {};
198+
tFullScreen.iMonitor = 1;
199+
tFullScreen.tMode = PL_FULLSCREEN_MODE_EXCLUSIVE;
200+
gptWindows->set_fullscreen(ptAppData->ptWindow, &tFullScreen);
201+
197202
plStarterInit tStarterInit = {};
198203
tStarterInit.tFlags = PL_STARTER_FLAGS_NONE;
199204
tStarterInit.ptWindow = ptAppData->ptWindow;
@@ -622,6 +627,41 @@ pl_app_update(plAppData* ptAppData)
622627
ImGui::EndMainMenuBar();
623628
}
624629

630+
// if(ImGui::Begin("Window testing", nullptr, ImGuiWindowFlags_None))
631+
// {
632+
// plWindowAttributeValue tValue = {};
633+
// if(ImGui::Button("Maximize")) gptWindows->set_attribute(ptAppData->ptWindow, PL_WINDOW_ATTRIBUTE_MAXIMIZED, &tValue);
634+
// if(ImGui::Button("Minimize"))
635+
// {
636+
// tValue.bValue = true;
637+
// gptWindows->set_attribute(ptAppData->ptWindow, PL_WINDOW_ATTRIBUTE_MINIMIZED, &tValue);
638+
// }
639+
// if(ImGui::Button("Restore"))
640+
// {
641+
// tValue.bValue = false;
642+
// gptWindows->set_attribute(ptAppData->ptWindow, PL_WINDOW_ATTRIBUTE_MINIMIZED, &tValue);
643+
// }
644+
// if(ImGui::Button("Hide"))
645+
// {
646+
// tValue.bValue = true;
647+
// gptWindows->set_attribute(ptAppData->ptWindow, PL_WINDOW_ATTRIBUTE_VISIBLE, &tValue);
648+
// }
649+
// if(ImGui::Button("Set Size"))
650+
// {
651+
// tValue.tuVec2.x = 500;
652+
// tValue.tuVec2.y = 500;
653+
// gptWindows->set_attribute(ptAppData->ptWindow, PL_WINDOW_ATTRIBUTE_SIZE, &tValue);
654+
// }
655+
// if(ImGui::Button("Full Screen"))
656+
// {
657+
// plFullScreenDesc tFullScreen = {};
658+
// tFullScreen.iMonitor = 1;
659+
// tFullScreen.tMode = PL_FULLSCREEN_MODE_EXCLUSIVE;
660+
// gptWindows->set_fullscreen(ptAppData->ptWindow, &tFullScreen);
661+
// }
662+
// }
663+
// ImGui::End();
664+
625665
// main "editor" debug window
626666
if(ptAppData->bShowPilotLightTool)
627667
pl__show_editor_window(ptAppData);

examples/build_linux.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ fi
948948
#~~~~~~~~~~~~~~~~~~~~~ example_basic_5 | debug_experimental ~~~~~~~~~~~~~~~~~~~~~
949949

950950
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
951-
PL_DEFINES="-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG -DPL_EXPERIMENTAL "
951+
PL_DEFINES="-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG "
952952
PL_INCLUDE_DIRECTORIES="-I../examples -I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/imgui "
953953
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/usr/lib/x86_64-linux-gnu "
954954
PL_COMPILER_FLAGS="-std=c++14 -fPIC --debug -g "
@@ -1021,7 +1021,7 @@ fi
10211021
#~~~~~~~~~~~~~~~~~~~~ example_basic_5 | release_experimental ~~~~~~~~~~~~~~~~~~~~
10221022

10231023
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
1024-
PL_DEFINES="-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG -DPL_EXPERIMENTAL "
1024+
PL_DEFINES="-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG "
10251025
PL_INCLUDE_DIRECTORIES="-I../examples -I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/imgui "
10261026
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L/usr/lib/x86_64-linux-gnu -Wl,-rpath,/usr/lib/x86_64-linux-gnu "
10271027
PL_COMPILER_FLAGS="-std=c++14 -fPIC "

examples/build_macos.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ fi
11291129
#~~~~~~~~~~~~~~~~~~~~~ example_basic_5 | debug_experimental ~~~~~~~~~~~~~~~~~~~~~
11301130

11311131
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
1132-
PL_DEFINES="-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG -DPL_EXPERIMENTAL "
1132+
PL_DEFINES="-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG "
11331133
PL_INCLUDE_DIRECTORIES="-I../examples -I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/imgui "
11341134
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L/usr/local/lib -Wl,-rpath,/usr/local/lib "
11351135
PL_COMPILER_FLAGS="-std=c++14 --debug -g -fmodules -ObjC++ -fPIC "
@@ -1211,7 +1211,7 @@ fi
12111211
#~~~~~~~~~~~~~~~~~~~~ example_basic_5 | release_experimental ~~~~~~~~~~~~~~~~~~~~
12121212

12131213
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
1214-
PL_DEFINES="-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG -DPL_EXPERIMENTAL "
1214+
PL_DEFINES="-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG "
12151215
PL_INCLUDE_DIRECTORIES="-I../examples -I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/imgui "
12161216
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L/usr/local/lib -Wl,-rpath,/usr/local/lib "
12171217
PL_COMPILER_FLAGS="-std=c++14 -fmodules -ObjC++ -fPIC "

examples/build_win32.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ goto ExitLabel
920920

921921
::~~~~~~~~~~~~~~~~~~~~~ example_basic_5 | debug_experimental ~~~~~~~~~~~~~~~~~~~~~
922922

923-
@set PL_DEFINES=-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG -DPL_EXPERIMENTAL
923+
@set PL_DEFINES=-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG
924924
@set PL_INCLUDE_DIRECTORIES=-I"../examples" -I"../editor" -I"../src" -I"../shaders" -I"../libs" -I"../extensions" -I"../out" -I"../dependencies/stb" -I"../dependencies/imgui"
925925
@set PL_LINK_DIRECTORIES=-LIBPATH:"../out"
926926
@set PL_COMPILER_FLAGS=-Zc:preprocessor -nologo -std:c++14 -W4 -WX -wd4201 -wd4100 -wd4996 -wd4505 -wd4189 -wd5105 -wd4115 -permissive- -Od -MDd -Zi
@@ -1000,7 +1000,7 @@ goto ExitLabel
10001000

10011001
::~~~~~~~~~~~~~~~~~~~~ example_basic_5 | release_experimental ~~~~~~~~~~~~~~~~~~~~
10021002

1003-
@set PL_DEFINES=-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG -DPL_EXPERIMENTAL
1003+
@set PL_DEFINES=-D_USE_MATH_DEFINES -DPL_PROFILING_ON -DPL_ALLOW_HOT_RELOAD -DPL_ENABLE_VALIDATION_LAYERS -DPL_CONFIG_DEBUG
10041004
@set PL_INCLUDE_DIRECTORIES=-I"../examples" -I"../editor" -I"../src" -I"../shaders" -I"../libs" -I"../extensions" -I"../out" -I"../dependencies/stb" -I"../dependencies/imgui"
10051005
@set PL_LINK_DIRECTORIES=-LIBPATH:"../out"
10061006
@set PL_COMPILER_FLAGS=-Zc:preprocessor -nologo -std:c++14 -W4 -WX -wd4201 -wd4100 -wd4996 -wd4505 -wd4189 -wd5105 -wd4115 -permissive- -O2 -MD

extensions/pl_renderer_terrain.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,6 @@ pl__render_chunk_shadow(plScene* ptScene, plTerrain* ptTerrain, plCamera* ptCame
10381038
if(!bChildrenResident || fRho <= tauSubdivide || ptChunk->uLevel < 3)
10391039
{
10401040
const plDrawIndex tDraw = {
1041-
.uInstanceCount = 1,
10421041
.uIndexCount = ptChunk->uIndexCount,
10431042
.uVertexStart = (uint32_t)(ptChunk->ptVertexHole->uOffset / sizeof(plTerrainVertex)),
10441043
.uIndexStart = (uint32_t)(ptChunk->ptIndexHole->uOffset / sizeof(uint32_t)),

scripts/gen_dev.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,6 @@ def add_app():
591591

592592
pl.add_source_files("../editor/editor.cpp")
593593
pl.set_output_binary("editor")
594-
pl.add_definitions("PL_EXPERIMENTAL")
595594

596595
# default config
597596
with pl.configuration("debug_experimental"):
@@ -663,7 +662,6 @@ def add_app():
663662

664663
pl.add_source_files("../extensions/pl_dear_imgui_ext.cpp")
665664
pl.set_output_binary("pl_dear_imgui_ext")
666-
pl.add_definitions("PL_EXPERIMENTAL")
667665

668666
with pl.configuration("debug_experimental"):
669667

scripts/gen_examples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124

125125
pl.add_source_files(name + ".cpp")
126126
pl.set_output_binary(name)
127-
pl.add_definitions("PL_EXPERIMENTAL")
128127

129128
with pl.configuration("debug_experimental"):
130129

scripts/setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"PL_METAL_BACKEND",
1818
"PL_TEST_IMPLEMENTATION",
1919
"PL_CONFIG_DEBUG",
20-
"PL_INCLUDE_SPIRV_CROSS",
21-
"PL_EXPERIMENTAL",
20+
"PL_INCLUDE_SPIRV_CROSS"
2221
]
2322

2423
includes = [

src/build_linux.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ fi
827827
#~~~~~~~~~~~~~~~~~~~~~~~~~ editor | debug_experimental ~~~~~~~~~~~~~~~~~~~~~~~~~~
828828

829829
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
830-
PL_DEFINES="-DPL_UNITY_BUILD -DPL_EXPERIMENTAL "
830+
PL_DEFINES="-DPL_UNITY_BUILD "
831831
PL_INCLUDE_DIRECTORIES="-I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/cgltf -I../dependencies/imgui -I../dependencies/glfw/include "
832832
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out "
833833
PL_COMPILER_FLAGS="-fPIC -std=c++14 --debug -g "
@@ -864,7 +864,7 @@ echo ${CYAN}~~~~~~~~~~~~~~~~~~~~~~${NC}
864864
if [ $PL_HOT_RELOAD_STATUS -ne 1 ]; then
865865

866866
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
867-
PL_DEFINES="-DPL_UNITY_BUILD -DPL_EXPERIMENTAL -DPL_VULKAN_BACKEND "
867+
PL_DEFINES="-DPL_UNITY_BUILD -DPL_VULKAN_BACKEND "
868868
PL_INCLUDE_DIRECTORIES="-I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/cgltf -I../dependencies/imgui -I../dependencies/glfw/include -I$VULKAN_SDK/include -I/usr/include/vulkan "
869869
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L$VULKAN_SDK/lib -Wl,-rpath,$VULKAN_SDK/lib "
870870
PL_COMPILER_FLAGS="-fPIC -std=c++14 --debug -g "
@@ -1268,7 +1268,7 @@ fi
12681268
#~~~~~~~~~~~~~~~~~~~~~~~~ editor | release_experimental ~~~~~~~~~~~~~~~~~~~~~~~~~
12691269

12701270
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
1271-
PL_DEFINES="-DPL_UNITY_BUILD -DPL_EXPERIMENTAL "
1271+
PL_DEFINES="-DPL_UNITY_BUILD "
12721272
PL_INCLUDE_DIRECTORIES="-I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/cgltf -I../dependencies/imgui -I../dependencies/glfw/include "
12731273
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out "
12741274
PL_COMPILER_FLAGS="-fPIC -std=c++14 "
@@ -1305,7 +1305,7 @@ echo ${CYAN}~~~~~~~~~~~~~~~~~~~~~~${NC}
13051305
if [ $PL_HOT_RELOAD_STATUS -ne 1 ]; then
13061306

13071307
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
1308-
PL_DEFINES="-DPL_UNITY_BUILD -DPL_EXPERIMENTAL -DPL_VULKAN_BACKEND "
1308+
PL_DEFINES="-DPL_UNITY_BUILD -DPL_VULKAN_BACKEND "
13091309
PL_INCLUDE_DIRECTORIES="-I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/cgltf -I../dependencies/imgui -I../dependencies/glfw/include -I$VULKAN_SDK/include -I/usr/include/vulkan "
13101310
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L$VULKAN_SDK/lib -Wl,-rpath,$VULKAN_SDK/lib "
13111311
PL_COMPILER_FLAGS="-fPIC -std=c++14 "

src/build_macos.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ fi
947947
#~~~~~~~~~~~~~~~~~~~~~~~~~ editor | debug_experimental ~~~~~~~~~~~~~~~~~~~~~~~~~~
948948

949949
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
950-
PL_DEFINES="-DPL_UNITY_BUILD -DPL_EXPERIMENTAL "
950+
PL_DEFINES="-DPL_UNITY_BUILD "
951951
PL_INCLUDE_DIRECTORIES="-I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/cgltf -I../dependencies/imgui -I../dependencies/glfw/include "
952952
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out "
953953
PL_COMPILER_FLAGS="-fPIC -ObjC++ --debug -g -std=c++14 "
@@ -992,7 +992,7 @@ echo ${CYAN}~~~~~~~~~~~~~~~~~~~~~~${NC}
992992
if [ $PL_HOT_RELOAD_STATUS -ne 1 ]; then
993993

994994
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
995-
PL_DEFINES="-DPL_UNITY_BUILD -DPL_EXPERIMENTAL -DPL_METAL_BACKEND "
995+
PL_DEFINES="-DPL_UNITY_BUILD -DPL_METAL_BACKEND "
996996
PL_INCLUDE_DIRECTORIES="-I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/cgltf -I../dependencies/imgui -I../dependencies/glfw/include "
997997
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out "
998998
PL_COMPILER_FLAGS="-fPIC -ObjC++ -std=c++14 --debug -g -Wno-nullability-completeness "
@@ -1448,7 +1448,7 @@ fi
14481448
#~~~~~~~~~~~~~~~~~~~~~~~~ editor | release_experimental ~~~~~~~~~~~~~~~~~~~~~~~~~
14491449

14501450
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
1451-
PL_DEFINES="-DPL_UNITY_BUILD -DPL_EXPERIMENTAL "
1451+
PL_DEFINES="-DPL_UNITY_BUILD "
14521452
PL_INCLUDE_DIRECTORIES="-I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/cgltf -I../dependencies/imgui -I../dependencies/glfw/include "
14531453
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out "
14541454
PL_COMPILER_FLAGS="-fPIC -ObjC++ -std=c++14 "
@@ -1493,7 +1493,7 @@ echo ${CYAN}~~~~~~~~~~~~~~~~~~~~~~${NC}
14931493
if [ $PL_HOT_RELOAD_STATUS -ne 1 ]; then
14941494

14951495
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
1496-
PL_DEFINES="-DPL_UNITY_BUILD -DPL_EXPERIMENTAL -DPL_METAL_BACKEND "
1496+
PL_DEFINES="-DPL_UNITY_BUILD -DPL_METAL_BACKEND "
14971497
PL_INCLUDE_DIRECTORIES="-I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/cgltf -I../dependencies/imgui -I../dependencies/glfw/include "
14981498
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out "
14991499
PL_COMPILER_FLAGS="-fPIC -ObjC++ -std=c++14 -Wno-nullability-completeness "
@@ -2219,7 +2219,7 @@ fi
22192219
#~~~~~~~~~~~~~~~~~~~~~~~~ editor | moltenvk_experimental ~~~~~~~~~~~~~~~~~~~~~~~~
22202220

22212221
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
2222-
PL_DEFINES="-DPL_UNITY_BUILD -DPL_EXPERIMENTAL "
2222+
PL_DEFINES="-DPL_UNITY_BUILD "
22232223
PL_INCLUDE_DIRECTORIES="-I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/cgltf -I../dependencies/imgui -I../dependencies/glfw/include "
22242224
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out -L/usr/local/lib -Wl,-rpath,/usr/local/lib "
22252225
PL_COMPILER_FLAGS="-fPIC -fmodules --debug -g -std=c++14 "
@@ -2264,7 +2264,7 @@ echo ${CYAN}~~~~~~~~~~~~~~~~~~~~~~${NC}
22642264
if [ $PL_HOT_RELOAD_STATUS -ne 1 ]; then
22652265

22662266
PL_RESULT=${BOLD}${GREEN}Successful.${NC}
2267-
PL_DEFINES="-DPL_UNITY_BUILD -DPL_EXPERIMENTAL -DPL_VULKAN_BACKEND "
2267+
PL_DEFINES="-DPL_UNITY_BUILD -DPL_VULKAN_BACKEND "
22682268
PL_INCLUDE_DIRECTORIES="-I../editor -I../src -I../shaders -I../libs -I../extensions -I../out -I../dependencies/stb -I../dependencies/cgltf -I../dependencies/imgui -I../dependencies/glfw/include "
22692269
PL_LINK_DIRECTORIES="-L../out -Wl,-rpath,../out "
22702270
PL_COMPILER_FLAGS="-fPIC -std=c++14 --debug -g "

0 commit comments

Comments
 (0)