Menu

Detect if OpenGL is installed

Help
2018-04-05
2018-04-06
  • shine world

    shine world - 2018-04-05

    There is a way/method to programatically know if OpenGL is installed and available ?

    I've fall in case where end-user had installed W10 with default svga driver froms MS but not the SiS Motherboard GPU drivers.

    At first sight all was working: video, directx, etc. but MS don't install OpenGL so my GLScene based program crash at loading stage. Was hard to understand the reason of issue, so I would like to test if opengl is available just at first lines of code before to load glscene based forms.

    Thank you very much !!!

     

    Last edit: shine world 2018-04-05
  • Jerome.D (BeanzMaster)

    Hi, in OpenGLAdpater unit you have those functions :

    procedure CloseOpenGL;
    function InitOpenGL: boolean;
    function InitOpenGLFromLibrary(const GLName, GLUName: string): boolean;
    function IsOpenGLInitialized: boolean;
    
    // compatibility routines
    procedure UnloadOpenGL;
    function LoadOpenGL: boolean;
    function LoadOpenGLFromLibrary(GLName, GLUName: string): boolean;
    function IsOpenGLLoaded: boolean;
    

    In your formcreate event try to use

     If not(InitOpenGL) then ....
     or
     if not(LoadOpenGL) then....
    

    for gettting more infos check GLInfo unit in Designtime folder or check GLInfo demo in Examples/Shader folder

     
  • shine world

    shine world - 2018-04-06

    Thank you very much Jerome.

    Program is growing every day.
    In next month I will finish the simulator part so can be full used also without CNC, also to learn g-code or evaluate a final work.

    Just some video: https://www.youtube.com/user/thoth2487/videos

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.