Well. looks like the problem is a bit more dense than just deleting some 'e' ... in my code (below) , using glXGetCurrentDisplay returns a nil pointer. But using glXGetCurreentDisplay crashes the application. That is probably my fault for not initiating properly OpenGL, but i can't help being new to X.
I want to create a component/widget to render OpenGL primitives on it. In Windows i had derived a new class from TWinControl, and used its handle property to create the rendering context. In Linux there is no such class so i tried to derive a new class from TPanel (inherits from TComponent and has a handle property). In its Paint method i included the openGLinitialized check following the example of selection_demo1_kylix
Code: InitOpengl; ReadExtensions; ReadImplementationProperties; display:= glXGetCurreentDisplay; //display:=XOpenDisplay(#0); screen:= XDefaultScreen(display); attributes:= GetAttributes; visual:= glXChooseVisual(display,screen,@attributes[0]); context:= glXCreateContext(display,visual,nil,true); glwin:= QWidget_winId(Handle); glXMakeCurrent(display,glwin,context);
Using XOpenDisplay(#0) as in the demo (and probably the right option) causes no problems, but gl primitives don't show in the panel.
Using glXGetCurreentDisplay (as is now in dglGLX.pas) crashes the application, (probably because i didn't initiate correctly OpenGL, because that is the very first gl Routine I use.
And finally, using glXGetCurrentDisplay is foolish even if i delete additional e's in dglGLX.pas and recompile because it returns a nil pointer and nothing happens.
Anyone has a clue?
|