Re: [PyOpenGL-Users] Install/version Trouble?
Brought to you by:
mcfletch
|
From: Adam S. <avs...@gm...> - 2014-03-11 01:51:10
|
On Thu, Mar 6, 2014 at 10:39 PM, Ian Mallett <ia...@ge...> wrote:
> On Thu, Mar 6, 2014 at 8:29 PM, Adam Steele <avs...@gm...> wrote:
>
>> PyOpenGL-3.0.2.win-amd64.exe
>> on a "from OpenGL.GL import *" this gives me error that look like some
>> conversion from python 2.x didn't take (some exceptions are of the form
>> "Exception Blah, err:")
>>
> You'll have to be more specific than that.
>
>
python 3.3 x64, install PyOpenGL-3.0.2.win-amd64.exe
then run file:
------------------------------
from OpenGL.GL import *
if __name__ == '__main__':
pass
-----------------------
I get error:
-------------------------
Traceback (most recent call last):
File "C:\Users\ADAM\workspace\oGL_examples\src\PyOpenGL_test\testbed.py",
line 13, in <module>
from OpenGL.GL import *
File "C:\Python33\lib\site-packages\OpenGL\GL\__init__.py", line 3, in
<module>
from OpenGL.GL.VERSION.GL_1_1 import *
File "C:\Python33\lib\site-packages\OpenGL\GL\VERSION\GL_1_1.py", line
10, in <module>
from OpenGL import platform, constants, constant, arrays
File "C:\Python33\lib\site-packages\OpenGL\platform\__init__.py", line
35, in <module>
_load()
File "C:\Python33\lib\site-packages\OpenGL\platform\__init__.py", line
26, in _load
plugin_class = plugin.load()
File "C:\Python33\lib\site-packages\OpenGL\plugins.py", line 14, in load
return importByName( self.import_path )
File "C:\Python33\lib\site-packages\OpenGL\plugins.py", line 28, in
importByName
module = __import__( ".".join(moduleName), {}, {}, moduleName)
File "C:\Python33\lib\site-packages\OpenGL\platform\win32.py", line 25
except OSError, err:
^
SyntaxError: invalid syntax
----------------------------------
PyOpenGL-3.1.0b1.win-amd64.exe
>> This one installs and lets me do an import, but a simple command like
>> "glGetString(GL_VERSION)" returns "None"
>>
> You'll have to be more specific than that. At a guess (if you only did
> this line), then that's to be expected; OpenGL commands require an OpenGL
> context before they will work.
>
>
>
Thank you for the heads up. I'm moving over from Pyglet, which evidently
opens a context upon import.
For reference the two file was as below, whre i get the error for the
OpenGL import, this makes sense if you need a context as you say. Thanks
------------------------------
from OpenGL.GL import *
# or
# from pyglet.gl import *
import ctypes
if __name__ == '__main__':
ver=glGetString(GL_VERSION)
print(ctypes.string_at(ver,30))
-------------------------------------------
|