IrrlichtWrapper 1.05 (still) beta

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
neotoma
User
User
Posts: 84
Joined: Sun Dec 14, 2003 6:38 pm
Location: Germany, Mechernich
Contact:

Post by neotoma »

SofT MANiAC wrote:huh... silence silence silence :cry:
Well, sorry ... but we work on the next release ....

I never got that DirectX8 with Irrlicht to work... i have no DirectX-SDK with DirectX8, so i'm not able to compile / link with the correct Lib.... :-(

I searched to find, but maybe we can add this in the next release.

Mike
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

neotoma wrote:Well, sorry ... but we work on the next release ....
What news? :D
POiNT.OF.PRESENCE group
neotoma
User
User
Posts: 84
Joined: Sun Dec 14, 2003 6:38 pm
Location: Germany, Mechernich
Contact:

Post by neotoma »

SofT MANiAC wrote:
neotoma wrote:Well, sorry ... but we work on the next release ....
What news? :D
Well, we will start to package a early beta next week - but this time a closed beta. So if anyone here with a special interest in testing the next version send a PM to me or Thalius.
So then after this, we hope to get all bugs (sureley not all - but the bigger ones...) in a month after starting the beta.
So it will go to end of April to releasing the next one (Version 1.4 - now version after the Irrlicht-Version).

The downside is a still uncomplete doku, not more examples to see all new features....

Still not working is the GUI-Extension (ImageGUI) and we have the problem with the Physics . It was ased on a Physics-Wrapper called IPhysics - but that project seems to be dead. So we have to disable this features.

But as a really important thing - it is now complete working with irrlicht 1.4 - so we get a much faster Engine.
Also there are now some Extras like better Particles (more than the most C++-User have !).

One hope is to make a integrate with the DirectX 9-Subsystem - but i'm not the DirectX-Expert. So i would need help for thet (from Fred and S.M. )

Mike
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

irr::video::IVideoDriver::clearZBuffer()
is missed from wrapper?? :cry:
ok, how I can use viewports without this?
POiNT.OF.PRESENCE group
neotoma
User
User
Posts: 84
Joined: Sun Dec 14, 2003 6:38 pm
Location: Germany, Mechernich
Contact:

Post by neotoma »

SofT MANiAC wrote:irr::video::IVideoDriver::clearZBuffer()
is missed from wrapper?? :cry:
ok, how I can use viewports without this?
Well, here we point one of my problems - i can't use all features. I rely on the community to tell me missing or forgotten features.

I will add this ! Thanks for mention this !

Mike
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

Code: Select all

;; Include the Irr3D-Requester   
XIncludeFile "Irr3DRequester.pb"   
;Use the  3D-Requester   
If Irr3DRequester()       
;Create the Anim-Sprite       
*animspritenode.l = IrrAddAnimSprite()   ; <- all is OK!
;Load the Sprite (size of texture = 512x128, size of frame = 128x128)       
IrrAnimSpriteLoad(*animspritenode, ".\media\animation.png" , 0,0,512,128,128,128)  ; <- access violation !!
;Set the Speed of the animation       
IrrAnimSpriteSetSpeed(*animspritenode,100)       
; -----------------------------------------------------------------------------       
; while the irrlicht environment is still running       
While IrrRunning()           
; begin the scene, erasing the canvas with sky-blue before rendering           
IrrBeginScene( 0,0,0 )           
; Draw the Scene (at the moment nothing there....)           
IrrDrawScene()           
; Draw this Sprite stretched from 10,10 To 200,200 (Screen-Cordinates !)           
IrrAnimSpriteDraw(*animspritenode,10,10,200,200)           
; End the Scene           
IrrEndScene()      
 Wend   
 EndIf   
;End Irrlicht   
IrrStop()   
End
AnimSprite section doesn't work?

--------------------------

Also:
For some 2D-Functions you can use this AnimSprite. It is basically a small Sprite-Wrapper for Irrlicht. So you can move, rotate and stretch the Sprite.
How to rotate? Like any Scene Nodes? (But if AnimSprite doesn't work, then nevermind =/ )
POiNT.OF.PRESENCE group
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

OK, lets start!
Example 30: Using the Image-GUI example doesn't work coz have many bugs... It works (but have restrictions with animation) after bugfixes:
Image

Code: Select all

; !! COMMENTED !! LOOKS REALLY UGLY !!
;IrrSetTextureCreationFlag(#IRR_ETCF_ALWAYS_32_BIT, #True)

Code: Select all

; !! BUG HERE !! CAN'T ANIMATE STRIP bbp2.tga !!
; !! You can replace bbp2.tga -> bb1.tga !!
; !! animation works only if texture height >= 128 and width <= 255 
IrrGuiImageSkinLoad(*skin,#IRR_EGEIT_BUTTON_PANE_PRESSED, "media/skins/bb1.tga", 0,0,114*8,114,114,114,#False);

Code: Select all

; !! BUG HERE !! CAN'T ANIMATE STRIP fireline_e0.tga !!
; !! You can replace fireline_e0.tga -> bg4.tga !!
; !! animation works only if texture height >= 128 and width <= 255 
IrrGuiImageSkinLoad(*skin,#IRR_EGEIT_WINDOW_BACKGROUND_TITLEBAR, "media/skins/bg4.tga", 0,0,255,128,64,128,#False);

Code: Select all

; !! BUG HERE !! CAN'T ANIMATE STRIP blackbsqpush.tga !!
; !! You can replace blackbsqpush.tga -> blackbsq.tga !!
; !! animation works only if texture height >= 128 and width <= 255 
IrrGuiImageSkinLoad(*skin,#IRR_EGEIT_BUTTON_PANE_PRESSED, "media/skins/blackbsq.tga", 0,0,145*8,145,145,145,#False);

Code: Select all

; !! BUG HERE !! 
; !! INCORRECT CODE: *wnd.l = IrrGuiAddWindow(450,25,640,480, "Toolset", 0, 5000)
; !! CORRECT CODE:   *wnd.l = IrrGuiAddWindow(450,25,640,480, "Toolset", 0, *rooElm, 5000)

Code: Select all

; !! BUG HERE !!
; !! INCORRECT CODE: *tab.l = IrrGuiAddTabControl(2,20,640-452,480-7,*wnd,#True,#True,9999)
; !! CORRECT CODE:   *tab.l = IrrGuiAddTabControl(2,20,640-452,480-7,#True,#True,*wnd,9999)

Code: Select all

; !! BUG HERE (?) !!
; INCORRECT CODE: ProcedureDLL.l eventCallback(*event.SEvent)
; CORRECT CODE:   ProcedureC eventCallback(*event.SEvent)
=============================================

Next....

Code: Select all

IrrAnimSpriteLoad(*animspritenode, ".\media\animation.jpg" , 0,0,128*4,128,128,128, #False)  ; <- access violation !!
But if texture 255x225 px all works good

:evil: ?? Whats a hell ?? :twisted:
POiNT.OF.PRESENCE group
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

IrrlichtWrapper 1.05 UserLibrary v0.1

Post by SofT MANiAC »

One night of coding :)
Just test it...

=====================================
IrrlichtWrapper 1.05 UserLibrary v0.1
=====================================

==========================================================================================
TailBite v1.3 PR 1.865 by Miguel Calderуn aka El_Choni and other good peoples :)
IrrlichtWrapper 1.05 for PureBasic by Michael Taupitz (neotoma) & Marius Eckardt (Thalius)
UserLibrary by SofT MANiAC (2008)
==========================================================================================

=====
Why??
=====
I hope next IW release will be more user-friendly :)
Userlib, resident, context help-system... It is rather convenient :)
Well, It is a first attempt :)


=======
Install
=======
*** Original IW 1.05 must be installed ***
Just copy files from 'PureBasic' folder from package to your PureBasic directory...
Delete "XIncludeFile #PB_Compiler_Home + "Includes\IrrlichtWrapper_Include.pbi"" string from 'Irr3DRequester.pb'
Open IW 1.05 example and run!

Source code of userlib and creation tools included - you can use them somehow :)


============
Known issues
============
* TailBite v1.3 PR 1.865 / IrrlichtWrapper 1.05 issue...
TB mixes 2 functions - IrrSetMaterialParam and IrrSetMaterialParam2 in ".desc" file...
coz (TailBite man):
"You can make your function accept variable arguments. To do so, you must include two or more
ProcedureDLL's with the same name and an index number...
To be considered as different versions of the same function with different argument number,
the arguments names and types must coincide between them; otherwise, both functions will
be considered different functions and processed that way."
But this issue solved "with a little help from" Macro :)

* IrrlichtWrapper 1.05 issue...
These functions are present at import:
IrrSetNodeDebugData(*node.l, bDebug.l)
IrrImageUnLock( *ptr2IrrlichtImage )
but can't be found in IrrlichtWrapper.lib

I am not guilty! :)

* Some bugs with:
IrrAddSplineAnimator
IrrGetNodePosition
IrrGetNodeRotation
IrrMatrixGetTransform
If you know, why it occurs, inform me please!!

* Help-system really poor yet :)

You can download it here:
[send me PM]
Last edited by SofT MANiAC on Tue Apr 15, 2008 12:18 pm, edited 1 time in total.
POiNT.OF.PRESENCE group
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

@neotoma & Thalius
IrrGuiButtonIsPressed returns address ??

For example:

1. Button not pressed.
Returns 31563008

2. Button pressed.
Returns 31563009 (31563008 + 1 !!)

Any ideas?
POiNT.OF.PRESENCE group
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

Code: Select all

IrrGetTexture(file.s)
How to remove it after from memory?
Or it's impossible?
POiNT.OF.PRESENCE group
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

How to rotate and scale sprites?
How to release textures?
(mini tutorial)


Well... If U using DirectX - no problems :)
1. Install "DirectX 9C for PureBasic" by Steven "Dreglor" Garcia
2. Create new PB project
3. Attach IrrlichtWrapper and DX-includes:

Code: Select all

XIncludeFile #PB_Compiler_Home + "path_to_IrrlichtWrapper\Irrlichtwrapper_include.pbi"
	IncludePath #PB_Compiler_Home + "path_to_DirectX_includes\"
	XIncludeFile "d3dx9.pbi"
4. Some globals:

Code: Select all

Global *D3D.IDirect3D9
	Global *D3DDevice.IDIRECT3DDEVICE9
5. Useable proc:

Code: Select all

Procedure D3D9_LoadTexture(*Texture.IDIRECT3DTEXTURE9, File.s)
	  If D3DXCreateTextureFromFile(*D3DDevice, File, *Texture) = #D3D_Ok
	    *D3DDevice\SetSamplerState(0, #D3DSAMP_MINFILTER, #D3DTEXF_LINEAR)
	    *D3DDevice\SetSamplerState(0, #D3DSAMP_MAGFILTER, #D3DTEXF_LINEAR)
	    ProcedureReturn #True
	  Else
	    ;failed to load texture
	    ProcedureReturn #False
	  EndIf
	EndProcedure
6. Init. Irrlicht-Device:

Code: Select all

IrrStartEx(#IRR_EDT_DIRECT3D9, 1024, 768, #False, #False, #True, 32, #True, #True, #True, 0)
7. Fills the SExposedVideoData-Structure with the information from Irrlicht. You can grab the DirectX-Interfaces to use it for some own drawings.

Code: Select all

IrrGetExposedVideoData(@videodatas.SExposedVideoData)
	*D3DDevice = videodatas\D3D9\D3D9Dev
8. Let's load a texture from file:

Code: Select all

*Texture.IDIRECT3DTEXTURE9
	If D3D9_LoadTexture(@*Texture, "path_to_IW_examples\media\sliced_pacman.png") = #False
	  ;failed to create texture
	  End
	EndIf
9. Now we shall create sprite:

Code: Select all

D3DXCreateSprite(videodatas\D3D9\D3D9Dev, @*sp.ID3DXSPRITE)
10. Matrix has U!

Code: Select all

Mat.D3DXMATRIX
	pScaling.D3DXVECTOR2
	pScaling\x=3 ; width stretch factor
	pscaling\y=2 ; height stretch factor
	angle.f ; rotation, radians
	D3DXMatrixTransFormation2D(@MAt, #Null, 0, @pScaling, #Null, angle, #Null)
11. Play with it!

Code: Select all

pSrcRect.RECT
	pSrcRect\Top=0
	pSrcRect\Left=0
	pSrcRect\Bottom = 72
	pSrcRect\Right = 78

	pPosition.d3dxvector3
	pPosition\x = 0
	pPosition\y = 0
	pPosition\z = 0

	pCenter.d3dxvector3
	pCenter\x = 200
	pCenter\y = 300
	pCenter\z = 0
12. Final:

Code: Select all

While IrrRunning()
		; begin the scene, erasing the canvas to blue before rendering
		IrrBeginScene(0,0,255)
		
		; <<< any irrlicht commands here >>> 
		
		*sp\Begin(#D3DXSPRITE_ALPHABLEND) ; we need alpha-channel
	    *sp\SetTransform(@Mat) ; let's apply our matrix
	    *sp\Draw(*Texture, @pSrcRect, @pCenter, @pPosition, $FFFFFFFF) ; draw sprite (last param is ARGB color)
	    *sp\End() ; all is ready!
		
		; <<< any irrlicht commands here >>> 
		
		IrrEndScene()
	Wend
	IrrStop()
13. How to release a texture (DX texture (interface IDIRECT3DTEXTURE9) !! Not irr_texture!!!)? Without ceremony! :D

Code: Select all

*Texture\Release() 
POiNT.OF.PRESENCE group
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

10x for feedback :wink:

... today I've found out the important thing:
If you want to use irrKlang in a commercial product, you need to purchase an irrKlang pro license.
well...
irrKlang Pro full

License for irrKlang to by used in one commercial product. Includes all irrKlang Pro features, on all supported platforms, updates, access to preliminary patches, priorized support via mail.

390€
:shock:

The BASS costs more cheaply (Shareware licence - the best for casual game developers). Also BASS has some nice features (mo3-format support etc.)
Shareware licence: €100
The "shareware" licence allows the usage of BASS in an unlimited number of your shareware products, which must sell for no more than 40 Euros each. If you're an individual (not a corporation) making and selling your own software (and its price is within the limit), this is the licence for you.
thats all
POiNT.OF.PRESENCE group
Thalius
Enthusiast
Enthusiast
Posts: 711
Joined: Thu Jul 17, 2003 4:15 pm
Contact:

Post by Thalius »

Whew! Back on Track - yet slowly - its summer here and i am STILL single ! :twisted:

Going to work on the new version - and fix some old stuff.

And thoose waiting for PM replys .. sorry coming .. I kind of ged flooded at times with work then tend to sink in the undergrounds of an IT Cave for several Months =P

Cheers,
Thalius
"In 3D there is never enough Time to do Things right,
but there's always enough Time to make them *look* right."
"psssst! i steal signatures... don't tell anyone! ;)"
SofT MANiAC
Enthusiast
Enthusiast
Posts: 142
Joined: Mon Sep 17, 2007 10:28 am
Location: P.O.P
Contact:

Post by SofT MANiAC »

Welcome back Marius! :)
... I'm waiting for your answer ...
POiNT.OF.PRESENCE group
User avatar
IceSoft
Addict
Addict
Posts: 1682
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

Thalius wrote:... and i am STILL single ! :twisted:
Belive me: be married or having a girlfriend is not better to having free programming time.
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
Post Reply