Mearah 0 Newbie Poster

Hey there,

I am going to start a larger project. For this I just set up my programming invironment as follows:

python2.5
numpy
scipy
matlibplot
PyOpenGL
ctypes

I then tried to test the installation with a simple example. First I found the warning:
No handlers could be found for logger "OpenGL.ctypes"
Fixing this was easy. In the GLUT-package you find the __init__.py and you just have to do this

import logging
logging.basicConfig()

The code-example:

import sys

try:
    from OpenGL.GLUT import *
    #from OpenGL.raw.GLUT import *
    from OpenGL.GL import *
    from OpenGL.GLU import *
except:
    print "ERROR: PyOpenGL not installed properly."


def init():
    glClearColor (0.0, 0.0, 0.0, 0.0)
    glShadeModel (GL_FLAT)

def display():
    glClear (GL_COLOR_BUFFER_BIT)
    glColor3f (1.0, 1.0, 1.0)
    glLoadIdentity ()             # clear the matrix
    # viewing transformation
    gluLookAt (0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
    glScalef (1.0, 2.0, 1.0)      # modeling transformation
    glutWireCube (1.0)
    glFlush ()

def reshape (w, h):
    glViewport (0, 0, w, h)
    glMatrixMode (GL_PROJECTION)
    glLoadIdentity ()
    glFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0)
    glMatrixMode (GL_MODELVIEW)

def keyboard(key, x, y):
    if key == chr(27):
       import sys
       sys.exit(0)

glutInit(sys.argv)
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE)
glutInitWindowSize(500, 500)
glutInitWindowPosition(100, 100)
glutCreateWindow('cube')
init ()
glutDisplayFunc(display)
glutReshapeFunc(reshape)
glutKeyboardFunc(keyboard)
glutMainLoop()

was fine on a Suse 10.3. For some reasons I have to use a windows vista pro system (64 bit) and in the end transfer the project to an .exe

So, on this system I get some problems with all functions that are related to the glutInit:

Traceback (most recent call last):
File "<string>", line 74, in run_nodebug
File "C:\Users\Admin\Documents\Programmierung\Beispiele\redbookcube.py", line 94, in <module>
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE)
File "c:\python25\lib\site-packages\pyopengl-3.0.0b5.0002_s-py2.5.egg\OpenGL\platform\baseplatform.py", line 302, in __call__
self.__name__, self.__name__,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInitDisplayMode, check for bool(glutInitDisplayMode) before calling

the lines are some kind of different so that
line 74 over here is line 19
line 94 is line 39

Maybe one can help me to erase this to errors.
On the second error:
It says "undefined function" but, in the Glut __init__ if find that:

# /usr/include/GL/freeglut_std.h 387
glutInitDisplayMode = platform.createBaseFunction( 
	'glutInitDisplayMode', dll=platform.GLUT, resultType=None, 
	argTypes=[c_uint],
	doc='glutInitDisplayMode( c_uint(displayMode) ) -> None', 
	argNames=('displayMode',),
)

when I comment the line I get the same error with the next function of glutInit (e.g. glutInitWindowSize...)

Thanks for answers.
Mearah