From e73e00a639ec1d4345fcd088c4d1855d11de7f06 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Sun, 25 Oct 2026 15:58:13 +1100 Subject: [PATCH 1/5] VS: -DOF_USE_GLON12=1 also sets the OF_USE_GLON12 MSBuild property (openFrameworksCommon.props copies the GLon12 DLLs next to the exe); GLon12 renderer option for vs (angle / dawn only for Apple targets); CI check; bump version --- commandLine/src/defines.h | 2 +- .../src/projects/visualStudioProject.cpp | 19 +++++++++++++++++++ .../src/projects/visualStudioProject.h | 3 +++ frontend/app.js | 18 +++++++++++++----- frontend/index.html | 5 +++-- scripts/vs/test_cmdline.sh | 11 +++++++++++ 6 files changed, 50 insertions(+), 8 deletions(-) diff --git a/commandLine/src/defines.h b/commandLine/src/defines.h index 9fd8efddc..3265db2ea 100644 --- a/commandLine/src/defines.h +++ b/commandLine/src/defines.h @@ -1,5 +1,5 @@ #define OFPROJECTGENERATOR_MAJOR_VERSION "0" -#define OFPROJECTGENERATOR_MINOR_VERSION "113" +#define OFPROJECTGENERATOR_MINOR_VERSION "114" #define OFPROJECTGENERATOR_PATCH_VERSION "0" #define PG_VERSION (OFPROJECTGENERATOR_MAJOR_VERSION "." OFPROJECTGENERATOR_MINOR_VERSION "." OFPROJECTGENERATOR_PATCH_VERSION) diff --git a/commandLine/src/projects/visualStudioProject.cpp b/commandLine/src/projects/visualStudioProject.cpp index 4c8de18c2..f67e4e067 100644 --- a/commandLine/src/projects/visualStudioProject.cpp +++ b/commandLine/src/projects/visualStudioProject.cpp @@ -629,6 +629,25 @@ void visualStudioProject::addDefine(const string& define, LibType libType) { // } } +// OF_USE_GLON12[=1] -> 1 in the Globals PropertyGroup +void visualStudioProject::addPropertyDefine(const string & define) { + static const std::set properties { "OF_USE_GLON12" }; + auto eq = define.find('='); + string name = ofTrim(define.substr(0, eq)); + if (!properties.count(name)) return; + string value = eq == string::npos ? "1" : ofTrim(define.substr(eq + 1)); + + pugi::xml_node globals = doc.select_node("//PropertyGroup[@Label='Globals']").node(); + if (!globals) { + ofLogWarning(LOG_NAME) << "no Globals PropertyGroup, not setting " << name; + return; + } + pugi::xml_node node = globals.child(name.c_str()); + if (!node) node = globals.append_child(name.c_str()); + node.text().set(value.c_str()); + ofLogVerbose(LOG_NAME) << "MSBuild property " << name << " = " << value; +} + void visualStudioProject::ensureDllDirectoriesExist() { std::vector dirs { { "dll/x64" }, { "dll/ARM64" }, { "dll/ARM64EC" } }; for (const auto & dir : dirs) { diff --git a/commandLine/src/projects/visualStudioProject.h b/commandLine/src/projects/visualStudioProject.h index 570bc876c..d06bc4f00 100644 --- a/commandLine/src/projects/visualStudioProject.h +++ b/commandLine/src/projects/visualStudioProject.h @@ -23,6 +23,7 @@ class visualStudioProject : public baseProject { addDefine(define, RELEASE_LIB); addDefine(define, DEBUG_LIB); projectDefines.emplace_back(define); + addPropertyDefine(define); } void addLDFLAG(const std::string& ldflag, LibType libType = RELEASE_LIB) override {} @@ -58,4 +59,6 @@ class visualStudioProject : public baseProject { void addCompileOption(const string& nodeName, const string& value, const string& delimiter, LibType libType = RELEASE_LIB); void addClCompileAsC(const string & srcFileString, const string & folderString); + // defines openFrameworksCommon.props also reads as MSBuild properties (OF_USE_GLON12 copies the GLon12 DLLs) + void addPropertyDefine(const string & define); }; diff --git a/frontend/app.js b/frontend/app.js index dd9ca5080..11e59e069 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1218,7 +1218,8 @@ function generate() { // renderer choice adds its OF_USE_* define on top of whatever the user typed manually const rendererDefines = { angle: 'OF_USE_ANGLE=1', - dawn: 'OF_USE_DAWN=1' + dawn: 'OF_USE_DAWN=1', + glon12: 'OF_USE_GLON12=1' }; const rendererChoice = $('#rendererDropdown').dropdown('get value'); const customDefinesText = $('#customDefines').val().trim(); @@ -1418,12 +1419,19 @@ function enableAdvancedMode(isAdvanced) { //$("#advancedToggle").prop('checked', defaultSettings['advancedMode'] ); } -// renderer choice (OF_USE_ANGLE / OF_USE_DAWN) only applies to the Xcode-based -// osx/ios/macos (mega iOS/tvOS/macOS) targets, and is an advanced-only option +// renderer choice is advanced-only: OF_USE_ANGLE / OF_USE_DAWN for the Xcode-based +// osx/ios/macos (mega iOS/tvOS/macOS) targets, OF_USE_GLON12 for vs function updateRendererFieldVisibility() { - const rendererPlatforms = ['osx', 'ios', 'macos']; const selectedPlatforms = ($("#platformsDropdown input").val() || '').trim().split(','); - if (defaultSettings.advancedMode && selectedPlatforms.some((p) => rendererPlatforms.includes(p))) { + const apple = selectedPlatforms.some((p) => ['osx', 'ios', 'macos'].includes(p)); + const vs = selectedPlatforms.includes('vs'); + $('#rendererDropdown .item[data-value="angle"], #rendererDropdown .item[data-value="dawn"]').toggle(apple); + $('#rendererDropdown .item[data-value="glon12"]').toggle(vs); + const renderer = $('#rendererDropdown').dropdown('get value'); + if ((['angle', 'dawn'].includes(renderer) && !apple) || (renderer === 'glon12' && !vs)) { + $('#rendererDropdown').dropdown('set exactly', 'default'); + } + if (defaultSettings.advancedMode && (apple || vs)) { $('#rendererField').show(); } else { $('#rendererField').hide(); diff --git a/frontend/index.html b/frontend/index.html index dd7ee9062..040df6d2a 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -234,13 +234,14 @@
Default (OpenGL / OpenGL ES)
- diff --git a/scripts/vs/test_cmdline.sh b/scripts/vs/test_cmdline.sh index be642e053..a5d55abdd 100755 --- a/scripts/vs/test_cmdline.sh +++ b/scripts/vs/test_cmdline.sh @@ -85,4 +85,15 @@ if [[ $errorcode -ne 0 ]]; then exit $errorcode fi +echo "Test -DOF_USE_GLON12=1 sets the MSBuild property" +./"${EXE_FILE}" -o"../openFrameworks" -p"vs" -D"OF_USE_GLON12=1" "../openFrameworks/apps/myApps/testingGLon12" +errorcode=$? +if [[ $errorcode -ne 0 ]]; then + exit $errorcode +fi +if ! grep -q "1" "../openFrameworks/apps/myApps/testingGLon12/testingGLon12.vcxproj"; then + echo "OF_USE_GLON12 property missing from testingGLon12.vcxproj" + exit 1 +fi + echo "Successful projectGenerator tests for [vs]" From 4581d4b828a86ac44c4d2fc811a0a62a9fb47054 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Sun, 25 Oct 2026 21:29:26 +1100 Subject: [PATCH 2/5] Renderer: GLon12 - WARP software option for vs (OF_USE_GLON12=1, OF_USE_GLON12_WARP=1) --- frontend/app.js | 7 ++++--- frontend/index.html | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/app.js b/frontend/app.js index 11e59e069..8931b8c28 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1219,7 +1219,8 @@ function generate() { const rendererDefines = { angle: 'OF_USE_ANGLE=1', dawn: 'OF_USE_DAWN=1', - glon12: 'OF_USE_GLON12=1' + glon12: 'OF_USE_GLON12=1', + glon12warp: 'OF_USE_GLON12=1,OF_USE_GLON12_WARP=1' }; const rendererChoice = $('#rendererDropdown').dropdown('get value'); const customDefinesText = $('#customDefines').val().trim(); @@ -1426,9 +1427,9 @@ function updateRendererFieldVisibility() { const apple = selectedPlatforms.some((p) => ['osx', 'ios', 'macos'].includes(p)); const vs = selectedPlatforms.includes('vs'); $('#rendererDropdown .item[data-value="angle"], #rendererDropdown .item[data-value="dawn"]').toggle(apple); - $('#rendererDropdown .item[data-value="glon12"]').toggle(vs); + $('#rendererDropdown .item[data-value="glon12"], #rendererDropdown .item[data-value="glon12warp"]').toggle(vs); const renderer = $('#rendererDropdown').dropdown('get value'); - if ((['angle', 'dawn'].includes(renderer) && !apple) || (renderer === 'glon12' && !vs)) { + if ((['angle', 'dawn'].includes(renderer) && !apple) || (['glon12', 'glon12warp'].includes(renderer) && !vs)) { $('#rendererDropdown').dropdown('set exactly', 'default'); } if (defaultSettings.advancedMode && (apple || vs)) { diff --git a/frontend/index.html b/frontend/index.html index 040df6d2a..3a11faf1a 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -242,6 +242,7 @@
ANGLE - Auto OpenGL to Metal
Dawn - Auto OpenGL to WebGPU/Metal
GLon12 - OpenGL to Direct3D 12 (Mesa)
+
GLon12 - WARP software (no GPU driver)
From 4b8d369ed5a5d59a20d139945b8c359d131bec41 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Sun, 25 Oct 2026 21:33:18 +1100 Subject: [PATCH 3/5] VS: OF_USE_GLON12=1 logs an error when no GLon12 files are found in libs/glon12/bin/vs --- commandLine/src/projects/visualStudioProject.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/commandLine/src/projects/visualStudioProject.cpp b/commandLine/src/projects/visualStudioProject.cpp index f67e4e067..528b2bb2b 100644 --- a/commandLine/src/projects/visualStudioProject.cpp +++ b/commandLine/src/projects/visualStudioProject.cpp @@ -646,6 +646,21 @@ void visualStudioProject::addPropertyDefine(const string & define) { if (!node) node = globals.append_child(name.c_str()); node.text().set(value.c_str()); ofLogVerbose(LOG_NAME) << "MSBuild property " << name << " = " << value; + + // the build fails without them too (openFrameworksCommon.props), say so now + if (name == "OF_USE_GLON12" && value == "1") { + fs::path bin { getOFRoot() / "libs" / "glon12" / "bin" / "vs" }; + std::vector found; + for (const auto & arch : { "x64", "ARM64", "ARM64EC" }) { + if (fs::exists(bin / arch / "opengl32.dll")) found.emplace_back(arch); + } + if (found.empty()) { + ofLogError(LOG_NAME) << "no GLon12 files found in " << bin.string() + << " - download the glon12 library (projectGenerator Libraries, or apothecary: TYPE=vs ./apothecary update glon12)"; + } else { + ofLogVerbose(LOG_NAME) << "GLon12 files found for " << ofJoinString(found, ", "); + } + } } void visualStudioProject::ensureDllDirectoriesExist() { From 713f300826ccbb46a918bdd2e12324b9ac771c69 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Sun, 25 Oct 2026 21:34:35 +1100 Subject: [PATCH 4/5] VS: -DOF_USE_GLON12_WARP=1 also sets the OF_USE_GLON12_WARP MSBuild property; GUI 0.107.0 (cmdline 0.114.0) --- commandLine/src/projects/visualStudioProject.cpp | 4 ++-- commandLine/src/projects/visualStudioProject.h | 2 +- frontend/npm-shrinkwrap.json | 4 ++-- frontend/package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/commandLine/src/projects/visualStudioProject.cpp b/commandLine/src/projects/visualStudioProject.cpp index 528b2bb2b..16d6cc732 100644 --- a/commandLine/src/projects/visualStudioProject.cpp +++ b/commandLine/src/projects/visualStudioProject.cpp @@ -629,9 +629,9 @@ void visualStudioProject::addDefine(const string& define, LibType libType) { // } } -// OF_USE_GLON12[=1] -> 1 in the Globals PropertyGroup +// OF_USE_GLON12[=1] / OF_USE_GLON12_WARP[=1] -> 1 etc in the Globals PropertyGroup void visualStudioProject::addPropertyDefine(const string & define) { - static const std::set properties { "OF_USE_GLON12" }; + static const std::set properties { "OF_USE_GLON12", "OF_USE_GLON12_WARP" }; auto eq = define.find('='); string name = ofTrim(define.substr(0, eq)); if (!properties.count(name)) return; diff --git a/commandLine/src/projects/visualStudioProject.h b/commandLine/src/projects/visualStudioProject.h index d06bc4f00..da7050eaa 100644 --- a/commandLine/src/projects/visualStudioProject.h +++ b/commandLine/src/projects/visualStudioProject.h @@ -59,6 +59,6 @@ class visualStudioProject : public baseProject { void addCompileOption(const string& nodeName, const string& value, const string& delimiter, LibType libType = RELEASE_LIB); void addClCompileAsC(const string & srcFileString, const string & folderString); - // defines openFrameworksCommon.props also reads as MSBuild properties (OF_USE_GLON12 copies the GLon12 DLLs) + // defines openFrameworksCommon.props also reads as MSBuild properties (OF_USE_GLON12 copies the GLon12 DLLs, OF_USE_GLON12_WARP selects WARP) void addPropertyDefine(const string & define); }; diff --git a/frontend/npm-shrinkwrap.json b/frontend/npm-shrinkwrap.json index 64ca9ce92..864c37a68 100644 --- a/frontend/npm-shrinkwrap.json +++ b/frontend/npm-shrinkwrap.json @@ -1,12 +1,12 @@ { "name": "projectGenerator", - "version": "0.106.0", + "version": "0.107.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "projectGenerator", - "version": "0.106.0", + "version": "0.107.0", "license": "MIT", "dependencies": { "@types/jquery": "^3.5.34", diff --git a/frontend/package.json b/frontend/package.json index b5b841f30..a4681511a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "projectGenerator", "productName": "projectGenerator", - "version": "0.106.0", + "version": "0.107.0", "description": "Build electron GUI openFrameworks projectGenerator", "license": "MIT", "main": "index.js", From a256fc947930a9a25ee1f1c62236f4b5db3962b2 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Sun, 25 Oct 2026 21:36:45 +1100 Subject: [PATCH 5/5] VS: GLon12 missing-files error points at downloads > Modular libraries > glon12 --- commandLine/src/projects/visualStudioProject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commandLine/src/projects/visualStudioProject.cpp b/commandLine/src/projects/visualStudioProject.cpp index 16d6cc732..e6e9970cb 100644 --- a/commandLine/src/projects/visualStudioProject.cpp +++ b/commandLine/src/projects/visualStudioProject.cpp @@ -656,7 +656,7 @@ void visualStudioProject::addPropertyDefine(const string & define) { } if (found.empty()) { ofLogError(LOG_NAME) << "no GLon12 files found in " << bin.string() - << " - download the glon12 library (projectGenerator Libraries, or apothecary: TYPE=vs ./apothecary update glon12)"; + << " - download glon12 in projectGenerator: downloads > Modular libraries > glon12 > Download selected (or apothecary: TYPE=vs ./apothecary update glon12)"; } else { ofLogVerbose(LOG_NAME) << "GLon12 files found for " << ofJoinString(found, ", "); }