DGL
https://delphigl.com/forum/

Bugs in dglGLX.pas
https://delphigl.com/forum/viewtopic.php?f=19&t=3399
Seite 1 von 1

Autor:  Blastomaxx [ So Okt 24, 2004 20:42 ]
Betreff des Beitrags:  Bugs in dglGLX.pas

dglGLX.pas file
{ Version 0.1a LINUX BETA }
{ Date : 11.02.2004 }

uses glXGetCurreentDisplay instead of glXGetCurrentDisplay.

Your project will compile without problems if you use glxGetCurreentDisplay, but i think the second form is the right one. I had to go through dglGLX.pas deleting the additional 'e'.

If i find anything else i'll post it under this thread :)

Autor:  Blastomaxx [ Mo Okt 25, 2004 19:24 ]
Betreff des Beitrags: 

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:
  1.   InitOpengl;
  2.   ReadExtensions;
  3.   ReadImplementationProperties;
  4.   display:= glXGetCurreentDisplay;
  5.   //display:=XOpenDisplay(#0);
  6.   screen:= XDefaultScreen(display);
  7.   attributes:= GetAttributes;
  8.   visual:= glXChooseVisual(display,screen,@attributes[0]);
  9.   context:= glXCreateContext(display,visual,nil,true);
  10.   glwin:= QWidget_winId(Handle);
  11.   glXMakeCurrent(display,glwin,context);
  12.  


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? :shock:

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/