Revert "small tweaks"

This reverts commit 89a2dd1f6d.
This commit is contained in:
/nick haya 2022-02-22 12:46:33 +08:00
parent 89a2dd1f6d
commit b42a5e324d
1 changed files with 7 additions and 6 deletions

View File

@ -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<float>(mContext.gpu_render->context->window_w), static_cast<float>(mContext.gpu_render->context->window_h)};
mContext.size = {width, height};
return llog("", "Fully finalized initialization. Command over.", NORMAL, __FILENAME__, __LINE__);
}