Skip to content

Commit

Permalink
fixes for new windows build and inno files
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Sep 18, 2023
1 parent 8249198 commit 9080a68
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ examples/tmp_pics/
examples/GPUCache
extras/python/Leap/*.pyc
extras/python/Myo/*.pyc
extras/utils/Output
examples/vals*.dat
*blend1
.local*
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,14 @@ link_directories(${LIB_DIRS})
add_executable(polyvr src/main.cpp)
target_sources(polyvr PRIVATE src/PolyVR.cpp)

# command to run polyvr after building within visual studio
if(WIN32)
add_custom_command(TARGET polyvr POST_BUILD
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/start-win2.bat
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif()

# start with optional stuff

if(NOT WASM)
Expand Down Expand Up @@ -686,6 +694,7 @@ target_sources(polyvr PRIVATE src/core/tools/VRQRCode.cpp) # needs qrencode
endif()

if(NOT WITHOUT_EIGEN)
target_sources(polyvr PRIVATE src/addons/Engineering/Mechanics/VRPolarVertex.cpp)
target_sources(polyvr PRIVATE src/addons/Engineering/Mechanics/VRGearSegmentation.cpp) # needs eigen
target_sources(polyvr PRIVATE src/addons/Engineering/Mechanics/VRAxleSegmentation.cpp) # needs eigen
endif()
Expand Down
44 changes: 44 additions & 0 deletions extras/utils/myApp.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "MYAPP"
#define MyAppVersion "YY.MM_Win10_x64"
#define MyAppPublisher "Victor Haefner"
#define MyAppExeName "startApp.bat"
#define MyAppIcoName "engine\ressources\gui\logo_icon_win.ico"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{FAF42953-0109-4262-93F5-502A5ED5EC20}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
; Remove the following line to run in administrative install mode (install for all users.)
PrivilegesRequired=lowest
OutputBaseFilename=MYAPP
Compression=lzma
SolidCompression=yes
WizardStyle=modern

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "..\..\packages\MY_APP\startApp.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\packages\MY_APP\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .config
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{app}\{#MyAppIcoName}";
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{app}\{#MyAppIcoName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent

53 changes: 38 additions & 15 deletions extras/utils/polyvr.iss
Original file line number Diff line number Diff line change
@@ -1,21 +1,44 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "PolyVR"
#define MyAppVersion "23.09_Win10_x64"
#define MyAppPublisher "Victor Haefner"
#define MyAppExeName "startApp.bat"
#define MyAppIcoName "engine\ressources\gui\logo_icon_win.ico"

[Setup]
AppName=PolyVR
AppVersion=1.0
WizardStyle=modern
DefaultDirName={autopf}\PolyVR
DefaultGroupName=PolyVR
UninstallDisplayIcon={app}\engine\ressources\gui\logo_icon_win.ico
Compression=lzma2
SolidCompression=yes
OutputDir=..\..\packages
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{8B0F6AF7-60C4-4855-815E-64927436A36F}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
; Remove the following line to run in administrative install mode (install for all users.)
PrivilegesRequired=lowest
OutputBaseFilename=polyvr
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
Compression=lzma
SolidCompression=yes
WizardStyle=modern

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "..\..\packages\polyvr\*"; \
DestDir: "{app}\"; \
Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist
Source: "..\..\packages\polyvr\startApp.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\packages\polyvr\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .config
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\PolyVR"; Filename: "{app}\startApp.bat"; WorkingDir: "{app}"; IconFilename: "{app}\engine\ressources\gui\logo_icon_win.ico"
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{app}\{#MyAppIcoName}";
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{app}\{#MyAppIcoName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent

16 changes: 10 additions & 6 deletions src/core/gui/imgui/VRImguiEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,13 @@ ImFileDialog::ImFileDialog() : ImDialog("file"), scaleInput("geoScale", "Scale:"
mgr->addCallback("set_file_dialog_options", [&](OSG::VRGuiSignals::Options o){ options = o["options"]; return true; } );
}

IGFD::FileDialog* imGuiFileDialogInstance = 0;

void ImFileDialog::begin() {
if (!internalOpened) {
internalOpened = true;
ImGuiFileDialog::Instance()->OpenDialog("ChooseFileDlgKey", title.c_str(), filters.c_str(), startDir.c_str(), startFile.c_str());
imGuiFileDialogInstance = new IGFD::FileDialog();
imGuiFileDialogInstance->OpenDialog("ChooseFileDlgKey", title.c_str(), filters.c_str(), startDir.c_str(), startFile.c_str());
}

bool doGeoOpts = bool(options == "geoOpts");
Expand All @@ -551,14 +554,15 @@ void ImFileDialog::begin() {
ImVec2 minSize = ImGui::GetWindowSize();
if (doGeoOpts) minSize.y *= 0.9;
ImGui::SetNextWindowPos(ImVec2(surface.x, surface.y));
if (ImGuiFileDialog::Instance()->Display("ChooseFileDlgKey", flags, minSize, minSize)) {
if (ImGuiFileDialog::Instance()->IsOk()) {
std::string fileName = ImGuiFileDialog::Instance()->GetFilePathName();
std::string filePath = ImGuiFileDialog::Instance()->GetCurrentPath();
if (imGuiFileDialogInstance->Display("ChooseFileDlgKey", flags, minSize, minSize)) {
if (imGuiFileDialogInstance->IsOk()) {
std::string fileName = imGuiFileDialogInstance->GetFilePathName();
std::string filePath = imGuiFileDialogInstance->GetCurrentPath();
signal(sig, {{"fileName",fileName},{"filePath",filePath}});
}

ImGuiFileDialog::Instance()->Close();
imGuiFileDialogInstance->Close();
delete imGuiFileDialogInstance;
signal("ui_close_popup", {});
internalOpened = false;
}
Expand Down
2 changes: 0 additions & 2 deletions src/core/gui/imgui/imFileDialog/ImGuiFileDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3981,8 +3981,6 @@ namespace IGFD
res = prDrawFooter(); // file field, filter combobox, ok/cancel buttons

EndFrame();


}
ImGui::EndChild();

Expand Down
4 changes: 2 additions & 2 deletions src/core/objects/VRPointCloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ void VRExternalPointCloud::printOctree() {
stream.seekg(ocTree, ios::beg);
for (int i=0; i<nodeCount; i++) {
OcSerialNode node;
size_t pos = stream.tellg() - ocTree;
size_t pos = size_t(stream.tellg()) - ocTree;
stream.read((char*)&node, ocNodeBinSize);
printNode(node, pos, "");
}
Expand Down Expand Up @@ -1234,7 +1234,7 @@ void VRPointCloud::externalComputeSplats(string path, float neighborsRadius, boo
VRExternalPointCloud wepc(wpath);
ofstream tmp(wpath, ios::app);
size_t p = tmp.tellp();
startPnt = (tmp.tellp() - wepc.binPntsStart) / wepc.binPntSize;
startPnt = (p - wepc.binPntsStart) / wepc.binPntSize;
tmp.close();
stream.seekg(epc.binPntsStart + epc.binPntSize*startPnt, ios::beg);
cout << " resume at pnt " << startPnt << ", p: " << p << endl;
Expand Down
2 changes: 1 addition & 1 deletion src/core/setup/windows/VRGlutEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ void VRGlutEditor::on_ui_resize(int w, int h) {
}

void VRGlutEditor::on_popup_display() {
//cout << " Glut::on_ui_display " << winUI << endl;
//cout << " Glut::on_popup_display " << winUI << endl;
if (winPopup < 0) return;
glutSetWindow(winPopup);
if (signal) signal( "glutRenderPopup", {{"name",popup}} );
Expand Down
4 changes: 3 additions & 1 deletion src/core/utils/system/VRSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@


void getMemUsage(double& vm_usage, double& resident_set) {
#ifndef WIN32
using std::ios_base;
using std::ifstream;
using std::string;
Expand Down Expand Up @@ -63,8 +64,9 @@ void getMemUsage(double& vm_usage, double& resident_set) {
stat_stream.close();

long page_size_kb = sysconf(_SC_PAGE_SIZE) / 1024; // in case x86-64 is configured to use 2MB pages
vm_usage = vsize / 1024.0;
resident_set = rss * page_size_kb;
vm_usage = vsize / 1024.0;
#endif
}

string getSystemVariable(string name) {
Expand Down

0 comments on commit 9080a68

Please sign in to comment.