What would I need to do to make these two feasible?
#include "UltraEngine.h"
#include "ComponentSystem.h"
#include "UESystem.h"
using namespace UltraEngine;
UESystem CoreSystem;
// SmartPointer World
bool ProgramActive = true;
int main(int argc, const char* argv[])
{
CoreSystem = UESystem();
CoreSystem.Setup(1920,1080);
//World = CoreSystem.World;
while (ProgramActive)
{
CoreSystem.Update();
}
// C L E A N U P
return 0;
}
class UESystem
{
public:
static void Setup(int height, int width),InitDisplays(), InitWindow(), InitWorld(), InitCamera();
// WORLD(S) -- ACTUAL "OBJECT"
// CAMERA(S)-- ACTUAL "OBJECT"
// WINDOW(S)-- ACTUAL "OBJECT"
static int windowWidth;
static int windowHeight;
static void Update()
{
// World.Update();
// World.Render(framebuffer);
}
static void Setup(int height, int width)
{
windowHeight = height;
windowWidth = width;
InitDisplays();
InitWindow();
InitWorld();
InitCamera();
}
static void InitDisplays()
{
//auto displays = GetDisplays();
}
static void InitWindow()
{
//auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
//auto framebuffer = CreateFramebuffer(window);
}
static void InitWorld()
{
//auto world = CreateWorld();
//auto light = CreateBoxLight(world);
//light->SetRotation(35, 45, 0);
//light->SetRange(-10, 10);
}
static void InitCamera()
{
//auto camera = CreateCamera(world);
//camera->SetClearColor(0.125);
//camera->SetFov(70);
//camera->SetPosition(0, 0, -3);
}
};
***
I would like to be able to access the world from the coresystem if/when necessary and so within the UESystem class, I would like to have them as global variables probably static so that the individual functions will set the variables for future access when needed.
The whole smart pointer thing is confusing me. I watched your video where you explained why you use auto, and that makes sense, and I would like to continue to use it for other stuff, but initially in this step, I would like fixed variables.