Results 1 to 10 of 10

Thread: OpenGL info

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Template to expand:

    Code:
    uses
      dglOpenGL,  // https://github.com/SaschaWillems/dglOpenGL
      Inifiles;
    
    procedure glInfoToDisk;
    var
      Ini: TCustomIniFile;
      Path: String;
    
      StatusI: GLint;
    
    begin
      // Check if openGL initialized
      if not assigned(glGetIntegerv) then
        begin
          raise Exception.Create('glInfoToDisk: openGL not initialized');
          exit;
        end;
    
    // Make folder
    {$IOChecks off}
      MkDir('Debug');
    {$IOChecks on}
    
    // Set path
      Path:= ExtractFilePath(Application.ExeName)+'\Debug';
    
    // Check path exists
      if not DirectoryExists(Path) then begin
        raise Exception.Create('glInfoToDisk: cannot create folder');
        exit;
      end;
    
    // Create file
      Ini := TInifile.Create(Path+'\OpenGLinfo.ini');
    
      try
        // Total textures available
        StatusI := -1;
        glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, @StatusI);
        Ini.WriteInteger('OpenGLInfo', 'GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS', StatusI);
    
        // Texutres available per shader
        StatusI := -1;
        glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, @StatusI);
        Ini.WriteInteger('OpenGLInfo', 'GL_MAX_TEXTURE_IMAGE_UNITS', StatusI);
    
        // openGL version
        Ini.WriteString('OpenGLInfo', 'GL_VERSION', glGetString(GL_VERSION));
    
      finally
    
        Ini.Free;
    
      end;
    
    end;
    [OpenGLInfo]
    GL_MAX_TEXTURE_IMAGE_UNITS=32
    GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS=192
    Last edited by Thyandyr; 19-10-2017 at 09:03 AM.

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
  •