SDK and Delphi

Blitz3D SDK Forums/Blitz3D SDK Programming/SDK and Delphi

hello all, I used blitz2d years ago but havn't done much lately..Anyone know if the SDK will work with Delphi? Delphi can use external dll's so it probaly will but i'd like toknow for sure before hading over the dosh.
Thanks for any info.

I have converted the SDK so it works with Delphi if you run it in full-screen mode i.e. the Delphi project doesn't contain any forms.

I am having major problems rendering to a container control on a form though i.e. a panel.

I am using Delphi 6. But I should imagine it will work with most versions of Delphi, unless there has been a major change in the way external DLLs are called in any earlier or later versions.

Isn't BRL converting B3DSDK files to make it compatible with Delphi?

Hello,
Using B3D SDK witch Delphi is very simple. Try this :


// DELPHI (any Win32 version) sample for B3D SDK
// Save as "Project1.dpr", compile and run

program Project1;

// some external functions from B3D.DLL
function  bbBeginBlitz3D:integer; cdecl; external 'B3D';
procedure bbEndBlitz3D; cdecl; external 'B3D';
procedure bbGraphics3D(Width:integer; Height:integer; Depth:integer=0; Mode:integer=0); cdecl; external 'B3D';
function  bbCreateLight(LightType:integer=0; Parent:integer=0):integer; cdecl; external 'B3D';
function  bbCreateCamera(Parent:integer=0):integer; cdecl; external 'B3D';
function  bbCreateCube(Parent:integer=0):integer; cdecl; external 'B3D';
procedure bbTurnEntity(Entity:integer; p:single; y:single; r:single; global:integer=1); cdecl; external 'B3D';
procedure bbPositionEntity(Entity:integer; x:single; y:single; z:single; global:integer=1); cdecl; external 'B3D';
procedure bbRenderWorld(Tween:single=1.0); cdecl; external 'B3D';
procedure bbFlip(VWait:integer=1); cdecl; external 'B3D';
function  bbKeyHit(NumKey:integer):integer; cdecl; external 'B3D';

// demo code ( cube rotation )
var cube : integer;
begin
  bbBeginBlitz3D;
  bbGraphics3D(800,600);
  bbCreateCamera;
  bbCreateLight;
  cube:=bbCreateCube;
  bbPositionEntity(cube,0,0,4);
  repeat
    bbTurnEntity(cube,1,2,3);
    bbRenderWorld;
    bbFlip;
  until bbKeyHit(1)=1; // esc
  bbEndBlitz3D;
end.



that's nice but im actually waiting for a complete commandset declaration, i dont wanna spend my time on doing it myself.

Just wanted to ask if there is any news on when the command declarations will be available for Delphi.

Daz - is your conversion publicly available?

Delphi unit with complete API conversion posted to "Blitz3D SDK Wrappers" forum. Enjoy.

If you get 'division by zero' errors in Delphi when using the SDK, try calling this function at the start of the program:
procedure SecureFpu;
begin
    Set8087CW(Default8087CW or $3F);
end;


I would also be interested in a Delphi version of this API...