Recent

Author Topic: OpenGL  (Read 6644 times)

Barak

  • Newbie
  • Posts: 6
OpenGL
« on: May 30, 2004, 02:36:13 pm »
Hi guys,
I'm after creating an OpenGL render context with Lazarus for fast multiplatform OpenGL RAD.  I have OpenGL 1.5 working great within FPC, but now I need it working within the lazarus IDE.
My ideal solution is that you can create a rectangle on the TForm and that created window is the render context.
But I have no idea where to start or how to add stuff to the LCL...
Any help GREATLY appreciated.

Bendito

  • New Member
  • *
  • Posts: 11
OpenGL
« Reply #1 on: October 17, 2004, 04:22:39 am »
There is no multiplatform solution like that. In Lazarus for Windows you can use Form1.Handle as the context, and pass it to the Windows OpenGL functions like wglCreateContext and wglMakeCurrent. In Lazarus for Linux you can't use that technique. You might try to use the XWindows OpenGL functions, but connecting them with a Lazarus form is undocumented or currently impossible. For example, how to get a PDisplay and a GLXDrawable from a Lazarus form or panel in Linux? No one here knows or is willing to say.

OpenGL is one area which is currently sorely lacking in Lazarus. We would like a simple, multiplatform OpenGL component. Something that we can stick on a window or a panel and start drawing opengl commands to it. Lots of hobbyists use Lazarus because Delphi is too expensive and Kylix is crap. Hobbyists love OpenGL. It seems logical to include a multiplatform, OpenGL component.

Note: Yes, I know it's easy to use SDL or GLUT to create OpenGL projects in Lazarus. But that's not using the power of Lazarus ... I can do the same in FPC. And SDL and GLUT are generally full-screen or full-window projects. What if I want to draw some OpenGL on part of a window, like on a panel, and have controls surrounding this panel which manipulate the 3D scene? Can't do it in Lazarus for Linux.

Lightning

  • Sr. Member
  • ****
  • Posts: 422
OpenGL
« Reply #2 on: October 17, 2004, 01:49:18 pm »
have a look at this post[/color] maybe it will help.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

Anonymous

  • Guest
OpenGL
« Reply #3 on: October 19, 2004, 04:35:10 am »
I think it might help. I will try it soon. Thank you.

Christian

  • New Member
  • *
  • Posts: 37
OpenGL
« Reply #4 on: February 01, 2005, 11:12:41 pm »
Thje code from <this post> RETURNS ALWAYS the handle opf the parent xwindow i dosend find the error if someone can fix this or has an idea please answer
thats the last step to get a.e. glsceneviewer run within linux

 

TinyPortal © 2005-2018