Results 1 to 10 of 10

Thread: OpenGL 3.2+ with FPC on the Mac?

  1. #1

    OpenGL 3.2+ with FPC on the Mac?

    I am back to a problem that has been left unsolved for over a year. I have tried once in a while but get nowhere. Last year, I switched to OpenGL 3.2 in my teaching work. (3.2 essentially means moving to modern OpenGL. There is a big difference between OpenGL 2 and 3 while OpenGL 4 isn't all that different.)

    Working with modern OpenGL from C is no problem (except for the uncomfortable language). Of course I want to use FPC for my private projects! So I haven converted my simplest GL 3.2 demo to FPC. However, Load_GL_version_3_2 (in glext) does not help, it returns false, and then the program crashes since the OpenGL calls aren't installed properly. BTW, the OpenGL context is created for 3.2.

    Is this a known problem? Anyone else who have tried? Any solutions?

  2. #2
    To be a bit more precise...

    Load_GL_VERSION_3_2 fails when getting glProgramParameteri, Load_GL_VERSION_3_2 returns false.

    If I comment that out, it crashes in glGetString (several places).

    What can I do? Make C glue between FPC and OpenGL? But OpenGL works so well from FPC up to 2.1, why not now?

  3. #3
    Try posting this on FPC forums. I don't think there are any core FPC devs here. Also until you get proper fix, yes it would be good to make c/c++ glue here.

  4. #4
    I'll do that. I asked in the Mac Pascal list long ago and nobody knew anything, so I hoped that the game developers here might be more up to date. Thanks!

    How about Linux and Windows, are you using 3.2+ without problems?

  5. #5
    I don't use OGL. I'm mainly 2D guy and if I feel going 3D, I mainly use already made engine such as Unity or CraftStudio.

  6. #6
    Have you tried using our dglOpenGL.pas OpenGL Header? It works with Delphi and FPC and supports the latest OpenGL version (4.3). I haven't tested it on MacOSX, but at least on Windows and Linux GL 3.x and GL 4.x works fine.

  7. #7
    I think that the GL interface shipped with FPC is based on dglOpenGL. But I think that the problem is that it isn't designed for the strict split between core and compatibility mode OpenGL that the Mac uses.

    I have an idea about how I could change the interface but I fear that it might be complicated.

  8. #8
    Quote Originally Posted by Ingemar View Post
    I think that the GL interface shipped with FPC is based on dglOpenGL.
    If that is so make sure that FPC is using latest dglOpenGL headers as it is not necessary it does.

  9. #9
    I'm also using dglOpenGL header with FPC under windows. I've read somewhere that it's better to use it than those shipped with lazarus. Project works ok on both cards in my laptop, opengl 3.1 and 4.2 modes

  10. #10
    I managed to hack glext to work. The biggest problem (also present in dglOpenGL but only in a few places) is incorrect use of glGetString, using the obsolete GL_EXTENSION constant. Also, VAO support was dependent on the GL_ARB_vertex_array_object extension, which failed due to the nonworking glGetString (which shouldn't affect core VAO calls).

    I didn't try dglOpenGL since I had no example made for it. It is most likely better but I was discouraged since it included the same bug.

Tags for this Thread

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
  •  
Comodo SSL