Skip to content

Commit

Permalink
Fix cmgl so it compiles correctly under Windows.
Browse files Browse the repository at this point in the history
This includes setting up the correct include directories for numpy
and adding a wrapper around GL/gl.h that includes windows.h first
when under Windows.
  • Loading branch information
stump committed Mar 2, 2010
1 parent e0ded17 commit 41e7106
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/FoFiX/cmgl.pyx
Expand Up @@ -25,7 +25,7 @@
import numpy
cimport numpy

cdef extern from "GL/gl.h":
cdef extern from "glwrap.h":
ctypedef int GLint
ctypedef unsigned int GLuint
ctypedef unsigned int GLsizei
Expand Down
6 changes: 6 additions & 0 deletions src/FoFiX/glwrap.h
@@ -0,0 +1,6 @@
#ifdef _WIN32
#include <windows.h>
#endif

#include <GL/gl.h>
#include <GL/glu.h>
3 changes: 2 additions & 1 deletion src/setup.py
Expand Up @@ -25,6 +25,7 @@
# FoFiX fully unified setup script
from distutils.core import setup, Extension
import sys, glob, os
import numpy
from FoFiX import SceneFactory, Version


Expand Down Expand Up @@ -204,7 +205,7 @@ def isSystemDLL(pathname):
'packages': ['FoFiX', 'FoFiX.midi'],
'ext_package': 'FoFiX',
'ext_modules': [
Extension('cmgl', ['FoFiX/cmgl.pyx'], libraries=['opengl32' if os.name == 'nt' else 'GL']),
Extension('cmgl', ['FoFiX/cmgl.pyx'], include_dirs=[numpy.get_include()], libraries=['opengl32' if os.name == 'nt' else 'GL']),
]
})

Expand Down

0 comments on commit 41e7106

Please sign in to comment.