Results 1 to 6 of 6

Thread: OpenGL Box for Lazarus

  1. #1
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    OpenGL Box for Lazarus

    Kostas "Bad Sector" Michalopoulos has made a rather neat 'control' for Lazarus that creates an OpenGL drawing area in your LCL form.

    It works in both Windows and with the required gtk 1.x interface it works in Linux as well. Porting to the gtk 2.x interface is underway, but requires testing.

    The control falls under an MIT open source license.


    [size=9px]Check it out over at his website: OpenGL Box for Lazarus[/size]
    Jason McMillen
    Pascal Game Development
    Co-Founder





  2. #2

    OpenGL Box for Lazarus

    nice, i'm goint to study this to see how to interact with opengl on linux.
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  3. #3

    OpenGL Box for Lazarus

    , i'm goint to study this to see how to interact with opengl on linux.
    Except the creating of rendering context and tying it to your window, there's absolutely no difference. Once you got past that point, all your OpenGL code is 100% portable. Except, maybe, that the pbuffer extensions are different for Windows and Linux. For example, my system has GLX_SGIX_pbuffer,
    GLX_SGI_swap_control, etc.
    I also noticed that the Windows programs running in wine report the absence of pbuffer extensions.

  4. #4

    OpenGL Box for Lazarus

    i realise, but what i meant is which libraries handle what in linux and how it works under linux.
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  5. #5

    OpenGL Box for Lazarus

    Hmm... I created my Win/Lin window manager through pain and sweat, plunging through a lot of unknown, reading good manuals and obscure sources... Maybe I'll be able to help someway.

    Most of the functions are gathered in one dynamic library. I use libGL.so.1, it's the analog of Win's opengl32.dll.
    The most important is the GLX extension (a replacement of wgl*). AFAIK, FPC should have a "glx" unit, I can't remember exactly because I use my own modification of all the OpenGL header modules.

    My code for creating the window and initializing OpenGL could be seen here:
    http://host-17-99.imsys.net/cge/_tmpopenglexamplecode/
    Of some interest to you may be the cl_winman.inc
    ex.:[pascal]Procedure TCLWindow.SwapBuffers;
    begin
    {$ifdef unix}
    glXSwapBuffers(Display, WindowHandle);
    {$else}
    wglSwapBuffers(display);
    {$endif}
    end;[/pascal]
    all the *.h and *.inc are included in cl_hub.pp, which uses x , xlib, xutil, dl that are needed by the window manager.

    A rough and somewhat incomplete stuff, but it should give you a insight. Because it's a live thing that works.


    In short, as I understand it, the aforementioned Lazarus component was created for people to avoid this horror altogether. Probably all you need to work with opengl in linux is attach the opengl unit.

  6. #6

    OpenGL Box for Lazarus

    What's the advantage of this control over the TOpenGLControl that's already included in Lazarus ?

    Lazarus control already supports gtk1, win32, carbon (Macs). And Lazarus control has some nice features like display lists sharing. Gtk2 version of this is started but unfinished.

    (Uhm, and sorry, I don't want to sound all negative about new Lazarus control; sure it's always good to have alternatives

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •