gg.Irrlicht / gg.IrrBMAX - the bell doth toll

BlitzMax Forums/BlitzMax Programming/gg.Irrlicht / gg.IrrBMAX - the bell doth toll

gman(Posted 2005) [#1]
check the worklog.


Nennig(Posted 2005) [#2]
Many, many thanks gman. Your module rocks!


Robert(Posted 2005) [#3]
Thanks gman.

It looks like it will take me a little while to learn, but it seems very flexible.


ckob(Posted 2005) [#4]
Awesome job keep up the good work, Is there a KEY_KEY_ESCAPE ?


gman(Posted 2005) [#5]
just an FYI, all key constants are in EKEY_CODE.BMX in the Irr folder of gg.Irrlicht.

@ckob - i think what your seeking is KEY_ESCAPE. i just tried doing a non-framework build and it seems that the KEY constants conflict with some defined in another mod. the KEY constants for gg.Irrlicht may be getting a prefix soon.

on another note, thank you for the positive feedback both posted and via email :) im 100% positive we will find some issues once people start utilizing more and more of the mods. they are pretty large and there was a lot of copy/pasting going on. by converting most of the samples before release i think ive caught all the immediate bugs :) ive been looking a lot at loading B3D files. no guarantees but it will allow me to wrap a couple more classes that involve creating new nodes and test them at the same time.


ckob(Posted 2005) [#6]
Yeah I tried it because I wanted to be able press Escape to end the program instead of Alt-F4...is there a way your suppose to close out of it? I also checked that EKEY_CODE.BMX and didnt see the key code in there might have missed it. Good job again.


gman(Posted 2005) [#7]
calling device.closeDevice() inside the main loop somewhere should cause the loop to end. keep in mind also that the KEY constants defined in gg.Irrlicht are associated with the Irrlicht SEvent class. im not sure they are the same as the ones defined in BMAX. for example, you can mix BMAX and Irrlicht code by putting the following statement somewhere in the while loop:
if keydown(KEY_ESCAPE)
    device.closeDevice()
endif

by doing this, you are bypassing the Irrlicht event mechanism and using the BMAX mechanism to exit the loop (both work in this situation).

UPDATE: this is cool. you can distinguish what KEY_ESCAPE to use by changing the above to:
if keydown(gg.Irrlicht.KEY_ESCAPE)
    device.closeDevice()
endif

looks like if there is a conflict you can prefix it with the module.


ckob(Posted 2005) [#8]
well if I do this

If KeyDown(KEY_ESCAPE)
device.closeDevice()
EndIf

It gives me a duplicate identifier error.


If I try
if keydown(gg.Irrlicht.KEY_ESCAPE)
device.closeDevice()
endif

It doesnt do anything at all, and they both were put into the main loop.


gman(Posted 2005) [#9]
post your loop and lets have a look.

thx.

you can also try

If KeyDown(BRL.KeyCodes.KEY_ESCAPE)
    device.closeDevice()
EndIf


also, try just device.closeDevice() without the IF clause and see if that exits it immediately. also, make sure your while loop is:
While (device.run())
Wend



ckob(Posted 2005) [#10]
While(device.run())
If KeyDown(BRL.KeyCodes.KEY_ESCAPE)
device.closeDevice()
EndIf


If (device.isWindowActive())
driver.beginScene(True, True)

smgr.drawAll()
env.drawAll()

driver.endScene()

' display frames per second in window title
fps = driver.getFPS()
If (lastFPS <> fps) Then
str = "Terrain Renderer - Irrlicht Engine ["
str :+ driver.getName()
str :+ "] FPS:"
str :+ fps

device.setWindowCaption(str)
lastFPS = fps
EndIf
EndIf
FlushMem
Wend

device.drop()


gman(Posted 2005) [#11]
looks like when you have an event receiver attached, it captures all input and directs it through the receiver. it appears to make the BMAX input mechanisms act a little funky. i take you are using the terrain example. make device global add this to the event receiver under the IF that handles the wireframe toggle:
If (event.getEventType()=EET_KEY_INPUT_EVENT And ..
	event.getKeyPressedDown()=False And ..
	event.getKeyInputKey()=gg.Irrlicht.KEY_ESCAPE)
		
    device.closeDevice()
EndIf



DStastny(Posted 2005) [#12]
Wanted to comment this is pretty cool.

I had a chance to play with your mod.

This is real nice engine.


marksibly(Posted 2005) [#13]
Wow, nice work gman!


ckob(Posted 2005) [#14]
right I couldnt seem to get it to work but I'll keep trying. Keep up the good work


ckob(Posted 2005) [#15]
ok I got it work all I did was add this

If (event.getEventType()=EET_KEY_INPUT_EVENT And ..
event.getKeyPressedDown()=False And ..
event.getKeyInputKey()=gg.Irrlicht.KEY_ESCAPE)

endgame = True
EndIf

to the wireframe section and then in the main loop I did this

If endgame=True Then
device.closeDevice()
EndIf


Takuan(Posted 2005) [#16]
Installed it, compiled an example .bmx and got a "hello world".
Realy nice work!


marksibly(Posted 2005) [#17]
Excellent stuff,

No problems here (except for the KEY_ clash), and it all works fine on BlitzMax version 1.08 - woohoo!

What sort of license will you be releasing under?


gman(Posted 2005) [#18]
FYI, i have a new MOD download available in the worklogs (same location, linked to different file). the only difference is that anything that began with KEY_ is now EKEY_ to avoid the KEY_ conflict. also updated are the 04 and 12 examples which now reflect the EKEY_ change.

@everyone - again, thx for the positive response! i have exactly 100 downloads of the mod ZIP as of today :) hopefully we can start to see some projects come out of this. just seeing the response means that i hit one of my main goals... makes me very happy :)

@ckob - a good solution. glad you got it going :)

@mark - its a freebie for all... and thx :) i like BMAX quite a bit :)


ckob(Posted 2005) [#19]
Thanks :) im glad to see this is free I think this is a very large step for Blitzmax. I plan on using it for somethings and maybe I can write a few samples myself once I get better with it. Thanks for changing the key conflict


LarsG(Posted 2005) [#20]

..and it all works fine on BlitzMax version 1.08 - woohoo!


... 1.08? ... HEY!!!! wait a minute!!!! :p


Dirk Krause(Posted 2005) [#21]
@gman: great work, and very cool to make it free.
@mark: gimme! :-)


MrCredo(Posted 2005) [#22]
i need v1.08 :-)


Takuan(Posted 2005) [#23]
If you create things like "addCameraSceneNodeFPS" you have to enter values like turnrate, movement veloc etc.
How do you change this values later?

Are things like Particels or "addCameraSceneNodeFPS" in Irrlicht time corrected to behave independent of framerate?
Will Particel movement be slower at lower frame rate?


gman(Posted 2005) [#24]
@Takuan - im afraid im not sure :( while i was able to wrap Irrlicht, im just a beginner at using Irrlicht as well. the best place to answer questions regarding the inner workings of the Irrlicht engine would be the Irrlicht forum.


Takuan(Posted 2005) [#25]
You are right, wrong forum.
Thank you for sharing that nice work:)


Takuan(Posted 2005) [#26]
....


Nennig(Posted 2005) [#27]
Hey gman,
will we be able to use shaders with your module?
thanks.


gman(Posted 2005) [#28]
im working on the shader stuff soon... have quite a bit going on right now with the fam so im taking a bit of a break :) you can look at the shader example on the irrlicht website or distribution for an example of what it will look like. i have begun preliminary stuff with the classes needed and i havent seen anything yet that will keep me from getting them done. i would say a rough estimate would be next weekend to have them done. i also have a pretty groovy idea for the ieventreciever class to help keep it from growing into really large switch and if statements. i want to get that in there as well.


Alienforce(Posted 2005) [#29]
Great... Very good work GMAN!!!
Soon will my first creation with bmax/irrlicht ready for late alpha state ;)

/Alienforce


Nennig(Posted 2005) [#30]
Wow, gman that sounds fantastic!
many thanks.


gman(Posted 2005) [#31]
blame Alienforce for getting me all excited so i couldnt sleep last night :) check the worklog. there is a new version of the mod available and sample 10 is also available.


Nennig(Posted 2005) [#32]
That is so cool gman, thanks again!
Alienforce, good job too ;-)


Alienforce(Posted 2005) [#33]
;)

GMAN!!! This rocks!!!

I think its time for a break for you...

Fantastic work you done!!!!!!!!!!!!!!!!!!!!!!!

/Alienforce


gman(Posted 2005) [#34]
@Alienforce - cant wait to see what you have going :)

@Nennig - glad you like it :)

@Takuan - for the changing of the rotation speed and such on the FPS camera... ive been examining the source and dont see a way to get at those properties. they are private and have no access functions... not very intuitive im afraid. the only way i see to do it is to delete the current FPS camera using the remove() method (use getActiveCamera() if you no longer have a reference to it) and then add a new FPS camera with the new settings. the other question i wouldnt even begin to know how to answer that one :)

EDIT: another thing you could do is add say 3 FPS cameras each with different properties. then use setActiveCamera() to switch between them.


Takuan(Posted 2005) [#35]
Awesome job.
Creating own camera movement isnt a great thing, but its a little sad if the particle or water system has no dtimer.

I found an interesting bug, just to warn you.
If you move a gui element (text) in a loop:

Text position will be drawn here at 2,0 NOT as it should at 1,0:

for s=1 to 11
text.move(T_irrposition2d_s32.creat(1,0))
next

Looks like:
x should be 1 In loop it draws at pos 1,2,3,4
x should be 2 In loop it draws at pos 2,4,6,8
x should be 3 In loop it draws at pos 3,6,9,12 etc.
Same for Y axis.

No clue how that comes.


gman(Posted 2005) [#36]
@Takuan - if im reading it right you may be misinterpreting the move method. move() will move the node relative to its current position by the amount passed in the position2d parameter. if you wish to position the node at a specific location on the screen use something like:
text.setRelativePosition(T_irrRect_s32.createFromVals(10,10,200,22))



Takuan(Posted 2005) [#37]
@gman
Wth...you are right.
Thnx for hunting that brain bug down.


gman(Posted 2005) [#38]
FYI, check the worklog. there is a new mod distribution and a new sample download showing splitscreening.


Takuan(Posted 2005) [#39]
Works nice.
Shader frontline still advancing?


regaa(Posted 2005) [#40]
cannot find -lJpeg :(

What does it mean? What can i do to solv this prob?


gman(Posted 2005) [#41]
@Takuan - the shader stuff is complete to my knowledge. all classes and methods have been wrapped to perform the shader sample and the only remaining classes left to wrap deal with custom loaders. is there something that i missed?

@regaa - you need the Irrlicht distribution. inside of the libs\devcpp folder you will find 3 .a files. you need to place these 3 in the lib directory of BlitzMax. dont overwrite if there is one already there.


regaa(Posted 2005) [#42]
Errr....ok, got it. Anyway thanks.


Takuan(Posted 2005) [#43]
Oh, havent seen that shader example.
Is there a known tool to create some effects?
Or some HLSL examples to play with?
Tried a google search but havent found anything which would work.
Any chances to get .fx Format (like "rendermonkey" output) to work?
Very exciting...that wrap rocks...


Gabriel(Posted 2005) [#44]
Or some HLSL examples to play with?


Any chances to get .fx Format (like "rendermonkey" output) to work?


I don't have RenderMonkey installed ATM, but I'm pretty sure .fx files *are* HLSL. It's possible that rendermonkey uses it's own .fx format as well, but even so it should be possible to export to HLSL.


Sweenie(Posted 2005) [#45]
Try Nvidia's FX Composer.


Takuan(Posted 2005) [#46]
Jeah thnx, just downloaded composer today.


ziggy(Posted 2005) [#47]
I just wanted to say this module is awesome. really awesome.

EDIT: I've made some changes in my IDE to support this module 100%. :) Irrlitch rocks!


Progi1984(Posted 2005) [#48]
Excuse me. I have the same problem than regaa. But i downloaded irrlicht-0.12.0.zip. and i don't find a libs\devcpp folder and 3 .a files. Can you help me ?


gman(Posted 2005) [#49]
greetings Progi1984 :)

if you downloaded the Irrlicht distro then (looks like the directory names have changed a bit):

copy lib\Win32-gcc\libIrrlicht.a to your BMAX\lib folder
copy bin\Win32-gcc\Irrlicht.dll to your windows\system32 folder

you can also download my distro which adds DX support. if you download my lib distro then inside of IrrDX_v0_12.zip you should find 4 files:

D3DX81ab.dll
D3DX92ab.dll
Irrlicht.dll
libIrrlicht.a

place libIrrlicht.a into your BMAX\lib folder. put the .dll files in your windows system32 folder.

HTH :)


Progi1984(Posted 2005) [#50]
Excuse me but I can't find this file : IrrDX_v0_12.zip, after searching too. Where can I find ?
Is Your module with Bmax 1.12 ?


gman(Posted 2005) [#51]
@Progi1984 - all downloads are available from the gg.Irrlicht worklog. the direct link to the DX one is:

IrrDX_v0_12.zip

im going to give the mods a rundown with BMAX v1.12 tonight. if there are any issues i should have new mods up sometime tomorrow.


nadia(Posted 2005) [#52]
Hi gman,
how is it going width the updating of the irrlicht mods for BMAX v1.12?
I’ve tried to run the irrlicht samples with the new demo version of BMAX v1.12 but no luck, so I hope that the updated irrlicht mods will solve the problem.


gman(Posted 2005) [#53]
@nadia - almost ready. changes in the mods are done, i just need to build the distro. i have not started on recompiling the examples yet. i would say either tonight or tomorrow morning (im -6 GMT) for the mods. the biggest issue with the samples will be the call to FlushMem(). just remove that and most, if not all, should work.

EDIT: BMAX v1.12 compatible mods are now available for download from the worklog. i spot-recompiled several examples and simply removing the FlushMem call is all that is needed. i will eventually get those updated, but it will probably be this weekend sometime.