Starting off.
This commit is contained in:
parent
ceb9b961f2
commit
bee1428a35
1
include/sharpsoft/all.hpp
Normal file
1
include/sharpsoft/all.hpp
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "global_misc.hpp"
|
||||||
17
include/sharpsoft/global_misc.hpp
Normal file
17
include/sharpsoft/global_misc.hpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace sharp
|
||||||
|
{
|
||||||
|
struct global_properties
|
||||||
|
{
|
||||||
|
static const global_properties defaults;
|
||||||
|
};
|
||||||
|
|
||||||
|
void initialize();
|
||||||
|
void initialize(const global_properties& flags);
|
||||||
|
void uninitialize();
|
||||||
|
void re_initialize();
|
||||||
|
void re_initialize(const global_properties& flags);
|
||||||
|
|
||||||
|
bool is_initialized();
|
||||||
|
}
|
||||||
48
include/sharpsoft/src/global_manager.cpp
Normal file
48
include/sharpsoft/src/global_manager.cpp
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#include "sharpsoft/global_misc.hpp"
|
||||||
|
|
||||||
|
using namespace sharp;
|
||||||
|
|
||||||
|
const global_properties global_properties::defaults = { }; // TODO
|
||||||
|
|
||||||
|
bool initialized = false;
|
||||||
|
|
||||||
|
void sharp::initialize()
|
||||||
|
{
|
||||||
|
if (initialized) return;
|
||||||
|
initialize(global_properties::defaults);
|
||||||
|
}
|
||||||
|
void sharp::initialize(const global_properties& flags)
|
||||||
|
{
|
||||||
|
if (initialized) return;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sharp::uninitialize()
|
||||||
|
{
|
||||||
|
if (!initialized) return;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
initialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sharp::re_initialize()
|
||||||
|
{
|
||||||
|
if (!initialized) return;
|
||||||
|
uninitialize();
|
||||||
|
initialize();
|
||||||
|
}
|
||||||
|
void sharp::re_initialize(const global_properties& flags)
|
||||||
|
{
|
||||||
|
if (!initialized) return;
|
||||||
|
uninitialize();
|
||||||
|
initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool sharp::is_initialized()
|
||||||
|
{
|
||||||
|
return initialized;
|
||||||
|
}
|
||||||
@ -1,8 +1,13 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "sharpsoft/all.hpp"
|
||||||
|
|
||||||
|
// This library is intended to be referenced by the prefix `sharp::`
|
||||||
|
// Including `using namespace sharp;` is not recommended.
|
||||||
|
|
||||||
void initialize()
|
void initialize()
|
||||||
{
|
{
|
||||||
|
// Initialize Sharpsoft.
|
||||||
|
sharp::initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void disabled() { }
|
void disabled() { }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user