More Progress

This commit is contained in:
2022-10-18 15:23:50 -07:00
parent 0ec2809d88
commit 6f10535962
45 changed files with 7994 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# Copyright (c) 2022 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Sources
target_sources(${DAWN_TARGET_NAME}
PRIVATE
DawnHostWin32.cpp
)

View File

@ -0,0 +1,42 @@
// 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(std::weak_ptr<DawnGame>(game));
switch(result) {
case DAWN_HOST_INIT_RESULT_SUCCESS:
break;
default:
return result;
}
// Request the main loop to start running.
result = host->start(std::weak_ptr<DawnGame>(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(std::weak_ptr<DawnGame>(game));
// Success
return 0;
}

View File

@ -0,0 +1,18 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "dawnlibs.hpp"
#include "host/DawnHost.hpp"
#include "game/DawnGame.hpp"
/**
* Main entry function received by parent Win32 Operating System.
*
* @param argc Count of arguments passed to the program.
* @param args Array of strings provided to the program.
* @return 0 for success, else for any issue/error.
*/
int32_t main(int32_t argc, char **args);