0

升级到 Delphi XE5 和最新的 GLScene 后,在某些 PC 上,TGLSceneForm 会使应用程序完全崩溃(请参阅下面的日志文件)。但是,如果我使用完全相同的应用程序并在 Delphi 2010(使用旧版本的 GLScene)中编译它,它就可以完美运行!

它仅在某些 PC 上执行此操作。例如,我们办公室有 3 个 HP 工作站,XE5 应用程序 2 个工作正常,1 个崩溃(具有不同的图形适配器)。然而,在 Delphi 2010 中编译时,所有 3 台 PC 的工作都正常!

应用程序中的 GLScene 日志文件是:

Thread ID 12776 0    (i)  Log subsystem started in elapsed time mode.
Thread ID 12776 0    (i)  Logging [debug info (D), info (i), notices (M), warnings (W), errors (Er), fatal errors (!!)]
Thread ID 12776 0    (i)  Buffered mode: False
Thread ID 12776 0    (M)  Service thread started
Thread ID 12776 234  (i)  Temporary rendering context created
Thread ID 12776 234  (M)  Getting OpenGL entry points and extension
Thread ID 12776 234  (M)  
Thread ID 12776 234  (i)  OpenGL rendering context information:
Thread ID 12776 234  (i)  Renderer     : AMD Radeon HD 6570  
Thread ID 12776 234  (i)  Vendor       : ATI Technologies Inc.
Thread ID 12776 250  (i)  Version      : 4.1.10765 Compatibility Profile Context
Thread ID 12776 250  (i)  GLSL version : 4.10
Thread ID 12776 250  (M)  
Thread ID 12776 297  (M)  Getting OpenGL entry points and extension
Thread ID 12776 312  (i)  Backward compatible core PBuffer context successfully created
Thread ID 12776 312  (M)  Service context successfuly initialized
Thread ID 7680  1311     (i)  Temporary rendering context created
Thread ID 7680  1311     (M)  Getting OpenGL entry points and extension
Thread ID 7680  1311     (i)  Temporary rendering context destroyed
Thread ID 7680  1358     (M)  Getting OpenGL entry points and extension
Thread ID 7680  1373     (D)  glDebugMessageEnableAMD parameter <category> has an invalid enum '0x1' (GL_INVALID_ENUM)

示例代码如下:

program GLSceneError;

uses
  EMemLeaks,
  EResLeaks,
  EDialogWinAPIMSClassic,
  EDialogWinAPIEurekaLogDetailed,
  EDialogWinAPIStepsToReproduce,
  EDebugExports,
  EFixSafeCallException,
  EMapWin32,
  EAppVCL,
  ExceptionLog7,
  Vcl.Forms,
  ufrmMain in 'ufrmMain.pas' {frmMain},
  ufrmGLScene in 'ufrmGLScene.pas' {frmGLScene: TGLSceneForm};

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TfrmMain, frmMain);
  Application.Run;
end.

unit ufrmMain;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TfrmMain = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmMain: TfrmMain;

implementation

{$R *.dfm}

uses ufrmGLScene;

procedure TfrmMain.Button1Click(Sender: TObject);
begin
  try
    if not Assigned(frmGLScene) then
      Application.CreateForm(TfrmGLScene, frmGLScene);

    frmGLScene.Show;
  except
    on E: Exception do
    begin
      ShowMessage(E.Message);
    end;
  end;
end;

end.

object frmMain: TfrmMain
  Left = 0
  Top = 0
  Caption = 'frmMain'
  ClientHeight = 182
  ClientWidth = 199
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object Button1: TButton
    Left = 32
    Top = 32
    Width = 141
    Height = 57
    Caption = 'Open GLScene Viewer'
    TabOrder = 0
    OnClick = Button1Click
  end
end

unit ufrmGLScene;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  GLScene, GLSceneForm;

type
  TfrmGLScene = class(TGLSceneForm)
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmGLScene : TfrmGLScene;

implementation

{$R *.dfm}

end.

object frmGLScene: TfrmGLScene
  Left = 246
  Top = 74
  Caption = 'GLScene'
  ClientHeight = 326
  ClientWidth = 405
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  Position = poMainFormCenter
  Buffer.BackgroundColor = 2064383
  FullScreenVideoMode.Width = 1920
  FullScreenVideoMode.Height = 1080
  FullScreenVideoMode.ColorDepth = 32
  FullScreenVideoMode.Frequency = 50
  PixelsPerInch = 96
  TextHeight = 13
end

我不知道该转向哪里,因为这似乎是自升级到 XE5 以来 GLScene 的某种基本问题。我无法推出需要我们所有客户对图形适配器进行故障排除的软件,特别是因为它在完全相同的 PC 上运行 Delphi 2010,所以我知道不是我们的程序导致了问题。

任何想法或帮助将不胜感激。瑞克。

4

1 回答 1

2

错误很明显:

glDebugMessageEnableAMD parameter <category> has an invalid enum '0x1' (GL_INVALID_ENUM)

自 4.3 版以来,调试消息一直是 OpenGL 的核心。您正在运行 OpenGL 4.1。您需要在有问题的系统上升级 OpenGL。

于 2014-05-13T12:34:12.927 回答