Browse Source

Remove contextInit() and contextDestroy() since they don't really make sense with multiple instances.

tags/v2.0.0
Andrew Belt 4 years ago
parent
commit
529d87ee12
2 changed files with 4 additions and 14 deletions
  1. +0
    -12
      src/context.cpp
  2. +4
    -2
      src/main.cpp

+ 0
- 12
src/context.cpp View File

@@ -47,18 +47,6 @@ Context::~Context() {

static thread_local Context* context = NULL;

void contextInit() {
assert(!context);
context = new Context;
context->init();
}

void contextDestroy() {
assert(context);
delete context;
context = NULL;
}

Context* contextGet() {
assert(context);
return context;


+ 4
- 2
src/main.cpp View File

@@ -173,7 +173,8 @@ int main(int argc, char* argv[]) {

// Initialize context
INFO("Initializing context");
contextInit();
contextSet(new Context);
APP->init();

// On Mac, use a hacked-in GLFW addition to get the launched path.
#if defined ARCH_MAC
@@ -221,7 +222,8 @@ int main(int argc, char* argv[]) {
settings::patchPath = APP->patch->path;
}
INFO("Destroying context");
contextDestroy();
delete APP;
contextSet(NULL);
if (!settings::headless) {
settings::save(asset::settingsPath);
}


Loading…
Cancel
Save