[PyOpenGL-Users] PyOpenGL GLX extension problem
Brought to you by:
mcfletch
|
From: Jean-Baptiste M. <jb...@ho...> - 2013-03-29 11:30:23
|
Hi,
I'm trying to create a program with PyOpenGL but I'm stuck with a GLX problem.
Here is my code:
# pixmap is the XID of an X Pixmap
from OpenGL import GLX, GL
from OpenGL.raw._GLX_NV import glXBindTexImageEXT #I have an NVidia graphic card
d = GLX.glXGetCurrentDisplay()
elements = c_int()
configs = GLX.glXChooseFBConfig(d, 0, None, byref(elements))
glxpix = GLX.glXCreatePixmap(d, configs[12], pixmap, None)
GL.glEnable(GL.GL_TEXTURE_2D)
texture_id = GLuint()
GL.glGenTextures(1, texture_id)
glXBindTexImageEXT(d, glxpix, GLX.GLX_FRONT_EXT, None)
When I run the program I got an error:
ctypes.ArgumentError: argument1: : expected LP_struct__XDisplay instance instead of LP_struct__XDisplay
How can I solve this problem?
Also in all the examples I've seen, it is written:
configs = GLX.glXChooseFBConfig(d, 0, None, byref(elements))
How could I pass attribList to glXChooseFBConfig?
Instead of sending None, I would like to have attribList = {
GLX_BIND_TO_TEXTURE_RGBA_EXT, True,
GLX_DRAWABLE_TYPE, GLX_PIXMAP_BIT,
GLX_BIND_TO_TEXTURE_TARGETS_EXT, GLX_TEXTURE_2D_BIT_EXT,
GLX_DOUBLEBUFFER, False,
GLX_Y_INVERTED_EXT, GLX_DONT_CARE,
None
}
But if I write configs = GLX.glXChooseFBConfig(d, 0, attribList, byref(elements)), I get this error:
ctypes.ArgumentError: argument 3: <type 'exceptions.TypeError'>: expected LP_c_int instance instead of set
Thanks a lot for your help,
JB
|