From b42a5e324d3fbb3f57d0aef2996ff62ae921f701 Mon Sep 17 00:00:00 2001 From: /nick haya <74699483+The-SGPT@users.noreply.github.com> Date: Tue, 22 Feb 2022 12:46:33 +0800 Subject: [PATCH] Revert "small tweaks" This reverts commit 89a2dd1f6d23ebb16690c4ea35a9e0530f7a9c50. --- src/libflixel.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/libflixel.hpp b/src/libflixel.hpp index 37d1e85..2d98bc9 100644 --- a/src/libflixel.hpp +++ b/src/libflixel.hpp @@ -14,7 +14,6 @@ #include "SDL2/SDL.h" #include "SDL2/SDL_ttf.h" #include "SDL2/SDL_FontCache.h" -#include "SDL_video.h" #include "SoLoud/soloud.h" #include "SoLoud/soloud_wav.h" #include "SoLoud/soloud_wavstream.h" @@ -149,6 +148,7 @@ namespace sdfml { struct context { GPU_Target* gpu_render; SDL_Window* window; + SDL_Renderer* renderer; SDL_Event events; mWin direct_win; Vector2f size; @@ -429,12 +429,13 @@ namespace sdfml { llog("", "Initialized libraries. Creating a window context.", NORMAL, __FILENAME__, __LINE__); GPU_SetPreInitFlags(GPU_INIT_DISABLE_VSYNC); mContext.gpu_render = GPU_Init(width, height, GPU_DEFAULT_INIT_FLAGS); - mContext.window = SDL_GetWindowFromID(mContext.gpu_render->context->windowID); - SDL_SetWindowTitle(mContext.window, window_name.c_str()); - + + SDL_SetWindowTitle(SDL_GetWindowFromID(mContext.gpu_render->context->windowID), window_name.c_str()); + //sound.music.loadSoundfont(soundfont); + SDL_SysWMinfo wmInfo; SDL_VERSION(&wmInfo.version); - SDL_GetWindowWMInfo(mContext.window, &wmInfo); + SDL_GetWindowWMInfo(SDL_GetWindowFromID(mContext.gpu_render->context->windowID), &wmInfo); mContext.direct_win = wmInfo.info.win.window; sound.init(); @@ -447,7 +448,7 @@ namespace sdfml { SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); - mContext.size = {static_cast(mContext.gpu_render->context->window_w), static_cast(mContext.gpu_render->context->window_h)}; + mContext.size = {width, height}; return llog("", "Fully finalized initialization. Command over.", NORMAL, __FILENAME__, __LINE__); }