Irrlicht Wrapper for FreeBasic

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
chung
Posts: 34
Joined: Sun Apr 04, 2010 3:15 pm
Location: France
Contact:

Post by chung »

i have found a solution for irrstop : insert closedevice() + a loop while irrrunning to wait for closing then drop() , then if wanted restart

i have tested it in my flight simulator and it restarts well and the window is closed, when you exit by key_escape or restart

unfortunately, it doesnt work if you exit by closing directly the window with the mouse (the program task may remain with the sound ...though the window is closed)

Code: Select all

/* ----------------------------------------------------------------------------
release the irrlicht environment and all of its resources
*/
void DLL_EXPORT IrrStop( void )
{  // dont work if you close the window with the mouse
    if(device->run()){
    device->closeDevice();
    while (device->run()){};
    };
    device->drop();

	/* release resources managed by the wrapper and not irrlicht */
	dropShaders();
}
so, finaly, my solution with a irrclose command is simple and it works !

:roll:

Code: Select all

extern "C" __declspec(dllexport) void Irrclose(void)
{
	device->closeDevice();
return ;
}
chung
Posts: 34
Joined: Sun Apr 04, 2010 3:15 pm
Location: France
Contact:

Post by chung »

Frank Dodd wrote: There is a pitch, yaw, roll based node control in:
IrrSetNodeRotationPositionChange
irrsetnoderotationpositionchange only change the current relative rotation position

can you add a command to assign an absolute value of pitch, yaw, roll rotations ? (as my irrsetnoderotation123)

:roll:
JuggernautIRR
Posts: 21
Joined: Tue Jun 05, 2012 4:42 pm

Re: Irrlicht Wrapper for FreeBasic

Post by JuggernautIRR »

Hello,

When I try to execute the IrrlichtShaders.bas in the examples folder I get the following error messages -
Command executed:
"D:\FreeBASIC\fbc.exe" "D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas"

Compiler output:
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(26) error 55: Illegal specification, at parameter 1 (node) of AttachShader() in 'Sub AttachShader( node as irr_node, shader as IRR_SHADER ptr )'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(26) error 55: Illegal specification, at parameter 2 (shader) of AttachShader() in 'Sub AttachShader( node as irr_node, shader as IRR_SHADER ptr )'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(30) error 40: Variable not declared, IrrSetNodeMaterialType in 'IrrSetNodeMaterialType ( node, shader->material_type )'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(39) error 14: Expected identifier, found 'IRR_SHADER' in 'Function AddBasicGLSLShader() as IRR_SHADER ptr'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(39) error 3: Expected End-of-Line, found 'IRR_SHADER' in 'Function AddBasicGLSLShader() as IRR_SHADER ptr'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(42) error 14: Expected identifier, found 'IRR_SHADER' in 'DIM shader as IRR_SHADER ptr = IRR_NO_OBJECT'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(42) error 3: Expected End-of-Line, found 'IRR_SHADER' in 'DIM shader as IRR_SHADER ptr = IRR_NO_OBJECT'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(45) error 40: Variable not declared, IrrAddHighLevelShaderMaterialFromFiles in 'shader = IrrAddHighLevelShaderMaterialFromFiles( _'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(56) error 40: Variable not declared, IrrCreateNamedVertexShaderConstant in 'IrrCreateNamedVertexShaderConstant ( _'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(69) error 14: Expected identifier, found 'IRR_SHADER' in 'Function AddCellGLSLShader() as IRR_SHADER ptr'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(69) error 3: Expected End-of-Line, found 'IRR_SHADER' in 'Function AddCellGLSLShader() as IRR_SHADER ptr'
D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas(69) error 122: Too many errors, exiting

Results:
Compilation failed

System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 0.24.0 (08-19-2012) for win32
OS: Windows NT 6.1 (build 7601, Service Pack 1)
Please help me on how to fix the error.

The file - 97_Example_PhysicsNewtonAndOpenDE.bas produces the following error during compile time.

Command executed:
"D:\FreeBASIC\fbc.exe" "D:\FreeBASIC\IrrlichtWrapper\FBIDETEMP.bas"

Compiler output:
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(154) error 4: Duplicated definition, at parameter 1 (object) of PHYSICSSIZEWORLD() in 'Sub PhysicsSizeWorld( object as physics_obj )'
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(188) error 4: Duplicated definition, at parameter 2 (object) of PHYSICSCREATEPLANE() in 'Sub PhysicsCreatePlane ( node as irr_node, object as physics_obj )'
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(191) error 8: Undefined symbol, node in 'object.node = node'
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(192) error 8: Undefined symbol, geom in 'object.geom = dCreatePlane( world_space, 0, 1, 0, 0 )'
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(192) warning 5(0): Implicit conversion
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(198) error 4: Duplicated definition, at parameter 2 (object) of PHYSICSCREATESPHERE() in 'Sub PhysicsCreateSphere( node as irr_node, object as physics_obj )'
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(210) error 8: Undefined symbol, body in 'object.body = dBodyCreate( world )'
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(210) warning 5(0): Implicit conversion
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(214) error 4: Duplicated definition, body in 'dBodySetData( object.body, @object )'
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(214) warning 1(1): Passing scalar as pointer, at parameter 1 of DBODYSETDATA()
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(221) error 4: Duplicated definition, body in 'dBodySetMass( object.body, @m )'
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(221) warning 1(1): Passing scalar as pointer, at parameter 1 of DBODYSETMASS()
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(224) error 4: Duplicated definition, body in 'dBodySetMovedCallback( object.body, CAST( BODYCALLBACK ptr, @PhysicsMovedCallback ))'
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(224) warning 1(1): Passing scalar as pointer, at parameter 1 of DBODYSETMOVEDCALLBACK()
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(227) warning 5(0): Implicit conversion
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(230) error 4: Duplicated definition, geom in 'dGeomSetBody( object.geom, object.body )'
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(230) error 122: Too many errors, exiting
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(230) warning 1(1): Passing scalar as pointer, at parameter 1 of DGEOMSETBODY()
D:\FreeBASIC\IrrlichtWrapper\IrrlichtODE.bi(230) warning 1(1): Passing scalar as pointer, at parameter 2 of DGEOMSETBODY()

Results:
Compilation failed

System:
FBIde: 0.4.6
fbc: FreeBASIC Compiler - Version 0.24.0 (08-19-2012) for win32
OS: Windows NT 6.1 (build 7601, Service Pack 1)
Please help me on how to fix the errors.
Frank Dodd
Posts: 208
Joined: Sun Apr 02, 2006 9:20 pm

Re: Irrlicht Wrapper for FreeBasic

Post by Frank Dodd »

JuggernautIRR wrote:Hello,
When I try to execute the IrrlichtShaders.bas in the examples folder I get the following error messages -
The IrrlichtShaders.bas file is a support file used by some of the other examples it is not intended to be executed directly.
JuggernautIRR wrote:Hello,
The file - 97_Example_PhysicsNewtonAndOpenDE.bas produces the following error during compile time.
This appears to be an issue raised in the 0.24 release of freebasic where the keyword object is now a reserved word. If you open the IrrlichtODE.bi file and do a search and replace on the word 'object' replacing it with the word '_object' and save the file. Example 97 will compile and run.

Regards,
JuggernautIRR
Posts: 21
Joined: Tue Jun 05, 2012 4:42 pm

Re: Irrlicht Wrapper for FreeBasic

Post by JuggernautIRR »

Hello,

Thank you for looking into the matter. I will follow your advice.
Post Reply