Skip to content

Commit

Permalink
Remove windows.h inclusion from many headers
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrettSJohnson committed Aug 13, 2024
1 parent edf1f43 commit 97a53fb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 52 deletions.
10 changes: 3 additions & 7 deletions contrib/vr/OpenVRControllerModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ SOFTWARE.
#include "OpenVRControllerModel.h"

// system headers
#include <chrono>
#include <vector>
#include "os_std.h"
#include "os_gl.h"
Expand Down Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions layer0/ShaderMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
13 changes: 0 additions & 13 deletions layer0/ShaderMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions layer0/os_proprietary.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,4 @@ Z* -------------------------------------------------------------------
* CODE SEGMENTS.
*/


/* BEGIN PROPRIETARY CODE SEGMENT */
#ifdef WIN32
#define NOMINMAX
#include<windows.h>
#endif


/* END PROPRIETARY CODE SEGMENT */

#endif
10 changes: 10 additions & 0 deletions layer1/Setting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ Z* -------------------------------------------------------------------
#include"OpenVRMode.h"
#endif


/* BEGIN PROPRIETARY CODE SEGMENT */
#ifdef WIN32
#define NOMINMAX
#include<windows.h>
#endif


/* END PROPRIETARY CODE SEGMENT */

/**
* Setting level info table
*
Expand Down
12 changes: 0 additions & 12 deletions layer2/ObjectVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 97a53fb

Please sign in to comment.