PyOpenGL GLX extension problem
Jean-Baptiste Molle <[email protected]> Fri, 29 Mar 2013 11:30:15 +0000
| Newsgroups | gmane.comp.python.opengl.user |
|---|---|
| Message-ID | <[email protected]> |
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
------------------------------------------------------------------------------
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete
for recognition, cash, and the chance to get your game on Steam.
$5K grand prize plus 10 genre and skill prizes. Submit your demo
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
_______________________________________________
PyOpenGL-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyopengl-users