Re: [Lazarus] OpenGL
I am using FREEGLUT under LAZARUS/FPC. No problem. Not very complicate!! If it fits to your purpose, I do not have a big experience, bug I may help you to start, even in french if better! Em 28.05.2014 12:34, Chavoux Luyt escreveu: > Hi Lazarati > > I have two questions: > 1. Have there ever been a Free Pascal implementation of OpenGL? I would like to learn OpenGL and was wondering if I will be forced to use C++/C or if there are other options. > 2. I know there are (or have been) various OpenGL Lazarus components (e.g. GLScene, NX etc) and game engines? (JEDI SDL != OpenGL?). Which would you advice me to install/use for learning OpenGL and why? I am not asking for a flame-war, so please state when it is just your opinion or else give a reason. > 3. Ultimately I would like to be able to write and use a game engine based on OpenGL (in Pascal if possible) including sound etc. > > Thanks > Chavoux > > -- > ___ > Lazarus mailing list > Lazarus@lists.lazarus.freepascal.org > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus [1] Links: -- [1] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL
> 1. Have there ever been a Free Pascal implementation of OpenGL? I would like to learn OpenGL and was wondering if I will be forced to use C++/C or if there are other options. > 2. I know there are (or have been) various OpenGL Lazarus components (e.g. > GLScene, NX etc) and game engines? (JEDI SDL != OpenGL?). Which would you > advice me to install/use for learning OpenGL and why? I am not asking for > a flame-war, so please state when it is just your opinion or else give a > reason. Based on your 2nd question, you should've known that OpenGL is perfectly accessible from Pascal. nxPascal does use OpenGL as backend, Kambi VRML also utilizes OpenGL for portability, and others as well (some also supports DirectX though). If you just want to learn OpenGL, I don't think we have Pascal specific complete tutorial as OpenGL is just an API and is language independent, though designed with C interface. So OpenGL own tutorial and reference (which is written with C in mind) should be applicable, provided you understand C and know how to convert C constructs to Pascal. I don't suggest using game engine, as it will be too complicated for learning purpose. Pure OpenGL with GLFW frontend (I also don't suggest GLUT) is good for learning. At least using pure OpenGL can get you understand the rendering pipeline, matrices (projection, rotation, etc), coloring, shading, picking (for input and feedback), etc. -- View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-OpenGL-tp4037158p4037165.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL
On Wed, May 28, 2014 at 11:34 AM, Chavoux Luyt wrote: > I have two questions: > Here're two answers: > 1. Have there ever been a Free Pascal implementation of OpenGL? I would > like to learn OpenGL and was wondering if I will be forced to use C++/C or > if there are other options. > http://wiki.freepascal.org/OpenGL 2. I know there are (or have been) various OpenGL Lazarus components (e.g. > GLScene, NX etc) and game engines? (JEDI SDL != OpenGL?). Which would you > advice me to install/use for learning OpenGL and why? I am not asking for a > flame-war, so please state when it is just your opinion or else give a > reason. > http://wiki.freepascal.org/Game_Engine http://wiki.freepascal.org/FPC_and_SDL Install the one you find the easiest tutorial for. > 3. Ultimately I would like to be able to write and use a game engine based > on OpenGL (in Pascal if possible) including sound etc. > http://wiki.freepascal.org/Audio_libraries thanks, Dmitry -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] opengl Could not find FB config
On Tue, 06 May 2014 11:00:37 +0200 Andrea Mauri wrote: > Dear all, > > I developed an application using LazOpenGLContext, one of the > application user reported me that he got an error when running my app > remotely on CentOS (kernel 2.6.32-431.5.1.el6.x86_64). The application > works locally but running remotely he got this error: > 'Could not find FB config' It means, it can not find a suitable opengl context. Maybe the remote connection does not support opengl? > My application is compiled using laz_1.0.15_r44348M_FPC_2.6.2_x86_64-linux > Could you help me trying to identify the problem? Is it possible that > some libraries is missing on the local machine? > What may I ask to better understand the problem and how to solve it? Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL with Lazarus
On 2013-05-14 15:19, Reimar Grabowski wrote: > But you still have to learn pure, low level OpenGL to use it. Ah, you seem to be right. SDL has its own cross-platform 2D API, but for the OpenGL backend the calls are the OpenGL API. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL with Lazarus
On Tue, 14 May 2013 10:32:23 +0100 Graeme Geldenhuys wrote: > On 2013-05-14 07:50, Michael Schnell wrote: > > > > AFAIK, same can use Open GL (and other) graphical backends. > > +1 > > SDL has excellent cross-platform support, and can use multiple low level > graphical backends to suite each platform. -10 SDL does not provide what the OP is looking for. The only thing you gain by using SDL is cross-plattform context creation (which Lazarus provides, too, via TOpenGLControl). But you still have to learn pure, low level OpenGL to use it. > It is under active > development, and was/is used in many game development, so we know it has > good performance too. When used for game development a 2D/3D-Engine is running on top of SDL (for example the Linux version of Quake4 uses SDL but the real work is done by the "id Tech 4" engine). All 'we' know is that these different engines seem to have good performance. You gain nothing by using SDL for OpenGL (especially not speed as SDL just provides direct OpenGL access, same as without SDL). It is used in Game Development because it is cross-plattfrom and can initialize your GL context, take care of the sound and input devices. But the real graphics work is done by some engine on top of it. So, yes, it is a good lib and used in commercial games but it is not what the OP is looking for. Both GLScene and the castle game engine are better options. @OP If the development is less game and more visualization you may also take a look at http://asmoday.sourceforge.net. R. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL with Lazarus
On 2013-05-14 07:50, Michael Schnell wrote: > > AFAIK, same can use Open GL (and other) graphical backends. +1 SDL has excellent cross-platform support, and can use multiple low level graphical backends to suite each platform. It is under active development, and was/is used in many game development, so we know it has good performance too. On a side note: I use the sound support of SDL in a commercial app, and it works very well. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL with Lazarus
What about SDL ? AFAIK, same can use Open GL (and other) graphical backends. -Michael -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL with Lazarus
Mattias Gaertner wrote: On Fri, 10 May 2013 11:47:54 +0300 Tommi Prami wrote: Hello, Is there any abstraction of OpenGL for Lazarus/FPC. I am not that interested on learning OpenGL at low level, but rather use what it can provide, a bit higher level? Similar to GlScene... (Or is there Port of GlScene for Lazarus(FPC)... ) See here http://lmgtfy.com/?q=glscene+lazarus You can also try Castle Game Engine, an open-source 3D game engine for Lazarus/FPC, see http://wiki.freepascal.org/Castle_Game_Engine and http://castle-engine.sourceforge.net/engine.php :) Michalis -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL with Lazarus
On Fri, 10 May 2013 11:47:54 +0300 Tommi Prami wrote: > Hello, > > Is there any abstraction of OpenGL for Lazarus/FPC. I am not that > interested on learning OpenGL at low level, but rather use what it can > provide, a bit higher level? > > Similar to GlScene... (Or is there Port of GlScene for Lazarus(FPC)... > ) See here http://lmgtfy.com/?q=glscene+lazarus Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL conversion
On Tue, 15 Feb 2011 10:14:33 +0200 Juha Manninen wrote: >[...] > I guess TOpenGLControl could work with Delphi, too. Feel free to create a VCL backend. A QT backend is missing too. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL conversion
Reimar Grabowski kirjoitti maanantai 14 helmikuu 2011 17:23:24: > > DeleD has types and functions defined only on Windows. > > Should be no problem if the Lazarus prog shall only run on windows. ;) No, it must run on many platforms. Otherwise it makes no sense to port it. At least I wouldn't be interested in such port. :-) [...] > > wglUseFontBitmaps > > wglUseFontOutlines > > Not available on other platforms. Can not be ported. You need to emulate > these functions (with freetype you should be able to code a multi platform > solution). Better replace them with a different text-output function. (Not > that easy) FreeType. I could ask from DeleD forum if they have an idea how to convert such code. [...] > > ChoosePixelFormat > > SetPixelFormat > > Needs to be done on context creation and is platform dependend. > TOpenGLControl does this for you in Lazarus but AFAIR it is not very > flexible regarding the PixelFormat. That is no problem if the Delphi > program does not do anything fancy (for example initializing an > akkumulation buffer or such nonsense). > [...] > > So if automatic conversion shall be achieved the converter must know about > the platform dependent differences and have functions in place to replace > the windows stuff. That is not easy to achieve especially without OpenGL > knowledge. Perhaps you want to take a look at > $LazarusDir/components/opengl/examples. You will see that the context > handling is taken care of by TOpenGLControl so you don't need most of the > windows functions you named. I fear at the moment the only way to port the > program is by hand. I guess TOpenGLControl could work with Delphi, too. The preferred way to port would be to support both Delphi and Lazarus with the same code base. If it gets too difficult then they must be separated. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL conversion
Paul Nicholls kirjoitti tiistai 15 helmikuu 2011 04:40:12: > Hi Juha, > IIRC, Freepascal/Lazarus uses the units GL.pas, and GLU.pas as opposed to > Delphi's OpenGL.pas. > > I think this is correct, and I hope this helps :) Hi Yes, that is the easy part. Delphi converter in Lazarus already replaces the unit names automatically. The problem comes with Windows specific types and calls. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL conversion
- Original Message - From: "Juha Manninen" To: "Lazarus mailing list" Sent: Monday, February 14, 2011 5:12 AM Subject: [Lazarus] OpenGL conversion Hi Are there any conversion guides or examples of how OpenGL Delphi program can be converted to Lazarus. I would try to automate it with Delphi converter but I don't know much about graphics programming myself. I am testing the converter with DeleD 3-D program which would be an extremely cool porting project. On January Birger Jansen wrote: Project conversion Delphi -> FreePascal: success! which mentions OpenGL so it seems to be possible. Juha Hi Juha, IIRC, Freepascal/Lazarus uses the units GL.pas, and GLU.pas as opposed to Delphi's OpenGL.pas. I think this is correct, and I hope this helps :) cheers, Paul -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL conversion
On Mon, 14 Feb 2011 07:51:35 +0200 Juha Manninen wrote: > DeleD has types and functions defined only on Windows. Should be no problem if the Lazarus prog shall only run on windows. ;) > At least types: > HGLRC > PixelFormatDescriptor AFAIR HGLRC is not needed on other platforms and the PFD must be ported depending on the OS specific 'glue-library' for example GLX on Linux. > and functions: > wglMakeCurrent > wglDeleteContext > wglCreateContext There are equivalent functions for other platforms glxMakeCurrent etc. (This is context handlig stuff) > wglUseFontBitmaps > wglUseFontOutlines Not available on other platforms. Can not be ported. You need to emulate these functions (with freetype you should be able to code a multi platform solution). Better replace them with a different text-output function. (Not that easy) > SwapBuffers Should call wglSwapBuffers and belongs to the context handling stuff. > ZeroMemory Don't know what it does. > ChoosePixelFormat > SetPixelFormat Needs to be done on context creation and is platform dependend. TOpenGLControl does this for you in Lazarus but AFAIR it is not very flexible regarding the PixelFormat. That is no problem if the Delphi program does not do anything fancy (for example initializing an akkumulation buffer or such nonsense). > ActivateRenderingContext Don't know what it does. > There are more... So if automatic conversion shall be achieved the converter must know about the platform dependent differences and have functions in place to replace the windows stuff. That is not easy to achieve especially without OpenGL knowledge. Perhaps you want to take a look at $LazarusDir/components/opengl/examples. You will see that the context handling is taken care of by TOpenGLControl so you don't need most of the windows functions you named. I fear at the moment the only way to port the program is by hand. R. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL conversion
Reimar Grabowski kirjoitti maanantai 14 helmikuu 2011 05:44:18: > For OpenGL calls no conversion should be needed. GL works the same > independent of language/OS (except context handling and some OS-specific > extensions WGL_*, GLX_*, etc.). OpenGL is just a bunch of commands which > go directly to the graphics driver. > > > I would try to automate it with Delphi converter but I don't know much > > about graphics programming myself. > > Just go ahead. If you have any problems ask again. I know a thing or two > about OpenGL and graphics programming in general. DeleD has types and functions defined only on Windows. At least types: HGLRC PixelFormatDescriptor and functions: wglMakeCurrent wglDeleteContext wglCreateContext wglUseFontBitmaps wglUseFontOutlines SwapBuffers ZeroMemory ChoosePixelFormat SetPixelFormat ActivateRenderingContext There are more... Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL conversion
On Sun, 13 Feb 2011 18:39:37 +0100 Bo Berglund wrote: > What about GLScene? Isn't that project restarted and with FPC/Lazarus > support? > http://wiki.lazarus.freepascal.org/GLScene GLScene <> pure OpenGL If the Delphi code uses GLScene, you need it on Lazarus as well. If it does not, GLScene does not help. R. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL conversion
On Sun, 13 Feb 2011 20:12:48 +0200 Juha Manninen wrote: > Hi > > Are there any conversion guides or examples of how OpenGL Delphi program can > be converted to Lazarus. For OpenGL calls no conversion should be needed. GL works the same independent of language/OS (except context handling and some OS-specific extensions WGL_*, GLX_*, etc.). OpenGL is just a bunch of commands which go directly to the graphics driver. > I would try to automate it with Delphi converter but I don't know much about > graphics programming myself. Just go ahead. If you have any problems ask again. I know a thing or two about OpenGL and graphics programming in general. R. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL conversion
On Sun, 13 Feb 2011 20:12:48 +0200, Juha Manninen wrote: >Hi > >Are there any conversion guides or examples of how OpenGL Delphi program can >be converted to Lazarus. >I would try to automate it with Delphi converter but I don't know much about >graphics programming myself. > >I am testing the converter with DeleD 3-D program which would be an extremely >cool porting project. > >On January Birger Jansen wrote: > Project conversion Delphi -> FreePascal: success! >which mentions OpenGL so it seems to be possible. > > What about GLScene? Isn't that project restarted and with FPC/Lazarus support? http://wiki.lazarus.freepascal.org/GLScene -- Bo Berglund Developer in Sweden -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] OpenGL conversion
I succesfully ported my Ballanced Game from Delphi OpenGL to Lazarus OpenGL ( Linux, Win compatible ) but i had to do many things by hand. Maybe my [url=http://corpsman.de/index.php?doc=opengl/clear_engine]Clear Engine[/url] sample could give you a little hint to succesfully port your Application. Here i use the TOpenGLControl component which is part Lazarus ( only need to be installed with the package graph ) sincerely Corpsman -- Auf meiner Homepage www.Corpsman.de ist immer was los, ständig wird sie aktualisiert und erweitert. Da ist für jeden was dabei. -Ursprüngliche Nachricht- Von: "Juha Manninen" Gesendet: Feb 13, 2011 7:12:48 PM An: "Lazarus mailing list" Betreff: [Lazarus] OpenGL conversion >Hi > >Are there any conversion guides or examples of how OpenGL Delphi program can >be converted to Lazarus. >I would try to automate it with Delphi converter but I don't know much about >graphics programming myself. > >I am testing the converter with DeleD 3-D program which would be an extremely >cool porting project. > >On January Birger Jansen wrote: > Project conversion Delphi -> FreePascal: success! >which mentions OpenGL so it seems to be possible. > > >Juha > >-- >___ >Lazarus mailing list >Lazarus@lists.lazarus.freepascal.org >http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus ___ Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://produkte.web.de/go/toolbar -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] opengl and qt
On Friday 11 June 2010 12:41, Mattias Gaertner wrote: > On Fri, 11 Jun 2010 12:34:54 +0200 > > Andrea Mauri wrote: > > I would like to ask if openglcontext works with qt too. > > If you mean the package lazopenglcontext: no, this is a ToDo. > In general: yes, you can use opengl with qt. no, opengl isn't supported yet in qt C bindings or qtlcl. http://bugs.freepascal.org/view.php?id=15589 zeljko -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] opengl and qt
On Fri, 11 Jun 2010 12:34:54 +0200 Andrea Mauri wrote: > I would like to ask if openglcontext works with qt too. If you mean the package lazopenglcontext: no, this is a ToDo. In general: yes, you can use opengl with qt. Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] opengl and compiz
thanks to all. i have an ati video card that causes me a lot of problems with my linux box. anyway i will disable compiz (i don't like it, i used it just for testing my app). regards, andrea Aleš Katona ha scritto: Compiz/linux currently is very touchy depending on your card, kernel and distro (xorg version). If you have say Ubuntu 9.04 with kernel .28 and the new xorg and you have intel or ati (pre r500, no longer officialy fglrx driver supported) cards you're pretty much screwed when it comes to openGL. Compiz itself works, but opengl is only up to 1.3 version and has bugged compozing (due to kernel mode setting not being in the kernel yet). All this should change in .30 and .31 kernels and with latest drivers and xorg, although I wouldn't hold my breath for openGL 2.0 functionality (on the bright side, these changes they are making will be great for all the OSS 3d drivers). It's one of those big OSS overhauls. So atm. if openGL is fishy and you don't have closed source drivers, don't fuss about it much :) Ales P.S: for more info, see the phoronix forums and articles -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- Dr. Andrea Mauri, PhD Milano Chemometrics and QSAR Research Group Department of Environmental Sciences University of Milano-Bicocca P.zza della Scienza, 1 20126 Milano - Italy Tel: ++39 02 64482801 mailto:andrea.mauri...@gmail.com http://michem.disat.unimib.it/chm/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] opengl and compiz
Compiz/linux currently is very touchy depending on your card, kernel and distro (xorg version). If you have say Ubuntu 9.04 with kernel .28 and the new xorg and you have intel or ati (pre r500, no longer officialy fglrx driver supported) cards you're pretty much screwed when it comes to openGL. Compiz itself works, but opengl is only up to 1.3 version and has bugged compozing (due to kernel mode setting not being in the kernel yet). All this should change in .30 and .31 kernels and with latest drivers and xorg, although I wouldn't hold my breath for openGL 2.0 functionality (on the bright side, these changes they are making will be great for all the OSS 3d drivers). It's one of those big OSS overhauls. So atm. if openGL is fishy and you don't have closed source drivers, don't fuss about it much :) Ales P.S: for more info, see the phoronix forums and articles -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] opengl and compiz
On Tue, 18 Aug 2009 23:29:54 +0200 Andrea Mauri wrote: > Dear Mattias, > I think that is related to how lazarus manage opengl. I cannot really confirm this. My code works fine with or without compiz. But I must admit that I see the same resize problems you do when I use a complex offscreen framebuffer structure with compiz enabled. I did not have the time to trace the origin of the troubles but I don't think it is related to Lazarus (although it is possible). Simple framebuffer setups don't show any problems but I always use the resize event to correctly setup projection matrix and viewport. > I tried another example with TOpenGLControl and I get the same behaviour. I have just tested your code and it looks like there is a problem with the OnClick event of the control. Lots of clicks are 'lost' if compiz is enabled. But it does not seem to be a problem with the minimizing else my code should show the problem, too, and I can get your code the show the cube even after minimizing and restoring the window. If I find some time I will try to look a little bit deeper. > Any ideas? Perhaps your driver/card don't play nicely with compiz. Compiz sometimes shows problems with all kind of stuff (mostly task bars and window decorations). So I advise you to disable it while developing or using windowed OpenGL programs (btw fusion-icon makes this window manager switching easy). It may be a problem with GLScene but the 'lost' OnClick events look like there is some trouble with Lazarus, too. hih Reimar P.S.: And while we are talking about compiz issues. I have observed that my framerate increases if I have the mouse pointer over the OpenGLControl (which I think is really strange behaviour). Do you see the same effect? -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] opengl and compiz
Dear Mattias, I think that is related to how lazarus manage opengl. I tried another example with TOpenGLControl and I get the same behaviour. I put a TOpenGLControl on a form then I just copied a piece of code (from the example on TOpenGLControl in Components/Examples) in order to draw a cube after a click on the TOpenGLControl. When I click on the OpenGLControl1 the cube is correctly painted both with and without compiz. With compiz disabled if I minimize the form and then restore it the OpenGLControl1 is not visible but if I click on it the OpenGLControl1 appears again and the cube too. With Compiz enabled if I minimize the form and then restore it the OpenGLControl1 is not visible neither if I click on it the OpenGLControl1 again. Oviously the cube is not visible. Any ideas? andrea Here the code I used. unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, OpenGLContext, GL, GLU; type { TForm1 } TForm1 = class(TForm) OpenGLControl1: TOpenGLControl; procedure OpenGLControl1Click(Sender: TObject); private { private declarations } public { public declarations } cube_rotationx: GLFloat; cube_rotationy: GLFloat; cube_rotationz: GLFloat; end; var Form1: TForm1; implementation { TForm1 } procedure TForm1.OpenGLControl1Click(Sender: TObject); var Speed: Double; begin if Sender=nil then ; glClearColor(1.0, 1.0, 1.0, 1.0); glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); glEnable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0, double(width) / height, 0.1, 100.0); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(0.0, 0.0,-6.0); glRotatef(cube_rotationx, cube_rotationy, cube_rotationz, 0.0); glBegin(GL_QUADS); glColor3f(0.0,1.0,0.0); // Set The Color To Green glVertex3f( 1.0, 1.0,-1.0); // Top Right Of The Quad (Top) glVertex3f(-1.0, 1.0,-1.0); // Top Left Of The Quad (Top) glVertex3f(-1.0, 1.0, 1.0); // Bottom Left Of The Quad (Top) glVertex3f( 1.0, 1.0, 1.0); // Bottom Right Of The Quad (Top) glEnd(); glBegin(GL_QUADS); glColor3f(1.0,0.5,0.0); // Set The Color To Orange glVertex3f( 1.0,-1.0, 1.0); // Top Right Of The Quad (Bottom) glVertex3f(-1.0,-1.0, 1.0); // Top Left Of The Quad (Bottom) glVertex3f(-1.0,-1.0,-1.0); // Bottom Left Of The Quad (Bottom) glVertex3f( 1.0,-1.0,-1.0); // Bottom Right Of The Quad (Bottom) glEnd(); glBegin(GL_QUADS); glColor3f(1.0,0.0,0.0); // Set The Color To Red glVertex3f( 1.0, 1.0, 1.0); // Top Right Of The Quad (Front) glVertex3f(-1.0, 1.0, 1.0); // Top Left Of The Quad (Front) glVertex3f(-1.0,-1.0, 1.0); // Bottom Left Of The Quad (Front) glVertex3f( 1.0,-1.0, 1.0); // Bottom Right Of The Quad (Front) glEnd(); glBegin(GL_QUADS); glColor3f(1.0,1.0,0.0); // Set The Color To Yellow glVertex3f( 1.0,-1.0,-1.0); // Bottom Left Of The Quad (Back) glVertex3f(-1.0,-1.0,-1.0); // Bottom Right Of The Quad (Back) glVertex3f(-1.0, 1.0,-1.0); // Top Right Of The Quad (Back) glVertex3f( 1.0, 1.0,-1.0); // Top Left Of The Quad (Back) glEnd(); glBegin(GL_QUADS); glColor3f(0.0,0.0,1.0); // Set The Color To Blue glVertex3f(-1.0, 1.0, 1.0); // Top Right Of The Quad (Left) glVertex3f(-1.0, 1.0,-1.0); // Top Left Of The Quad (Left) glVertex3f(-1.0,-1.0,-1.0); // Bottom Left Of The Quad (Left) glVertex3f(-1.0,-1.0, 1.0); // Bottom Right Of The Quad (Left) glEnd(); glBegin(GL_QUADS); glColor3f(1.0,0.0,1.0); // Set The Color To Violet glVertex3f( 1.0, 1.0,-1.0); // Top Right Of The Quad (Right) glVertex3f( 1.0, 1.0, 1.0); // Top Left Of The Quad (Right) glVertex3f( 1.0,-1.0, 1.0); // Bottom Left Of The Quad (Right) glVertex3f( 1.0,-1.0,-1.0); // Bottom Right Of The Quad (Right) glEnd(); Speed := double(OpenGLControl1.FrameDiffTimeInMSecs)/10; cube_rotationx += 5.15 * Speed; cube_rotationy += 5.15 * Speed; cube_rotationz += 20.0 * Speed; OpenGLControl1.SwapBuffers; end; initialization {$I unit1.lrs} end. I doubt that this is related. The
Re: [Lazarus] opengl and compiz
On Mon, 17 Aug 2009 21:04:19 +0200 Andrea Mauri wrote: > Dear all, > I saw that the bug ID 0011740 (OpenGLControl stutters with Compiz > enabled ) is solved. Anyway I still encounter some problems using > opengl when compiz is enabled. > I don't know if it is related to the previous bug. Running the pick > demo of GLScene now I don't see flickering anymore but if I minimize > the pick form and then I restore it the opengl scene disappearas. I doubt that this is related. The bug was too many queries. This seems more as if an size event is ignored. Have you asked the glscene developers? Mattias -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] opengl and compiz
sorry I forgot to mention: Lazarus 0.9.27 r21258M FPC 2.2.4 i386-linux-gtk 2 (beta) Ubuntu Jaunty andrea Andrea Mauri ha scritto: Dear all, I saw that the bug ID 0011740 (OpenGLControl stutters with Compiz enabled ) is solved. Anyway I still encounter some problems using opengl when compiz is enabled. I don't know if it is related to the previous bug. Running the pick demo of GLScene now I don't see flickering anymore but if I minimize the pick form and then I restore it the opengl scene disappearas. Regards, Andrea -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus