added more App functions

This commit is contained in:
2025-03-12 00:21:14 -05:00
parent 6f706e7b69
commit 61d444527c
4 changed files with 38 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
App* App::instance = nullptr;
App::App() {
App::App(const int& argc, char* argv[]) {
if(instance != nullptr) {
std::cout << "App already exists\nThere can only be one!\n";
@@ -13,6 +13,8 @@ App::App() {
instance = this;
handleArgs(argc, argv);
}
App::~App() {
@@ -29,3 +31,28 @@ void App::run() {
}
}
void App::load(std::string lib) {
}
void App::handleArgs(const int& argc, char* argv[]) {
int i = 0;
while(i < argc) {
if(strcmp(argv[i], "-h") == 0) {
printHelp();
end();
} else {
break;
}
i++;
}
while(i < argc) {
load(argv[i]);
i++;
}
}