Irrlicht 4 delphi and all copilers that suport dll's

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
djoker
Posts: 39
Joined: Thu Dec 22, 2005 10:25 pm
Location: Portugal

Irrlicht 4 delphi and all copilers that suport dll's

Post by djoker »

Hi comunity...
im creating 1 framework for IR ...
the framework work like blitz3d and darkbasic


Code: Select all

//delphi API 
function IR_InitEngine(DeviceType:IRDevice;W,H, BBP:integer;fullscreen,stencilbuffer, vsync:boolean ):boolean;stdcall;external ir_dll;
function IR_InitEngineOnWindow(DeviceType:IRDevice;HWND:integer;W,H, BBP:integer;fullscreen,stencilbuffer,AntiAlias, vsync:boolean ):boolean;stdcall;external ir_dll;

procedure IR_StopEngine;stdcall;external ir_dll;
procedure IR_SetWindowCaption(text:PWChar);stdcall;external ir_dll;
function  IR_Run:boolean;stdcall;external ir_dll;


//**************************************************
procedure IR_Timer_Tick;stdcall;external ir_dll;
function  IR_Timer_GetRealTime:integer;stdcall;external ir_dll;
function  IR_Timer_GetTime:integer;stdcall;external ir_dll;
procedure IR_Timer_SetSpeed(speed:single=1.0);stdcall;external ir_dll;
//***

function  IR_IsWindowActive:bool;stdcall;external ir_dll;
procedure IR_SetWindowResizeAble(resize:bool);stdcall;external ir_dll;
procedure IR_LogWrite(text:PWCHAR);stdcall;external ir_dll;
procedure IR_SetCursorVisible(value:bool);stdcall;external ir_dll;


procedure IR_Render_Debug(ShowFps, ShowDeviceName:boolean);stdcall;external ir_dll;

procedure IR_Render_SetTextureCreationFlag(Flag:E_TEXTURE_CREATION_FLAG;value:bool)stdcall;external ir_dll;

function  IR_RenderBeginScene(backBuffer,zBuffer:bool;r,g, b:integer):bool;stdcall;external ir_dll;
function  IR_RenderEndScene:boolean;stdcall;external ir_dll;
function  IR_RenderDraw2DRectangle(Left,Top,right,Bottom:integer;r, g, b, alpha:integer):bool;stdcall;external ir_dll;


procedure IR_GuidInit;stdcall;external ir_dll;
procedure IR_GuidDraw;stdcall;external ir_dll;
procedure IR_GuidAddButton(index:integer;id:integer; x,y,w,h:integer );stdcall;external ir_dll;




procedure IR_TextureLoad(index:integer;filetoload:PCHAR);stdcall;external ir_dll;
function IR_TextureFree(index:integer):bool;stdcall;external ir_dll;
procedure IR_TextureSetColorKey(index:integer;x,y:integer);stdcall;external ir_dll;
procedure IR_TextureDrawD2Image(index,x,y:integer);stdcall;external ir_dll;
procedure IR_TextureDrawD2ImageColor(index,x,y,Left,Top,Right,Bottom,r, g, b, alpha:integer;UseAlpha:bool)stdcall;external ir_dll;
procedure IR_TextureDrawD2ImageColorClip(index:integer;x,y:integer;Left,Top,Right,Bottom:integer;r, g, b, alpha:integer;UseAlpha:bool;cLeft,cTop,cRight,cBottom:integer)stdcall;external ir_dll;


procedure  IR_FontWrite (texto:pchar;x, y:integer;r,g,b,alpha:integer);stdcall;external ir_dll;
procedure  IR_FontWrite_Num(Num:integer;x, y:integer;r,g,b,alpha:integer);stdcall;external ir_dll;
//´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´´
function IR_LoadZipFile(filename:pchar;ignoreCase , ignorePaths:bool ):bool;stdcall;external ir_dll;
function IR_GetDir:pchar;stdcall;external ir_dll;
function IR_GetFPS:integer;stdcall;external ir_dll;



//*********************************************camera
procedure  IR_Camera_AddNormal(PosX,PosY,PosZ,LookX,LookY,LookZ:single) ;stdcall;external ir_dll;
procedure  IR_Camera_AddFPSStyle(rotateSpeed,moveSpeed:single;noVerticalMovement:bool) ;stdcall;external ir_dll;
procedure  IR_Camera_AddMayaStyle(rotateSpeed ,zoomSpeed,translationSpeed:single) ;stdcall;external ir_dll;
procedure  IR_Camera_SetPos(x,y,z:single) ;stdcall;external ir_dll;
procedure  IR_Camera_SetFarValue (fFar:single);stdcall;external ir_dll;
procedure  IR_Camera_SetNearValue (fNear:single);stdcall;external ir_dll;
procedure  IR_Camera_SetAspectRatio(aspect:single);stdcall;external ir_dll;
procedure  IR_Camera_SetFOV(fovy:single);stdcall;external ir_dll;

//************************************************************************
procedure  IR_NodeCreateDummyCube(index:integer );stdcall;external ir_dll;
procedure  IR_NodeSetTexture(index,textureIndex:integer );stdcall;external ir_dll;
procedure  IR_NodeDrawAll;stdcall;external ir_dll;

//--+++++++++++++++++++++++++++++++++++++++
Procedure  IR_Meshes_Add_MD2_From_File(Index:Integer;filename:pchar) ;stdcall;external ir_dll;

Procedure  IR_Meshes_SetTexture(Index:Integer;textureIndex:integer) ;stdcall;external ir_dll;
Procedure  IR_Meshes_Enable_lighting(Index:Integer;value:bool) ;stdcall;external ir_dll;

Procedure  IR_Meshes_SetPosition(Index:Integer;x,y,z:single) ;stdcall;external ir_dll;
Procedure  IR_Meshes_SetRotatin(Index:Integer;x,y,z:single) ;stdcall;external ir_dll;
Procedure  IR_Meshes_SetScale(Index:Integer;x,y,z:single) ;stdcall;external ir_dll;
Procedure  IR_Meshes_SetVisible(Index:Integer;Visible:bool ) ;stdcall;external ir_dll;
Procedure  IR_Meshes_GetPosition(Index:Integer;x,y,z:single) ;stdcall;external ir_dll;
function   IR_Meshes_GetPosition2(Index:Integer): IVEC3 ;stdcall;external ir_dll;
Procedure  IR_Meshes_GetRotatin(Index:Integer;x,y,z:single) ;stdcall;external ir_dll;
function   IR_Meshes_GetRotatin2(Index:Integer): IVEC3 ;stdcall;external ir_dll;
Procedure  IR_Meshes_GetScale(Index:Integer;x,y,z:single) ;stdcall;external ir_dll;
function   IR_Meshes_GetScale2(Index:Integer): IVEC3 ;stdcall;external ir_dll;

//--+++++++++++++++++++++++++++++++++++++++

procedure IR_Terrain_LoadHeightMap(heightMapFileName:pchar);stdcall;external ir_dll;
procedure IR_Terrain_SetPosition(x,y,z:single) ;stdcall;external ir_dll;
procedure IR_Terrain_SetRotation(x,y,z:single) ;stdcall;external ir_dll;
procedure IR_Terrain_SetScale(x,y,z:single) ;stdcall;external ir_dll;
procedure IR_Terrain_SetVertexColor(a,r,g,b:single);stdcall;external ir_dll;
procedure IR_Terrain_Add(maxLOD:integer=5; patchSize:E_TERRAIN_PATCH_SIZE=ETPS_17);stdcall;external ir_dll;
procedure IR_Terrain_Free;stdcall;external ir_dll;
procedure IR_Terrain_AddTriangleSelector;stdcall;external ir_dll;
procedure  IR_Terrain_SetMaterialFlag(mType:E_MATERIAL_FLAG ;value:bool);stdcall;external ir_dll;
procedure  IR_Terrain_SetMaterialType(Mtype:E_MATERIAL_TYPE);stdcall;external ir_dll;
procedure  IR_Terrain_SetVisible(isVisible:bool);stdcall;external ir_dll;
function   IR_Terrain_GetID:integer;stdcall;external ir_dll;
procedure  IR_Terrain_SetDebugVisible(visible:bool);stdcall;external ir_dll;
procedure  IR_Terrain_SetMaterialTexture(textureLayer:integer;filetoload:pchar);stdcall;external ir_dll;
procedure  IR_Terrain_ScaleTexture(x,y:single);stdcall;external ir_dll;

//--+++++++++++++++++++++++++++++++++++++++


procedure IR_Terrain_LensFlare_Build;stdcall;external ir_dll;
procedure IR_Terrain_LensFlare_Render;stdcall;external ir_dll;
//--+++++++++++++++++++++++++++++++++++++++

procedure IR_SkyBox_LoadTexture( filetoload:pchar;textType:SKY_TEXTURE_TYPE);stdcall;external ir_dll;
procedure IR_SkyBox_AddToScene (Id:integer=-1);stdcall;external ir_dll;
procedure IR_LensFlare_Add;stdcall;external ir_dll;

function IR_Image_Load(index:integer;filename:pchar;colorkey:bool=true):bool;stdcall;external ir_dll;
procedure IR_Image_Free(index:integer);stdcall;external ir_dll;
function IR_Image_IsPointColide(index, x, y:integer):bool;stdcall;external ir_dll;
function IR_Image_IsImageColide(index,Image:integer):bool;stdcall;external ir_dll;
function IR_Image_Draw(index, x, y:integer;Tras:bool):bool;stdcall;external ir_dll;



shot with: lens flare,terrain ,md2 model and skyboxe

Image

the code:

Code: Select all

program SkyBox;

{APPTYPE CONSOLE}

uses
  windows,
  SysUtils,
  dialogs,divinput,
  IRFrame in 'IRFrame.pas';

var
loop:boolean=true;
d:array [0..255]of char;


begin



IR_InitEngine(EDT_DIRECT3D9,800,600,16,false,FALSE,false);

IR_LogWrite('init engine');



IR_SetWindowCaption('Irrlicht Engine - 2D Graphics Demo');
IR_SetWindowResizeAble(true);

IR_LogWrite('load textures');

  IR_TextureLoad(0,'2ddemo.bmp');


IR_Render_SetTextureCreationFlag(  ETCF_CREATE_MIP_MAPS,false);
IR_SkyBox_LoadTexture('data\irrlicht2_up.jpg',TTop);
IR_SkyBox_LoadTexture('data\irrlicht2_dn.jpg',Tbottom);
IR_SkyBox_LoadTexture('data\irrlicht2_lf.jpg',Tleft);
IR_SkyBox_LoadTexture('data\irrlicht2_rt.jpg',Tright);
IR_SkyBox_LoadTexture('data\irrlicht2_ft.jpg',Tfront);
IR_SkyBox_LoadTexture('data\irrlicht2_bk.jpg',Tback);
IR_SkyBox_AddToScene;
IR_Render_SetTextureCreationFlag(  ETCF_CREATE_MIP_MAPS,true);


IR_GuidInit;
IR_Camera_AddFPSStyle(10.0,505.0,true);
IR_Camera_SetPos(0,200,-10);
//IR_Camera_AddMayaStyle(-1500.0,200.0,1500.0);
IR_Camera_SetFarValue(15000.0);


IR_Meshes_Add_MD2_From_File(0,'data\faerie.md2');
IR_Meshes_Enable_lighting(0,false);
IR_TextureLoad(1,'data\faerie5.bmp');
IR_Meshes_SetTexture(0,1);
IR_Meshes_SetPosition(0,100,200,100);
IR_Meshes_SetScale(0,1.0,1.0,1.0);




IR_Terrain_LoadHeightMap('data\terrain-heightmap.bmp');
IR_Terrain_SetPosition(0,-200,0);
IR_Terrain_SetRotation(0,0,0);
IR_Terrain_SetScale(40.0,4.0,40.0);
IR_Terrain_SetVertexColor(255,255,255,255);
IR_Terrain_Add;
IR_Terrain_AddTriangleSelector;
IR_Terrain_SetMaterialFlag(EMF_LIGHTING,false);
IR_Terrain_SetMaterialTexture(0,'data\terrain-texture.jpg');
IR_Terrain_SetMaterialTexture(1,'data\detailmap3.jpg');
IR_Terrain_SetMaterialType(EMT_DETAIL_MAP);
IR_Terrain_ScaleTexture(1.0,20.0);

        



Div_Keyboard_Init;

if not IR_Image_Load(0,'data\21.jpg') then halt;

IR_Render_Debug(true,true);
IR_LensFlare_Add;

repeat

Div_Keyboard_Update;
IR_Timer_Tick;
IR_Run;
if Div_Keyboard_Up(KEY_ESCAPE ) then loop:=false;


 IR_RenderBeginScene(true,true,0,0,45);
 IR_NodeDrawAll;



 IR_TextureDrawD2ImageColor(0,10,550,354,87,442,118,255,255,255,155,false);



 IR_FontWrite('IR 4 Delphi By Luis Santos AKA Djoker',300,20,255,255,255,255);



 IR_RenderEndScene;

  sleep(15);
until not loop;

IR_Terrain_Free;
IR_StopEngine;



end.
more its coming ;)

ps : Irrlicht suport delphi .net but my project is not for .NET its 4 all copilers like blitz3d purebasic ibasic and blitzmax
Never underestimate the power of Delphi....Ignorance is bliss, but knowledge is power...
Maize
Posts: 163
Joined: Sat Oct 29, 2005 12:12 am
Location: In a cave...
Contact:

Post by Maize »

I applaud you in your efforts. Nice job man.
dracflamloc
Posts: 142
Joined: Sat Dec 11, 2004 8:13 am
Contact:

Post by dracflamloc »

Cool beans, You mentioned Purebasic.

I had worked on the same kind of thing.

You can find the last version I made of it here: http://www.dracsoft.com/viewdownload.php?id=26
jonjon
Posts: 1
Joined: Sun Jan 15, 2006 6:50 pm

Post by jonjon »

Hi Djoker,
The delphi port looks extremly interesting. Do you have any status update ? Or any code to play with ?

Regards,
John.
trooper
Posts: 85
Joined: Fri Nov 03, 2006 7:34 pm
Location: Maryland, USA
Contact:

Post by trooper »

AWSOME !!

I'm a Delphi guy, and been looking for something like this for a while.

Only stuff I could find was .NET and even that didn't seem to work, everyone had DLL problems, and just seemed an extravigant claim that Irrlicht worked with Delphi.

I'm impressed, and think Delphi 7 is one of the best (Delphi) platforms.

Unless you REALLY need to develope .NET or WEB apps, Delphi 7 is perfect.

I wanted to use Delphi just for a better visual launcher and config forms.
Easy of implementing registry settings, and basically cause I am more comfortable with Delphi than C++.

What version or irrlicht are you using ??
I would stick with V1.1 just because 1.2 still has unknown bugs and is too new.
I would develope this project on 1.1 just because it's more stable, and most bugs are known.
But hey thats just my 2 cents worth !

Put me on your mailing list :wink:

Anyway, keep up the good work.
You scratch my back, I'll scratch yours.
trooper
Posts: 85
Joined: Fri Nov 03, 2006 7:34 pm
Location: Maryland, USA
Contact:

Post by trooper »

Hey djoker,

I tried building a sample project from some of your code, but did not figure out what the reference to "divinput" was ?

Should you not also need to load the DLL at some point ?

Cheers :wink:
You scratch my back, I'll scratch yours.
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

Great!
I don't know Object Pascal, but is nice that Borland users and pascal coders will be able wo work with Irrlicht.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
darkvadr
Posts: 2
Joined: Thu Jan 11, 2007 12:08 pm

Post by darkvadr »

hello i'm pretty new to irrlicht,
and i'm an intensive user of Glscene...
But glscene suffer of a lack of design and i begin to be fed up with tracing glscene code to debug it...

i'm realy looking for a delphi 7 version (Not *!+**$!!! grrrrr .net), where should i find your marvellous framework joker?

Your screen shot is fine... But the true framework should be more usable.

Also, here is my question:
is it possible to use it with vcl (not console mode)?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

This looks neat, Irrlicht for the masses! :lol:
trooper
Posts: 85
Joined: Fri Nov 03, 2006 7:34 pm
Location: Maryland, USA
Contact:

Post by trooper »

Hi darkvadr,

I have been waiting for sometime now for more news on this post.

Also tried working with the code example djoker posted and not had much progress.

There seems too much code missing, and I hope to see more, but no news from the Delphi master yet :wink:
Hopefully he shall return.

Anyway, I have been working on a Delphi/OpenGL project.
I would not really call it an engine yet, although it does load the Quake map from the irrlicht demo, and a Quake 3 player model (yes quake 3 not quake 2 :wink: )

Image

Image

All I use is Delphi7 & the OpenGL Header file (Delphi PAS library), although it's not irrlicht, it is a starting point, and I decided to start from scratch, and not use someone elses engine.

if your interested, mail me, and I'll happily share the code.
You scratch my back, I'll scratch yours.
darkvadr
Posts: 2
Joined: Thu Jan 11, 2007 12:08 pm

look nice!

Post by darkvadr »

Great work coder!

Yes, i'm absolutly interseted by your code but for educationnal purpose, because i badly lack of time (and english skill (sorry for my english))...

That's why i'm looking for an engine.

there's so much to implement... Many loaders, packers, shaders, collision detectors, keyboard hooking, event handling, muzaxx...

and finally... a game...

But... i'll mail you to see your nice work (and may be to improve one thing or two if i find some time... But i promise nothing ok?)
Post Reply