Rework API graphique Vulkan - EnTT pour ECS + Chargement modèle 3D assimp + SDL3 pour events input et fenetre + mesh texture camera transform ok + attention tous les assets nouveaus ne sont pas commités et il y a du code test en dur dans scene addentity + restructuration globale
This commit is contained in:
42
src/Engine/Core/Graphics/CContext.cpp
Normal file
42
src/Engine/Core/Graphics/CContext.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#include "CContext.hpp"
|
||||
#include "API/GraphicsAPI.hpp"
|
||||
#include <SDL3/SDL_init.h>
|
||||
#include <SDL3_image/SDL_image.h>
|
||||
|
||||
bool CContext::m_screenSaver = false;
|
||||
|
||||
void CContext::init(SDL_InitFlags sdlFlags) {
|
||||
// Log initialisation.
|
||||
initLog();
|
||||
|
||||
|
||||
// SDL Initialization.
|
||||
if (SDL_Init(sdlFlags)) {
|
||||
SDL_Quit();
|
||||
//HandleException(CLibException(std::string("Unable to initialize SDL: ") + SDL_GetError()), true);
|
||||
}
|
||||
|
||||
GraphicsAPI::initAPI();
|
||||
}
|
||||
|
||||
bool CContext::isScreenSaverEnable(void) {
|
||||
return m_screenSaver;
|
||||
}
|
||||
|
||||
void CContext::setScreenSaverEnable(bool newScreenSaver) {
|
||||
m_screenSaver = newScreenSaver;
|
||||
if (m_screenSaver) {
|
||||
SDL_EnableScreenSaver();
|
||||
}
|
||||
else {
|
||||
SDL_DisableScreenSaver();
|
||||
}
|
||||
}
|
||||
|
||||
void CContext::quit(void) {
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
void CContext::initLog(void) {
|
||||
//todo
|
||||
}
|
||||
Reference in New Issue
Block a user