irrichlet mod?

BlitzMax Forums/BlitzMax Programming/irrichlet mod?

AntonyWells(Posted 2005) [#1]
please to explain? :)


gman(Posted 2005) [#2]
its a cross-platform 3D engine that i have written a wrapper for. the worklog with info on the mods is located at:

gg.Irrlicht worklog


BlitzSupport(Posted 2005) [#3]
Whoa, it lives! Welcome back.


AntonyWells(Posted 2005) [#4]
are you implying i'm a scary ass clown?

cheers gman, could save my lazy ass from having to finish trinity.


Amon_old(Posted 2005) [#5]
Hey, How've you been? I tried irrlicht but I cant get my head around it. BasicGL is a load of poop but the BlitzMax3d module is looking like its doing it job.


AntonyWells(Posted 2005) [#6]
hey man, or mon. yeah mark's new one has me excited in a way that really isn't advisible in my current condition.
six months will not fly by though.


AntonyWells(Posted 2005) [#7]
just got it g, any clue to where the 13 samples are located yo?


gman(Posted 2005) [#8]
@Antony - they are downloadable from the worklog.


AntonyWells(Posted 2005) [#9]
coolio. just tried sample 13 but get -irrichet not found when compiling. do i need to install mingw(just have anyway) and rebuild mods?


gman(Posted 2005) [#10]
@Antony - the samples are compiled with DX support. if you just want OpenGL support, put the .a file from the Irrlicht distrib in your BMAX lib folder and rebuild the sample. also need to put the DevCPP DLL in your windows folder. if you want to try DX, download the DX distrib in the worklog as well. put the .a in your bin and the DLLs in your windows folder.

as a side note, per Budmans suggestion i really need to get an install.txt in there to help folks out....


AntonyWells(Posted 2005) [#11]
ok so i need to copy the dx files into...(fill in the blank please)
get devcpp .dll and place into system path,
place the .a file in my bin(??)

sorry for being so stupid, i'm useless at installing things that arn't click and go.


gman(Posted 2005) [#12]
@Antony - np :) the quickest way is to:

a) download the DX distrib located here.

b) extract the zip to a temp location. place the .a file in your BlitzMax bin folder and all DLLs into your windows system32 folder.

after placing the DLLs there you should be able to run the sample EXEs directly. the .a file is required to build an EXE using the mods.


AntonyWells(Posted 2005) [#13]
sweet, got it running sample 13 :)

in case anyone is having similar problems, here's how i did it in stupid.

1.) copy original mod into bmax/mod folder
2.) copy dx .dlls into system32
3.) copy dx .a file into bmax/lib/
4.)install devcpp 2.9mb installation for required .dll

hey presto, runs like a dream. will use this i think for my next game. (excitement grows. :) )
thanks for the help g.


DStastny(Posted 2005) [#14]
Did I make a booboo when I built the irlicht.DLL gman to force requirement of a devcpp DLL?

There shouldnt be any dependencies to DEVCPP

Doug Stastny


Dreamora(Posted 2005) [#15]
He means the irrlicht dll which was created for DevCPP users (=> GCC dlls)


DStastny(Posted 2005) [#16]
I understand that Dreamora, I built the DLLs for GMAN. He said he installed devcpp which he shouldnt have had to.

Unless of course I screwed up building the irlicht DLL which was why i was wonder why he needed something from DEVCPP.

So I am still confused to Antonys comment.

Ill do a dependency check on DLLs I sent to GMAN

Doug Stastny


AntonyWells(Posted 2005) [#17]
just to clarify, it might have worked without devcpp installed. i just did it to get the devcpp .dll installed easily. and without effort. (I'm the world's laziest man by nature, and choice)


AntonyWells(Posted 2005) [#18]
'
'Irrlicht-Abstraction-Layer
'
'(c)Antony Wells
'--
'IAL V0.1
'
Strict

Framework BRL.Blitz

Import gg.IrrBMAX

Const I_DX =EDT_DIRECTX9,I_GL=EDT_OPENGL

Type Engine

	Method New()
		stencils=True
		vSync=False
		fullScreen=True
		ming=Self
	End Method

	Method display(width,height,depth,driver=I_DX)
	
		device = T_irrIrrlichtDevice.create(driver,T_irrDimension2d_s32.create(width,height),depth,fullScreen,stencils,vsync,0)
		driver=device.getVideoDriver()
		scene=device.getSceneManager()
		gui=device.getGUIEnvironment()
	
	End Method
		
	Method vSyncOn()
		vsync=True
	End Method
	
	Method vSyncOff()
		vSync=False
	End Method
	
	Method StencilOn()
		stencils=True
	End Method
	
	Method StencilOff()
		stencils=False
	End Method
	
	Method fullScreenOn()
		fullScreen=True
	End Method
	
	Method fullScreenOff()
		fullScreen=False
	End Method
	
	Method appTitle(title:String)
	
		device.setwindowcaption(title)
	
	End Method
			
	Field device:T_irrIrrlichtDevice
	Field vsync,stencils,fullscreen
	
	Field driver:T_irrIVideoDriver
	Field scene:T_irrISceneManager
	Field gui:T_irrIGUIEnvironment
			
End Type

Type Entity

	Function Load:Entity(file:String)

		Local out:entity = New entity
		If ming = Null Throw "No 3D Display Initialized, cannot load mesh without scene context"
		out.mesh = ming.scene.getmesh( file )
		Return out
					
	End Function
	
	Field mesh:T_irrIAnimatedMesh

End Type

Global Ming:Engine 

'---Example Code



Evak, there's always option number 3 :)


DStastny(Posted 2005) [#19]
Very cool Antony, I checked the dependencies DEVCPP is not necessary :)

That Engine Type looks similar to mine except I encapsulated the Irrlicht Device in a member type.


Suggestions:
1) Use Assert to validate existings of the ming global. That way the if tests are only compiled in DEBUG mode
2) Use a Create Function on the Engine object and assign Ming there so you can implment a singleton pattern. So no matter how many times you create an Engine Type they will all use the same instance. Irrlicht devices need to be properly manganged so that you only have one otherwise you will have more windows popping up all over the place.

Doug Stastny


AntonyWells(Posted 2005) [#20]
budman, care to share? My one is messing up somewhere because the video driver is being returned as null for some bizarre yet probably my fault anyway reason.

here's the code as it stands i'm using to test the little bit i've done so far,

'
'Irrlicht-Abstraction-Layer
'
'(c)Antony Wells
'--
'IAL V0.1
'
Strict

Framework BRL.Blitz

Import gg.IrrBMAX

Const I_DX =EDT_DIRECTX9,I_GL=EDT_OPENGL

Type Engine

	Method New()
		stencils=True
		vSync=False
		fullScreen=False
		ming=Self
	End Method

	Method Delete()
	
		device.drop()
	
	End Method
	
	Method display(width,height,depth=16,driver=I_DX)
	
		device = T_irrIrrlichtDevice.create(driver,T_irrDimension2d_s32.create(width,height),depth,fullScreen,stencils,vsync,0)
		driver=device.getVideoDriver()
		scene=device.getSceneManager()
		gui=device.getGUIEnvironment()
	
	End Method
		
	Method vSyncOn()
		vsync=True
	End Method
	
	Method vSyncOff()
		vSync=False
	End Method
	
	Method StencilOn()
		stencils=True
	End Method
	
	Method StencilOff()
		stencils=False
	End Method
	
	Method fullScreenOn()
		fullScreen=True
	End Method
	
	Method fullScreenOff()
		fullScreen=False
	End Method
	
	Method appTitle(title:String)
	
		device.setwindowcaption(title)
	
	End Method

	Method Loop()
		Return device.run()
	End Method
	
	Method renderWorld()
	
		driver.beginScene(True,True,T_irrSColor.createFromVals(clsd,clsr,clsg,clsb))
	
			scene.drawAll()
				
		driver.endscene()
	
		FlushMem
		
	End Method
	
	'cls color
	Field clsr,clsg,clsb,clsd!
			
	'---
	Field device:T_irrIrrlichtDevice
	Field vsync,stencils,fullscreen
	
	Field driver:T_irrIVideoDriver
	Field scene:T_irrISceneManager
	Field gui:T_irrIGUIEnvironment
			
End Type

Type Entity

	Function Load:Entity(file:String)

		Local out:entity = New entity
		If ming = Null Throw "No 3D Display Initialized, cannot load mesh without scene context"
		out.mesh = ming.scene.getmesh( file )
		Return out
					
	End Function
	
	Method Show()
	
		node = ming.scene.addAnimatedMeshSceneNode( mesh )
		
	End Method
		
	Field mesh:T_irrIAnimatedMesh
	Field node:T_irrIAnimatedMeshSceneNode

End Type

Global Ming:Engine 

'---Example Code

DebugStop
Local Test:Engine = New Engine

test.display(640,480)

While Test.Loop()

	test.RenderWorld()
	FlushMem

	If KeyDown(KEY_ESCAPE) Exit
Wend






I wouldn't say devcpp was a bad step anyway, nice little ide :)


DStastny(Posted 2005) [#21]
Its a little to big to post as I am further along in the abstraction layer. But Ill gladly share.

Ill zip up the work in progress when I get home from work and put it up for you to look at.

I agree DevCPP is really nice little ide.

Doug Stastny


AntonyWells(Posted 2005) [#22]
cheers budman, looking forward to it.