diff options
author | Chris Xiong <chirs241097@gmail.com> | 2020-05-01 01:29:23 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2020-05-01 01:29:23 +0800 |
commit | b83fb431fdff9329dc3cf9457f1934b6156eedfa (patch) | |
tree | b78a8ec2aacaaf8b1e87c9bc19e056cfe5937eee | |
parent | 87a25aa8fd3cb5a67747bff63711338e0f88b7c3 (diff) | |
download | SMELT-master.tar.xz |
-rw-r--r-- | include/smelt.hpp | 2 | ||||
-rw-r--r-- | smelt/glfw/smelt_internal.hpp | 4 | ||||
-rw-r--r-- | smelt/glfw/sys_glfw.cpp | 7 |
3 files changed, 7 insertions, 6 deletions
diff --git a/include/smelt.hpp b/include/smelt.hpp index e078420..f0f8ddc 100644 --- a/include/smelt.hpp +++ b/include/smelt.hpp @@ -242,7 +242,7 @@ public: * Take care with fullscreen video modes. Inappropriate fullscreen * resolutions will cause the failure of smInit(). */ - virtual void smVidMode(int resX,int resY,bool _windowed,bool showWindow=true)=0; + virtual void smVidMode(int resX,int resY,bool _windowed,bool _showWindow=true)=0; /* * Sets the log file path. * The default value is empty. diff --git a/smelt/glfw/smelt_internal.hpp b/smelt/glfw/smelt_internal.hpp index 5b8d5db..63cd190 100644 --- a/smelt/glfw/smelt_internal.hpp +++ b/smelt/glfw/smelt_internal.hpp @@ -101,7 +101,7 @@ public: virtual void smWinTitle(const char* title); virtual bool smIsActive(); virtual void smNoSuspend(bool para); - virtual void smVidMode(int resX,int resY,bool _windowed,bool showWindow=true); + virtual void smVidMode(int resX, int resY, bool _windowed, bool _showWindow=true); virtual void smLogFile(const char* path); virtual void smLog(const char* format,...); virtual void smScreenShot(const char* path); @@ -194,7 +194,7 @@ private: char winTitle[256]; int scrw,scrh; int dispw,disph; - bool windowed,vsync; + bool windowed,vsync,showwindow; char logFile[256]; int limfps; bool hideMouse,noSuspend; diff --git a/smelt/glfw/sys_glfw.cpp b/smelt/glfw/sys_glfw.cpp index bca71c9..f06ae5c 100644 --- a/smelt/glfw/sys_glfw.cpp +++ b/smelt/glfw/sys_glfw.cpp @@ -138,6 +138,8 @@ bool SMELT_IMPL::smInit() glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR,3); glfwWindowHint(GLFW_OPENGL_PROFILE,GLFW_OPENGL_CORE_PROFILE); #endif + if(!showwindow) + glfwWindowHint(GLFW_VISIBLE,GLFW_FALSE); GLFWwindow *screen=glfwCreateWindow(windowed?scrw:dispw,windowed?scrh:disph,winTitle,NULL,NULL); hwnd=(void*)screen; if(!hwnd) @@ -218,7 +220,7 @@ void SMELT_IMPL::smQuitFunc(smHandler* h){quitHandler=h;} void SMELT_IMPL::smWinTitle(const char *title){strcpy(winTitle,title);} bool SMELT_IMPL::smIsActive(){return Active;} void SMELT_IMPL::smNoSuspend(bool para){noSuspend=para;} -void SMELT_IMPL::smVidMode(int resX,int resY,bool _windowed,bool showWindow) +void SMELT_IMPL::smVidMode(int resX,int resY,bool _windowed,bool _showWindow) { if(vertexArray)return; if(!pOpenGLDevice) @@ -226,8 +228,7 @@ void SMELT_IMPL::smVidMode(int resX,int resY,bool _windowed,bool showWindow) scrw=resX; scrh=resY; windowed=_windowed; - if(!showWindow) - glfwWindowHint(GLFW_VISIBLE,GLFW_FALSE); + showwindow=_showWindow; } else if(windowed!=_windowed) { |