From 97a53fb5cf3e09a714e78ad305c8635c3f6225a9 Mon Sep 17 00:00:00 2001 From: Jarrett Johnson Date: Thu, 1 Aug 2024 17:30:07 -0400 Subject: [PATCH] Remove windows.h inclusion from many headers --- contrib/vr/OpenVRControllerModel.cpp | 10 +++------- layer0/ShaderMgr.cpp | 10 ---------- layer0/ShaderMgr.h | 13 ------------- layer0/os_proprietary.h | 10 ---------- layer1/Setting.cpp | 10 ++++++++++ layer2/ObjectVolume.cpp | 12 ------------ 6 files changed, 13 insertions(+), 52 deletions(-) diff --git a/contrib/vr/OpenVRControllerModel.cpp b/contrib/vr/OpenVRControllerModel.cpp index 0eb0eb0e8..e68dd0ab7 100644 --- a/contrib/vr/OpenVRControllerModel.cpp +++ b/contrib/vr/OpenVRControllerModel.cpp @@ -35,6 +35,7 @@ SOFTWARE. #include "OpenVRControllerModel.h" // system headers +#include #include #include "os_std.h" #include "os_gl.h" @@ -186,14 +187,9 @@ void OpenVRControllerModel::Draw() { // Purpose: //----------------------------------------------------------------------------- -static -void ThreadSleep( unsigned long nMilliseconds ) +static void ThreadSleep(unsigned long nMilliseconds) { -#if defined(_WIN32) - ::Sleep( nMilliseconds ); -#elif defined(POSIX) - usleep( nMilliseconds * 1000 ); -#endif + std::this_thread::sleep_for(std::chrono::milliseconds(nMilliseconds)); } // Purpose: Finds a render model we've already loaded or loads a new one diff --git a/layer0/ShaderMgr.cpp b/layer0/ShaderMgr.cpp index 8e587e738..b0d74f017 100644 --- a/layer0/ShaderMgr.cpp +++ b/layer0/ShaderMgr.cpp @@ -289,16 +289,6 @@ static void getGLSLVersion(PyMOLGlobals * G, int* major, int* minor); static void disableShaders(PyMOLGlobals * G); -#ifdef WIN32 -/* REMOVE US */ -PFNGLTEXIMAGE3DPROC getTexImage3D(){ - static PFNGLTEXIMAGE3DPROC my_glTexImage3D = nullptr; - if (!my_glTexImage3D) - my_glTexImage3D = (PFNGLTEXIMAGE3DPROC) wglGetProcAddress("glTexImage3D"); - return my_glTexImage3D; -} -#endif - /** * Use this to turn off shaders if the renderer cannot use them. */ diff --git a/layer0/ShaderMgr.h b/layer0/ShaderMgr.h index 69447c348..979e1c506 100644 --- a/layer0/ShaderMgr.h +++ b/layer0/ShaderMgr.h @@ -44,19 +44,6 @@ Z* ------------------------------------------------------------------- #define LOCK_GUARD_MUTEX(name, var) #endif -/* BEGIN PROPRIETARY CODE SEGMENT (see disclaimer in "os_proprietary.h") */ -#if 0 -PFNGLTEXIMAGE3DPROC getTexImage3D(); -static PFNGLTEXIMAGE3DPROC glTexImage3D; -static PFNGLGENPROGRAMSARBPROC glGenProgramsARB; -static PFNGLBINDPROGRAMARBPROC glBindProgramARB; -static PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB; -static PFNGLPROGRAMSTRINGARBPROC glProgramStringARB; -static PFNGLPROGRAMENVPARAMETER4FARBPROC glProgramEnvParameter4fARB; -static PFNGLGETPROGRAMIVARBPROC glGetProgramivARB; -#endif -/* END PROPRIETARY CODE SEGMENT */ - class CShaderPrg { public: struct GeometryShaderParams diff --git a/layer0/os_proprietary.h b/layer0/os_proprietary.h index c33e4531b..0c118b002 100644 --- a/layer0/os_proprietary.h +++ b/layer0/os_proprietary.h @@ -69,14 +69,4 @@ Z* ------------------------------------------------------------------- * CODE SEGMENTS. */ - -/* BEGIN PROPRIETARY CODE SEGMENT */ -#ifdef WIN32 -#define NOMINMAX -#include -#endif - - -/* END PROPRIETARY CODE SEGMENT */ - #endif diff --git a/layer1/Setting.cpp b/layer1/Setting.cpp index 7986a2f03..886ce3548 100644 --- a/layer1/Setting.cpp +++ b/layer1/Setting.cpp @@ -48,6 +48,16 @@ Z* ------------------------------------------------------------------- #include"OpenVRMode.h" #endif + +/* BEGIN PROPRIETARY CODE SEGMENT */ +#ifdef WIN32 +#define NOMINMAX +#include +#endif + + +/* END PROPRIETARY CODE SEGMENT */ + /** * Setting level info table * diff --git a/layer2/ObjectVolume.cpp b/layer2/ObjectVolume.cpp index f61aa6af9..1a508ecb7 100644 --- a/layer2/ObjectVolume.cpp +++ b/layer2/ObjectVolume.cpp @@ -836,18 +836,6 @@ void ObjectVolume::render(RenderInfo * info) int volume_bit_val = SettingGet_i(G, I->Setting.get(), nullptr, cSetting_volume_bit_depth); volume_bit_depth = (volume_bit_val < 17) ? tex::data_type::HALF_FLOAT : tex::data_type::FLOAT; -/* BEGIN PROPRIETARY CODE SEGMENT (see disclaimer in "os_proprietary.h") */ -#if 0 - glTexImage3D = getTexImage3D(); - if (! glTexImage3D) { - PRINTFB(G, FB_ObjectVolume, FB_Errors) - " ObjectVolumeRender-Error: Could not bind the glActiveTexture or glTexImage3D function.\n" - ENDFB(G); - return; - } -#endif -/* END PROPRIETARY CODE SEGMENT (see disclaimer in "os_proprietary.h") */ - if (vs->textures[0]) { G->ShaderMgr->freeGPUBuffer(vs->textures[0]); vs->textures[0] = 0;