Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Tips for programming easily-Portable OpenGL 3.3 code?

  1. #1
    Intern Newbie
    Join Date
    Jan 2018
    Posts
    42

    Tips for programming easily-Portable OpenGL 3.3 code?

    I'm writing shaders and cpu code in C++ and OpenGL, targetting version 3.3

    I'm avoiding GLUT, using GLFW because I think it has better linux compatibility




    I'm not targetting smartphones or embedded systems, but it'd be nice to be able to recompile my OpenGL programs and have them work on linux



    Tips?

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,362
    GLUT and GLFW both work fine on Linux.

    For building, use CMake, which supports Linux, Windows, and others without any mods needed on your part.

    As far as GL, once you have a context/window created, it pretty much works the same on both.

    Your platform differences are more likely to be in other areas like file I/O and threading. However, that's easily avoided by using standard libraries that work well cross-platform.

    Test frequently on multiple platforms.

  3. #3
    Intern Newbie
    Join Date
    Jan 2018
    Posts
    42
    I was mainly concerned about the GL stuff, heard rumors that ATI cards like to throw tantrums with opengl shader code and failing to unbind/disable everything that gets bound/enabled

    Thank you again, Dark Photon!

    I have always and will always appreciate your contribution!

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,362
    Quote Originally Posted by Geklmin View Post
    I was mainly concerned about the GL stuff, heard rumors that ATI cards like to throw tantrums with opengl shader code and failing to unbind/disable everything that gets bound/enabled
    That's a good point. I should qualify my statement with the fact that my experience is almost completely with NVidia's GPUs and proprietary GL drivers. I've been spoiled by their GL driver quality and consistency across Linux and Windows for over 16 years doing GL development 5 days a week.

    If you're going to be choosing a new GPU, I'd do some careful research to see which of the latest GL drivers meet your needs. I can only vouch for NVidia's.

    Hopefully someone else here with recent AMD GPU+GL driver experience on Linux will chime in with more info there. I do know that with AMD there are both AMD proprietary and open-source driver options (for instance, one post of many on that: AMD Catalyst vs. AMDGPU-PRO - Which one is better?).

Posting Permissions

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