python pyglet和opengl [英] python pyglet and opengl

查看:134
本文介绍了python pyglet和opengl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过python获得3D功能并已下载pyglet.在阅读本的第一个示例时教程我遇到了一堆无法识别的奇怪错误.以下是我尝试运行的脚本:

I am trying to get 3D capabilities through python and have download pyglet. While going through the first example in this tutorial I got a bunch of strange errors that I cannot discern. The following is the script I am trying to run:

import pyglet

win = pyglet.window.Window()

@win.event
def on_draw():
    win.clear()

pyglet.app.run()

2以下是导入脚本后从python解释器收到的输出:

2 The following is the output I received from the python interpreter after I imported my script:

>>> import test as t
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "test.py", line 13, in <module>
    pyglet.app.run()
  File "/usr/lib/pymodules/python2.7/pyglet/app/__init__.py", line 264, in run
    EventLoop().run()
  File "/usr/lib/pymodules/python2.7/pyglet/app/xlib.py", line 93, in run
    sleep_time = self.idle()
  Fihttp://greendalecs.wordpress.com/2012/04/21/3d-programming-in-python-part-1/#commentsle "/usr/lib/pymodules/python2.7/pyglet/app/__init__.py", line 193, in idle        
    window.dispatch_event('on_draw')
  File "/usr/lib/pymodules/python2.7/pyglet/window/__init__.py", line 1219, in dispatch_event
    EventDispatcher.dispatch_event(self, *args)
  File "/usr/lib/pymodules/python2.7/pyglet/event.py", line 340, in dispatch_event
    if handler(*args):
  File "test.py", line 13, in on_draw
    pyglet.app.run()
NameError: global name 'GL_COlOR_BUFFER_BIT' is not defined

  1. 如何解决这些错误?我使用Ubuntu 12.04 LTS和Emacs 24.3.
  2. 我已经通过apt-get install下载了pyglet,但是还有什么需要做的吗?也许我没有配置驱动程序,或者我需要其他软件.
  1. How can I fix these errors? I use Ubuntu 12.04 LTS and Emacs 24.3.
  2. I have downloaded pyglet, through apt-get install but is there anything else I needed to do? Perhaps I do not have drivers configured or I need different software.

如果您需要更多信息,请告诉我!

If you need more information let me know!

推荐答案

GL_COlOR_BUFFER_BIT未定义,因为您要查找的值称为GL_CO L OR_BUFFER_BIT ...

GL_COlOR_BUFFER_BIT is undefined, because the value you are looking for is called GL_COLOR_BUFFER_BIT...

这篇关于python pyglet和opengl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆