Skip to content

Commit

Permalink
feat: render api extensions can now be defined in "cfg/render_api.udm"
Browse files Browse the repository at this point in the history
  • Loading branch information
Silverlan committed Nov 11, 2024
1 parent 4e5e352 commit 14928de
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build_scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ def execbuildscript(filepath):
if with_essential_client_modules:
add_pragma_module(
name="pr_prosper_vulkan",
commitSha="9a7475a881d006e421f4c729f7009c140a5e5866",
commitSha="9071ef182a9286369922fab76232267208027a93",
repositoryUrl="https://github.com/Silverlan/pr_prosper_vulkan.git"
)

Expand Down
2 changes: 1 addition & 1 deletion build_scripts/scripts/external_libs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
get_submodule("mathutil","https://github.com/Silverlan/mathutil.git","d4025469e9cf2a05a6ef27793b1047308e4b105e")
get_submodule("networkmanager","https://github.com/Silverlan/networkmanager.git","981bc5809c1a768267ddace778205e1be0262730")
get_submodule("panima","https://github.com/Silverlan/panima.git","06916dd30cde319f31b1eee25cfed7dea8f14630")
get_submodule("prosper","https://github.com/Silverlan/prosper.git","e2ccfe966cdd28a57069384471e3f0dbb8f277a2")
get_submodule("prosper","https://github.com/Silverlan/prosper.git","0e1415ded54800e826c78341a62c555ef53692c2")
get_submodule("sharedutils","https://github.com/Silverlan/sharedutils.git","3d466de081fd77ee8af172422e2aa0b44a608788")
get_submodule("util_bsp","https://github.com/Silverlan/util_bsp.git","2d912cceaaa59199a86431aa9d194e922b2ebea4")
get_submodule("util_formatted_text","https://github.com/Silverlan/util_formatted_text.git","c473a2bdc1ad84ef52d391226d6983ef3076958e")
Expand Down
2 changes: 1 addition & 1 deletion build_scripts/scripts/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
get_submodule("pr_audio_dummy","https://github.com/Silverlan/pr_audio_dummy.git","1a806a1a7b2283bd8551d07e4f1d680499f68b90")
get_submodule("pr_curl","https://github.com/Silverlan/pr_curl.git","974c67cc76710809a9595fcfbc4167554799cd7f")
get_submodule("pr_prosper_opengl","https://github.com/Silverlan/pr_prosper_opengl.git","d73bf6dea11b1a79d5dc4715e224aa4cb15d0d48")
get_submodule("pr_prosper_vulkan","https://github.com/Silverlan/pr_prosper_vulkan.git","9a7475a881d006e421f4c729f7009c140a5e5866")
get_submodule("pr_prosper_vulkan","https://github.com/Silverlan/pr_prosper_vulkan.git","9071ef182a9286369922fab76232267208027a93")

os.chdir(curDir)
17 changes: 17 additions & 0 deletions core/client/src/c_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,23 @@ bool CEngine::Initialize(int argc, char *argv[])
contextCreateInfo.width = 1280;
contextCreateInfo.height = 1024;
contextCreateInfo.windowless = g_windowless;

auto renderApiData = udm::Data::Load("cfg/render_api.udm");
if(renderApiData) {
auto &renderAPI = GetRenderAPI();
auto data = renderApiData->GetAssetData().GetData();
for(auto &pair : data["all"]["extensions"].ElIt()) {
auto availability = prosper::IPrContext::ExtensionAvailability::EnableIfAvailable;
udm::to_enum_value<prosper::IPrContext::ExtensionAvailability>(pair.property, availability);
contextCreateInfo.extensions[std::string {pair.key}] = availability;
}
for(auto &pair : data[renderAPI]["extensions"].ElIt()) {
auto availability = prosper::IPrContext::ExtensionAvailability::EnableIfAvailable;
udm::to_enum_value<prosper::IPrContext::ExtensionAvailability>(pair.property, availability);
contextCreateInfo.extensions[std::string {pair.key}] = availability;
}
}

if(windowRes) {
std::vector<std::string> vals;
ustring::explode(*windowRes, "x", vals);
Expand Down

0 comments on commit 14928de

Please sign in to comment.