cameras :)

This commit is contained in:
/nick haya 2022-02-18 15:17:13 +08:00
parent 34bb25d838
commit dfb3f5e6bf
1 changed files with 6 additions and 0 deletions

View File

@ -397,6 +397,8 @@ namespace sdfml {
config.close();
}
static GPU_Camera camera;
inline int init(float width = DEFAULT_WINDOW_WIDTH, float height = DEFAULT_WINDOW_HEIGHT, string window_name = "Unknown",
int win_flags = SDL_WINDOW_OPENGL|SDL_WINDOW_ALLOW_HIGHDPI|SDL_WINDOW_SHOWN) {
std::ofstream logFile;
@ -432,6 +434,10 @@ namespace sdfml {
sound.initSF(soundfont);
llog("SoLoud", " is now initialized.", NORMAL, __FILENAME__, __LINE__);
camera = GPU_GetDefaultCamera();
GPU_EnableCamera(mContext.gpu_render, true);
GPU_SetCamera(mContext.gpu_render, &camera);
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
mContext.size = {width, height};