PDA

View Full Version : glXMakeCurrent fails



Alien999999999
03-22-2003, 01:06 AM
in the init I called glXChooseVisual successfully, after that a glXCreateContext, also successfully, but the glXMakeCurrent fails...

does anybody have any idea what is going wrong?

(it's my first opengl testing sample)

Alien999999999
03-25-2003, 01:10 AM
can anybody help me please?

plastichead
03-25-2003, 01:34 PM
Please give some example code.

Alien999999999
03-26-2003, 06:44 AM
Originally posted by plastichead:
Please give some example code.

vinfo := glXChooseVisual(display, XDefaultScreen(display), @attr[0]);
if vinfo = nil then Error('no visual satisfies requirement');
result := glXCreateContext(display, vinfo, 0, true);
XFree(vinfo);
if result = nil then Error('cannot create gl context');
if not glxMakeCurrent(display, drawable, result) then
Error('glXMakeCurrent failed: '+IntToStr(integer(display))+' : '+IntToStr(drawable)+' : '+IntToStr(integer(result)));

plastichead
03-26-2003, 01:50 PM
Are your display and drawable valid (drawable != 0 and display opened with XOpenDisplay())?

plastichead
03-26-2003, 01:55 PM
A general programming tip: Reduce your code to a minimum that works.

In your case it seems that you can't do this, so reduce your code to a minimum you think that *should* work. Then post it here, please.