Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
graphite/editor/include/global.h
2024-01-03 16:05:02 -05:00

40 lines
No EOL
677 B
C++

#pragma once
#include <string>
#include <GLFW/glfw3.h>
#ifdef LINUX
#define GLFW_EXPOSE_NATIVE_X11
#elif MACOS
//until i can figure out a way to stop the Component class conflicting
//#define GLFW_EXPOSE_NATIVE_COCOA
#endif
#include <GLFW/glfw3native.h>
#include <entitypool.hpp>
class Entity;
class Engine;
struct GlobalState
{
int selectedID = 0;
bool isSelectionEntity = true;
GLFWwindow* window = nullptr;
Engine* engine = nullptr;
EntityPool temporaryEntityState;
std::string projectRoot;
bool isCurrentlyPlaying = false;
Entity* editorCamera;
};
inline GlobalState& GetState()
{
static GlobalState state;
return state;
}