-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish refactoring of platform code.
This commit finally unifies all main() functions and moves the few remaining application-wide functions where they belong.
- Loading branch information
1 parent
350d2ad
commit 6bfe635
Showing
19 changed files
with
287 additions
and
374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//----------------------------------------------------------------------------- | ||
// Our main() function for the graphical interface. | ||
// | ||
// Copyright 2018 <whitequark@whitequark.org> | ||
//----------------------------------------------------------------------------- | ||
#include "solvespace.h" | ||
#if defined(WIN32) | ||
# include <windows.h> | ||
#endif | ||
|
||
#if defined(WIN32) | ||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, | ||
LPSTR lpCmdLine, INT nCmdShow) { | ||
main(0, NULL); | ||
} | ||
#endif | ||
|
||
using namespace SolveSpace; | ||
|
||
int main(int argc, char** argv) { | ||
std::vector<std::string> args = InitPlatform(argc, argv); | ||
|
||
Platform::InitGui(argc, argv); | ||
Platform::Open3DConnexion(); | ||
SS.Init(); | ||
|
||
if(args.size() >= 2) { | ||
if(args.size() > 2) { | ||
dbp("Only the first file passed on command line will be opened."); | ||
} | ||
|
||
SS.Load(Platform::Path::From(args.back()).Expand(/*fromCurrentDirectory=*/true)); | ||
} | ||
|
||
Platform::RunGui(); | ||
|
||
Platform::Close3DConnexion(); | ||
SS.Clear(); | ||
|
||
SK.Clear(); | ||
|
||
return 0; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.