[PyOpenGL-Users] Problem with glXCreatePixmap
Brought to you by:
mcfletch
From: Jerome F. <jer...@fr...> - 2007-10-26 15:20:55
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body bgcolor="#ffffff" text="#3333ff"> Hello,<br> I tried to use the glXCreatePixmap method from the GLX package of PyOpenGL but I'm stucked with the needed parameters and don't really find some examples on how to use the python binding.<br> <br> I tried to adapt a C code to python but it fails.<br> <br> I wanted to do something like that :<br> <br> >>> from Xlib.display import Display<br> >>> from OpenGL.GLX import *<br> >>> d = Display()<br> >>> root = d.screen().root<br> >>> pixmap = root.create_pixmap(256, 256, 8)<br> >>> glXCreateWindow(d, cfg, pixmap, 0)<tt><br> </tt><br> But I got an error like "argument 1: exceptions.TypeError: expected LP__XDisplay instance instead of instance". I dn't know how I can get the needed pointer as I am in python.<br> <br> I just don't manage to find a good example of how to use the binding :(<br> <br> Would anyone have some simple scripts I could have a look at to understand how it works ?<br> <br> The final problem I'm trying to solve is the creation of a bitmap from a specific window of my x server, to incorporate it as the texture of an object of a 3D scene, if possible in real-time...<br> <br> <br> If you have some hints to help me it would be great.<br> <br> Thanks,<br> Jérôme<br> <tt></tt> </body> </html> |