⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sample1.dpr

📁 3D GameStudio 的Delphi开发包
💻 DPR
字号:
program sample1;

//////////////////////////////////////////////////////////////////////
//
// Delphi sample for using the A6_5x Engine (acknex.dll) done by
// Michal Messerschmidt aka LazyDog of Lazy Dog Software
// (www.LazyDogSoftware.com)
//
// SDK Version 6.50.6
//
// tested on Delphi 5,6,7 & 2005
//////////////////////////////////////////////////////////////////////

{$R 'icon.res' 'icon.rc'}  // this allows defining your own .ico file
                           // without the overhead of using the forms unit
                           // to get to the application.icon.  simply change
                           // the icon.rc file to point to your icon

uses A6Engine, Engine_Library, Dialogs;

procedure Quit;
begin
  sys_exit('');     // quit running and shut down the engine
end;

procedure Main;

var I : Integer;
    B,G,R : Var_;
begin
  if FindDirectX < 9 then
  begin
    ShowMessage('DirectX 9 is required to run this program');
    Exit;
  end;

  ev := engine_open('');         // commands like -diag can be used here

  if ev = Nil then Exit;

  ev.on_close^ := @Quit;         // [X] close icon clicked quits program
  ev.on_esc^   := @Quit;         // ESC key quits program

  ev.mouse_mode^    := _VAR(1);  // windows cursor is visible
  ev.mouse_pointer^ := _VAR(1);  // default cursor is hand

  ev.video_screen^ := _VAR(2);   // default to window mode
  ev.video_mode^   := _VAR(7);   // default to 800x600
  ev.video_depth^  := _VAR(32);  // default to 32 bit depth

  draw_textmode('Times',_VAR(3),_VAR(20),_VAR(100));

  B := _VAR(100);   // set blue color level
  G := _VAR(0);     // set green color level
  R := _VAR(0);     // set red color level
  I := 1;

  // here is the engine main loop
  while engine_frame <> 0 do
  begin
    // change the color displayed each time through
    case I of
      1 : begin
            Inc(B,_VAR(0.5));

            if _INT(B) > 254 then
            begin
              B := _VAR(0);
              G := _VAR(100);
              Inc(I);
            end;
          end;

      2 : begin
            Inc(G,_VAR(0.5));

            if _INT(G) > 254 then
            begin
              G := _VAR(0);
              R := _VAR(100);
              Inc(I);
            end;
          end;

      3 : begin
            Inc(R,_VAR(0.5));

            if _INT(R) > 254 then
            begin
              R := _VAR(0);
              B := _VAR(100);
              I := 1;
            end;
          end;
    end;


     draw_text('You are running the engine!',_VAR(300),_VAR(150),vector(_VAR(100),_VAR(100),_VAR(100)));
     draw_text('Hit ESC to quit the program',_VAR(300),_VAR(200),vector(B,G,R));
  end;

  engine_close();
end;

begin
  Main;
end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -