I'm not sure if this 'global' parameter works or not. I vaguely remember trying it once in the common version of blitz3d, and I remember that I was able to turn meshes independent of their orientation, but I can't seem to recall if I wrote something myself to do that. You can allways assign a pivot as a parent to the object, and rotate it.
Anyway, I installed the sdk for Delphi again, and adapted the original example to use SetHWND and the callback:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Blitz3D;
type
TForm1 = class(TForm)
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
camera, cube : integer;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//event handler
procedure dBBEventHandler(hWnd, Msg, wParam, lParam : integer);
begin
Form1.Caption := 'Event = ' + inttostr(Msg) + ' ' + inttostr(wParam) + ' ' + inttostr(lParam);
end;
//setup b3d
procedure TForm1.FormCreate(Sender: TObject);
begin
bbSetBlitz3DDebugMode(0);
bbSetBlitz3DHWND(form1.Handle);
bbSetBlitz3DEventCallback(@dBBEventHandler);
bbBeginBlitz3D;
bbGraphics3D(320,240,0,3);
bbCreateLight;
camera:=bbCreateCamera;
cube:=bbCreateCube;
bbPositionEntity(camera,0,0,-4);
Timer1.enabled := true;
end;
//update b3d on timer
procedure TForm1.Timer1Timer(Sender: TObject);
begin
bbTurnEntity(cube,1,2,3);
bbRenderWorld;
bbFlip;
end;
//destroy b3d when form is closed
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if (Action = caFree) then
begin
Timer1.enabled := false;
bbEndGraphics;
bbEndBlitz3D;
end;
end;
//form1 respond to keydown
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if key = VK_SPACE then caption := 'hello';
end;
end.
edit: please note that i named my include file 'blitz3d.pas', where it should have been blitz3dsdk.pas
I created a form with a timer. You should assign FormCreate/FormClose/FormKeyDown to the form Events in the object inspector, and assign Timer1Timer to the timers OnTimer.