Part one - removed references and smart pointers
This commit is contained in:
@ -1,42 +1,45 @@
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "DawnHostWin32.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
int32_t main(int32_t argc, char **args) {
|
||||
int32_t result;
|
||||
|
||||
// Create the host
|
||||
auto host = std::make_shared<DawnHost>();
|
||||
auto game = std::make_shared<DawnGame>(*host);
|
||||
|
||||
// Initialize the host and error check
|
||||
result = host->init(*game);
|
||||
switch(result) {
|
||||
case DAWN_HOST_INIT_RESULT_SUCCESS:
|
||||
break;
|
||||
default:
|
||||
return result;
|
||||
}
|
||||
|
||||
// Request the main loop to start running.
|
||||
result = host->start(*game);
|
||||
switch(result) {
|
||||
case DAWN_HOST_START_RESULT_SUCCESS:
|
||||
break;
|
||||
case DAWN_HOST_START_RESULT_EXIT_SUCCESS:
|
||||
break;
|
||||
default:
|
||||
return result;
|
||||
}
|
||||
|
||||
// Main loop finished without errors, cleanup
|
||||
host->unload(*game);
|
||||
|
||||
// Success
|
||||
return 0;
|
||||
// Copyright (c) 2022 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "DawnHostWin32.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
int32_t main(int32_t argc, char **args) {
|
||||
int32_t result;
|
||||
|
||||
// Create the host
|
||||
auto host = new DawnHost();
|
||||
auto game = new DawnGame(host);
|
||||
|
||||
// Initialize the host and error check
|
||||
result = host->init(game);
|
||||
switch(result) {
|
||||
case DAWN_HOST_INIT_RESULT_SUCCESS:
|
||||
break;
|
||||
default:
|
||||
return result;
|
||||
}
|
||||
|
||||
// Request the main loop to start running.
|
||||
result = host->start(game);
|
||||
switch(result) {
|
||||
case DAWN_HOST_START_RESULT_SUCCESS:
|
||||
break;
|
||||
case DAWN_HOST_START_RESULT_EXIT_SUCCESS:
|
||||
break;
|
||||
default:
|
||||
return result;
|
||||
}
|
||||
|
||||
// Main loop finished without errors, cleanup
|
||||
host->unload(game);
|
||||
|
||||
delete game;
|
||||
delete host;
|
||||
|
||||
// Success
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user