
MP3D Engine Alpha 33
Re: MP3D Engine Alpha 32
@mpz: Thought I'd give you a heads up. For some strange reason, MP_PositionCamera() & MP_CameraLookAt() and anything to do with the camera rotation or position is not a command even though it shows up as a command, in the latest help file. Can you please fix this issue as well as add a "MP_CopyEntity()" command so that I can copy entities without the need for the MP3D hack? Thank You & have a nice day! 

-
- Enthusiast
- Posts: 497
- Joined: Sat Oct 11, 2008 9:07 pm
- Location: Germany, Berlin > member German forum
Re: MP3D Engine Alpha 32
Hi,
@applePi, that was i need. I make at first a point mesh for testing...
@Mythos, yes the help is not actuall, i am working on it, see new camera functions:
51) function name changed:
MP_MoveCamera(Cam, x.f, y.f, z.f) -> change to MP_MoveEntity (Entity, x.f, y.f, z.f )
MP_PositionCamera (Cam, x.f, y.f, z.f) -> change to MP_PositionEntity (Entity, x.f, y.f, z.f )
MP_CameraGetX (Cam) -> change to MP_EntityGetX (Entity)
MP_CameraGetY (Cam) -> change to MP_EntityGetY (Entity)
MP_CameraGetZ (Cam) -> change to MP_EntitySetZ (Entity)
MP_RotateCamera (Cam, pitch.f, yaw.f, roll.f) -> change to MP_RotateEntity (Entity, pitch.f, yaw.f, roll.f)
MP_TurnCamera (Cam, pitch.f, yaw.f, roll.f) -> change to MP_TurnEntity (Entity, pitch.f, yaw.f, roll.f)
MP_CameraLookAt(Cam,x.f,y.f,z.f) -> change to MP_EntityLookAt (Entity,x.f,y.f,z.f)
52) rewritten the camera functions: MP_TurnEntity (Camera, pitch.f, yaw.f, roll.f) for example
-> MP_CopyEntity (Entity) is a comand in mp3d and must work. Is there a problem?
Greetings Michael
@applePi, that was i need. I make at first a point mesh for testing...
@Mythos, yes the help is not actuall, i am working on it, see new camera functions:
51) function name changed:
MP_MoveCamera(Cam, x.f, y.f, z.f) -> change to MP_MoveEntity (Entity, x.f, y.f, z.f )
MP_PositionCamera (Cam, x.f, y.f, z.f) -> change to MP_PositionEntity (Entity, x.f, y.f, z.f )
MP_CameraGetX (Cam) -> change to MP_EntityGetX (Entity)
MP_CameraGetY (Cam) -> change to MP_EntityGetY (Entity)
MP_CameraGetZ (Cam) -> change to MP_EntitySetZ (Entity)
MP_RotateCamera (Cam, pitch.f, yaw.f, roll.f) -> change to MP_RotateEntity (Entity, pitch.f, yaw.f, roll.f)
MP_TurnCamera (Cam, pitch.f, yaw.f, roll.f) -> change to MP_TurnEntity (Entity, pitch.f, yaw.f, roll.f)
MP_CameraLookAt(Cam,x.f,y.f,z.f) -> change to MP_EntityLookAt (Entity,x.f,y.f,z.f)
52) rewritten the camera functions: MP_TurnEntity (Camera, pitch.f, yaw.f, roll.f) for example
-> MP_CopyEntity (Entity) is a comand in mp3d and must work. Is there a problem?
Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: MP3D Engine Alpha 32
Bus with rotation and turns !?
2 short tips, so no need comments. Test yourselves.
2 short tips, so no need comments. Test yourselves.
Code: Select all
MP_Graphics3D (640,480,0,2)
Camera=MP_CreateCamera()
MP_CreateLight(1)
MP_PositionEntity(Camera,0,1,-3) ; Position des Würfels
MP_EntityLookAt(camera,0,0,0)
Mesh=MP_CreateCube() ; Und jetzt eine Würfel
If CreateImage(0,255,255) ; Male schöne Textur
Font=LoadFont(#PB_Any, "Arial" , 138)
StartDrawing(ImageOutput(0))
Box(0, 0, 128, 128,RGB(255,0,0))
Box(128, 0, 128, 128,RGB(0,255,0))
Box(0, 128, 128, 128,RGB(0,0,255))
Box(128, 128, 128, 128,RGB(255,255,0))
DrawingFont(FontID(Font))
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(73,35,"5")
StopDrawing() ; This is absolutely needed when the drawing operations are finished !!! Never forget it !
EndIf
Texture=MP_ImageToTexture(0) ; Create Texture from image
MP_EntitySetTexture(Mesh, Texture ) ; textur to mesh
While MP_KeyUp(#PB_Key_Escape)
If MP_KeyHit(#PB_Key_1)
For t.l=1 To 90
MP_TurnEntity(Mesh,0,1,0)
MP_RenderWorld()
MP_Flip()
Next
ElseIf MP_KeyHit(#PB_Key_2)
For t=1 To 90
MP_TurnEntity(Mesh,0,0,1); <- incorrect behaviour if done after other rotation !
MP_RenderWorld()
MP_Flip()
Next
ElseIf MP_KeyHit(#PB_Key_3)
For t=1 To 90
MP_TurnEntity(Mesh,1,0,0); <- incorrect behaviour if done after other rotation !
MP_RenderWorld()
MP_Flip()
Next
EndIf
MP_RenderWorld()
MP_Flip()
Wend
Code: Select all
MP_Graphics3D (640,480,0,2)
Camera=MP_CreateCamera()
MP_CreateLight(1)
MP_PositionEntity(Camera,0,1,-3) ; Position des Würfels
MP_EntityLookAt(camera,0,0,0)
Mesh=MP_CreateCube() ; Und jetzt eine Würfel
If CreateImage(0,255,255) ; Male schöne Textur
Font=LoadFont(#PB_Any, "Arial" , 138)
StartDrawing(ImageOutput(0))
Box(0, 0, 128, 128,RGB(255,0,0))
Box(128, 0, 128, 128,RGB(0,255,0))
Box(0, 128, 128, 128,RGB(0,0,255))
Box(128, 128, 128, 128,RGB(255,255,0))
DrawingFont(FontID(Font))
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(73,35,"5")
StopDrawing() ; This is absolutely needed when the drawing operations are finished !!! Never forget it !
EndIf
Texture=MP_ImageToTexture(0) ; Create Texture from image
MP_EntitySetTexture(Mesh, Texture ) ; textur to mesh
While MP_KeyUp(#PB_Key_Escape)
If MP_KeyHit(#PB_Key_1)
For t.l=1 To 90
MP_RotateEntity(Mesh,MP_EntityGetPitch(Mesh),t,MP_EntityGetRoll(Mesh))
MP_RenderWorld()
MP_Flip()
Next
ElseIf MP_KeyHit(#PB_Key_2)
For t=1 To 90
MP_RotateEntity(Mesh,MP_EntityGetPitch(Mesh),MP_EntityGetYaw(Mesh),t)
MP_RenderWorld()
MP_Flip()
Next
ElseIf MP_KeyHit(#PB_Key_3)
For t=1 To 90
MP_RotateEntity(Mesh,t,MP_EntityGetYaw(Mesh),MP_EntityGetRoll(Mesh))
MP_RenderWorld()
MP_Flip()
Next
EndIf
MP_RenderWorld()
MP_Flip()
Wend
Re: MP3D Engine Alpha 32
@mpz: The source to my webstream would essentially be a server created from MP3D, and would be able to stream both audio AND video, or just audio from a webcam that I plug in. If you need more details, feel free to ask.
Re: MP3D Engine Alpha 32
Hi mpz! Great Job!! is very usefull!
A lot of thanks!
A quest.. is possible have two or more 'mpzscreens 3D'?
if yes.. how?. Thanks!!
A lot of thanks!

A quest.. is possible have two or more 'mpzscreens 3D'?
if yes.. how?. Thanks!!
If translation=Error: reply="Sorry, Im Spanish": Endif
Re: MP3D Engine Alpha 32
About your installer
this code: in my Home , return Nothing!
My Purebasic is not installed by default in C: \ ....
but in such a case:
E: \ Purebasic_5_22 \ 86 \
and E: \ Purebasic_5_22 \ 64 \
so I changed your installer like this:
Line 40 :
I was able to indicate or was the root folder of my Purebasic
Now, it works
Thank you for allowing the source of the installer
this code: in my Home , return Nothing!
Code: Select all
; PurebasicHome.s = GetEnvironmentVariable("PUREBASIC_HOME")
; Debug PurebasicHome.s
; Calldebugger
My Purebasic is not installed by default in C: \ ....
but in such a case:
E: \ Purebasic_5_22 \ 86 \
and E: \ Purebasic_5_22 \ 64 \
so I changed your installer like this:
Line 40 :
Code: Select all
PurebasicHome.s = PathRequester("select Racine Path Purebasic", "c:\") ;;GetEnvironmentVariable("PUREBASIC_HOME")
If PurebasicHome = ""
End ;PurebasicHome = ;;GetEnvironmentVariable("ProgramFiles") + "\Purebasic\"
EndIf
I was able to indicate or was the root folder of my Purebasic
Now, it works

Thank you for allowing the source of the installer

Re: MP3D Engine Alpha 32
Yes Dobro, is right!. When I install wth same result.dobro wrote:About your installer
this code: in my Home , return Nothing!
I need move files to the right folder, PB home.. work perfect. Very good lib mpz!

I change the code with your correction.
gretings and thanks again.
If translation=Error: reply="Sorry, Im Spanish": Endif
-
- Enthusiast
- Posts: 497
- Joined: Sat Oct 11, 2008 9:07 pm
- Location: Germany, Berlin > member German forum
Re: MP3D Engine Alpha 32
Hi to all,
@dobor - thanks, i will use these sample or has anybody a better idea to read the Purebasic Home folder?
@minimy - thanks, possible have two or more 'mpzscreens 3D, im sorry not now
@Mythros - i dont find a code how to stream a video with "AVIFIL32.DLL" over a network or play a film from ram..
@Psychophanta if this is a bug, the dx9 function windows must be wrong too
I have made a dx9 hack to show you my "turn" code. I think the problem is when you make turns you start with yaw, pitch and then roll and this could be the problem. Perhaps anybody has an idea to these "bug" ?!?
@dobor - thanks, i will use these sample or has anybody a better idea to read the Purebasic Home folder?
@minimy - thanks, possible have two or more 'mpzscreens 3D, im sorry not now
@Mythros - i dont find a code how to stream a video with "AVIFIL32.DLL" over a network or play a film from ram..
@Psychophanta if this is a bug, the dx9 function windows must be wrong too

Code: Select all
Structure D3DXMATRIX
_11.f : _12.f : _13.f : _14.f
_21.f : _22.f : _23.f : _24.f
_31.f : _32.f : _33.f : _34.f
_41.f : _42.f : _43.f : _44.f
EndStructure
Structure MeshStruct
kind.i ; pointer to kind of entity, for mesh kind = 1
Mesh.i ; pointer to meshinterface
MeshPosition.D3DXMATRIX ; position in 3D matrix
more.i
muchmore.i
EndStructure
Macro D3DXToRadian(Degree)
(Degree * 0.017453292519943295)
EndMacro
Import "d3dx9.lib"
D3DXMatrixRotationYawPitchRoll (*pOut.D3DXMATRIX, Yaw.f, Pitch.f, Roll.f)
EndImport
InitNetwork()
MP_Graphics3D (640,480,0,2)
Camera=MP_CreateCamera()
MP_CreateLight(1)
MP_PositionEntity(Camera,0,1,-450) ; Position des Würfels
MP_EntityLookAt(camera,0,0,0)
file$=GetTemporaryDirectory()+"su47.X"
If ReceiveHTTPFile( "http://www.flasharts.de/mpz/su47.X",file$) = 0
MessageRequester("Error","su47.X file not found - internet working?")
End
EndIf
*Mesh.MeshStruct = MP_loadMesh(file$) ; Und jetzt eine Würfel
;Mesh=MP_CreateCube() ; Und jetzt eine Würfel
pitch.f = 0
yaw.f = 0
roll.f = 0
While MP_KeyUp(#PB_Key_Escape)
WindowEvent()
If MP_KeyHit(#PB_Key_1)
For t.l=1 To 90
;MP_TurnEntity(*Mesh,0,1,0) : MP_TurnEntity(*Mesh,pitch.f,yaw.f,roll.f)
yaw.f + D3DXToRadian(1)
D3DXMatrixRotationYawPitchRoll (*Mesh\MeshPosition, Yaw, Pitch, Roll)
MP_RenderWorld()
MP_Flip()
Next
ElseIf MP_KeyHit(#PB_Key_2)
For t=1 To 90
;MP_TurnEntity(*Mesh,0,0,1); <- incorrect behaviour if done after other rotation !
roll.f + D3DXToRadian(1)
D3DXMatrixRotationYawPitchRoll (*Mesh\MeshPosition, Yaw, Pitch, Roll)
MP_RenderWorld()
MP_Flip()
Next
ElseIf MP_KeyHit(#PB_Key_3)
For t=1 To 90
;MP_TurnEntity(*Mesh,1,0,0); <- incorrect behaviour if done after other rotation !
pitch.f + D3DXToRadian(1)
D3DXMatrixRotationYawPitchRoll (*Mesh\MeshPosition, Yaw, Pitch, Roll)
MP_RenderWorld()
MP_Flip()
Next
EndIf
MP_RenderWorld()
MP_Flip()
Wend
Working on - MP3D Library - PB 5.73 version ready for download
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: MP3D Engine Alpha 32
At the moment I must say that TurnEntity (and also the functions in your tip) just turns the entity relatively to it self, i.e., there is not an absolute world coordinates rotation, but relative to the current Pitch, Yaw and Roll of the own entity, you see?mpz wrote:if this is a bug, the dx9 function windows must be wrong tooI have made a dx9 hack to show you my "turn" code. I think the problem is when you make turns you start with yaw, pitch and then roll and this could be the problem. Perhaps anybody has an idea to these "bug" ?!?
Tomorrow i will try to test the same tips with dreamotion3d and when i do i will say something.
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: MP3D Engine Alpha 32
Tested in Dreamotion3D, and the result is also chaotic... 
However, Dreamotion has a flag for TurnEntity() which can be 0 (same behaviour a MP3D) or 1, where the rotation is always relative to the mesh:

However, Dreamotion has a flag for TurnEntity() which can be 0 (same behaviour a MP3D) or 1, where the rotation is always relative to the mesh:
With 'type' flag activated, the aircraft always turn to its right or left side (for yaw), to its upside or downside (for pitch), and the same for roll.Type = type of movement, air (true) or standard (false).
Re: MP3D Engine Alpha 32
Thanks for the installer source, mpz! Installed it correctly and tried all demos now,
and I am impressed. Only 1 demo didn't work because of a hard coded path ("c:\programme\..").
It's too bad that it is not cross-platform with OpenGL support... but nice 3D/effect engine for Windows.
Are you able to make it available as DLL/C_static_lib for use with other Windows programming systems?
and I am impressed. Only 1 demo didn't work because of a hard coded path ("c:\programme\..").
It's too bad that it is not cross-platform with OpenGL support... but nice 3D/effect engine for Windows.
Are you able to make it available as DLL/C_static_lib for use with other Windows programming systems?
Re: MP3D Engine Alpha 32
Hello, @mpz!
Any progress updates?
Thank You kindly, sir! 



-
- Enthusiast
- Posts: 497
- Joined: Sat Oct 11, 2008 9:07 pm
- Location: Germany, Berlin > member German forum
Re: MP3D Engine Alpha 32
Hi,
@Danilo, Thanks. These version is for Dx because i like Directx and want to upragde it to dx11 sometimes. I have no time to make different versions (dx9/OpenGll) and don't want to make a dll version because i like pb an if anybody wants to use it he needs pb
. There are much other 3d libs with dll files and i want to concentrate me to PB...
@Mythros yes, i test now the Newton point cloud to mesh function and wants to use it in MP3D. Other special functions are comming soon too...
Greetings Michael
@Danilo, Thanks. These version is for Dx because i like Directx and want to upragde it to dx11 sometimes. I have no time to make different versions (dx9/OpenGll) and don't want to make a dll version because i like pb an if anybody wants to use it he needs pb

@Mythros yes, i test now the Newton point cloud to mesh function and wants to use it in MP3D. Other special functions are comming soon too...
Greetings Michael
Working on - MP3D Library - PB 5.73 version ready for download
Re: MP3D Engine Alpha 32
Hi all. I've been working on this installer for the last 7 hours. And now that I'm tired, I've decided to release it. Knowledge is freedom!
It may or may not need a few fixes, if you have found a bug that I didn't, please post a fix below this post!
Without further adieu, MP3D Installer - V.0.2!
MP3D_Installer_V.0.2.pb:
Once again, thank you @mpz for making this & releasing the source & for your MP3D! Couldn't have done it without you! 
Credit for the original script goes to @mpz!
Thanks!
~Mythros
It may or may not need a few fixes, if you have found a bug that I didn't, please post a fix below this post!
Without further adieu, MP3D Installer - V.0.2!
MP3D_Installer_V.0.2.pb:
Code: Select all
;////////////////////////////////////////////////////////////////
;//
;// Project Title: MP 3D Engine Demo Programs
;// Dateiname: MP3d_Installer.pb
;// Erstellt am: 3.Mai.2014
;// Update am :
;// Author: Michael Paulwitz
;//
;// Info:
;// Simple Installer fro Mp3d
;//
;//
;////////////////////////////////////////////////////////////////
Global MP_http.s = "http://www.flasharts.de/mpz/",PurebasicHome.s
InitNetwork()
UseZipPacker()
Global mainwindow
Global frm
Global pbcombo
Global pbcombo2
Global progressbar
Global optional_title_gadget
Global threadsave
Global pbdir_title
Global PurebasicHome.s
Global pbhome
Global install
Global exitinstall
Global pbeditor
Global mp3d_libonly
Procedure OpenWindow_0(x = 0, y = 0, width = 450, height = 550)
mainwindow = OpenWindow(#PB_Any, x, y, width, height, "MP3D Installer - V.0.2", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
pbcombo_title = TextGadget(#PB_Any, 60, 80, 100, 20, "Select PB Version: ")
pbcombo = ComboBoxGadget(#PB_Any, 60, 100, 100, 20)
AddGadgetItem(pbcombo, 0, "Purebasic 5.11")
AddGadgetItem(pbcombo, 1, "Purebasic 5.22")
pbcombo2_title = TextGadget(#PB_Any, 290, 80, 150, 20, "Select OS Type: ")
pbcombo2 = ComboBoxGadget(#PB_Any, 290, 100, 100, 20)
AddGadgetItem(pbcombo2, 0, "x86 (32 bit)")
AddGadgetItem(pbcombo2, 1, "x64 (64 bit)")
SetGadgetState(pbcombo, 1)
SetGadgetState(pbcombo2, 0)
optional_title_gadget = TextGadget(#PB_Any, 117, 30, 220, 20, "Welcome message here!", #PB_Text_Center)
pbdir_title = TextGadget(#PB_Any, 180, 135, 100, 20, "Purebasic directory")
PurebasicHome.s = GetEnvironmentVariable("PUREBASIC_HOME")
If PurebasicHome = ""
PurebasicHome = GetEnvironmentVariable("ProgramFiles") + "/Purebasic"
EndIf
pbhome = StringGadget(#PB_Any, 60, 155, 330, 20, PurebasicHome)
install = ButtonGadget(#PB_Any, 60, 500, 100, 25, "Install")
exitinstall = ButtonGadget(#PB_Any, 290, 500, 100, 25, "Exit Installer")
progressbar = ProgressBarGadget(#PB_Any, 60, 460, 330, 20, 0, 1000, #PB_ProgressBar_Smooth)
pbeditor = EditorGadget(#PB_Any, 60, 280, 330, 160, #PB_Editor_WordWrap)
miscellaneous = TextGadget(#PB_Any, 187, 185, 125, 20, "Miscellaneous")
mp3d_libonly = CheckBoxGadget(#PB_Any, 60, 200, 100, 20, "MP3D_lib only")
threadsafe = CheckBoxGadget(#PB_Any, 60, 220, 150, 20, "Threadsafe (coming soon)")
DisableGadget(threadsafe, 1)
EndProcedure
Procedure Write_help()
file$=GetTemporaryDirectory()+"mp3d"
If ReceiveHTTPFile( MP_http + "mp33_beta/Help/MP3D_Library.chm",file$)=0
MessageRequester("Error :: 404","Help File not found - Please check your internet connection & try again later...")
ProcedureReturn
EndIf
CreateDirectory(PurebasicHome+"Help")
Text$ = PurebasicHome+"Help/MP3D_Library.chm"
If CopyFile(file$, PurebasicHome+"Help/MP3D_Library.chm")
AddGadgetItem(pbeditor, 0, "Wrote "+Text$+" Successfully!")
EndIf
SetGadgetState(progressbar, 100)
EndProcedure
Procedure Write_lib()
file$=GetTemporaryDirectory()+"mp3d"
If GetGadgetState(pbcombo2)=0
If ReceiveHTTPFile( MP_http + "mp33_beta/lib32/Lib32.zip",file$)=0
MessageRequester("Error 404 (32-bit)","File(s) not found - Please check your internet connection & try again later...")
ProcedureReturn
EndIf
ElseIf GetGadgetState(pbcombo2)=1
If ReceiveHTTPFile( MP_http + "mp33_beta/lib64/Lib64.zip",file$)=0
MessageRequester("Error 404 (64-bit)","File(s) not found - Please check your internet connection & try again later...")
ProcedureReturn
EndIf
EndIf
If OpenPack(0, file$)
If ExaminePack(0)
While NextPackEntry(0)
Text$ = PurebasicHome+"PureLibraries\Windows\Libraries"+PackEntryName(0)
UncompressPackFile(0, Text$)
AddGadgetItem(pbeditor, 1, "Wrote "+Text$+" Successfully!")
WindowEvent()
Wend
EndIf
ClosePack(0)
EndIf
SetGadgetState(progressbar, 200)
EndProcedure
Procedure Write_Demos()
SetGadgetText(pbeditor, "Decompressing demo files... ")
file$=GetTemporaryDirectory()+"mp3d"
If ReceiveHTTPFile(MP_http + "mp33_beta/Examples/MP3D_Demos.zip",file$)=0
MessageRequester("Error :: 404","File(s) not found..."+Chr(13)+Chr(10)+Chr(13)+Chr(10)+"Please check your internet connection & try again later...")
ProcedureReturn
EndIf
CreateDirectory(PurebasicHome+"Examples/MP3D Demos")
count = 200
If OpenPack(0, file$)
If ExaminePack(0)
While NextPackEntry(0)
Text$ = PurebasicHome+"Examples/"+PackEntryName(0)
If UncompressPackFile(0, Text$) = -1
CreateDirectory( GetPathPart(Text$))
UncompressPackFile(0, Text$)
EndIf
txt.s = txt.s + "Wrote "+Text$+" Successfully!"+Chr(13)+Chr(10)
AddGadgetItem(pbeditor, 2, txt.s)
SetGadgetState(progressbar, count)
count + 1
WindowEvent()
Wend
EndIf
ClosePack(0)
EndIf
SetGadgetState(progressbar, 800)
EndProcedure
Procedure Write_Mp3dlib()
file$=GetTemporaryDirectory()+"mp3d"
If GetGadgetState(pbcombo) = 0
If GetGadgetState(pbcombo2)
Text$ = MP_http + "mp33_beta/dx9/pb522_32/MP3D_Library.zip"
Else
Text$ = MP_http + "mp33_beta/dx9/pb522_64/MP3D_Library.zip"
EndIf
ElseIf GetGadgetState(pbcombo) = 1
If GetGadgetState(pbcombo2)
Text$ = MP_http + "mp33_beta/dx9/pb511_32/MP3D_Library.zip"
Else
Text$ = MP_http + "mp33_beta/dx9/pb511_64/MP3D_Library.zip"
EndIf
EndIf
If ReceiveHTTPFile( Text$,file$)=0
MessageRequester("Error :: 404","File(s): '"+Text$+"' not found..."+Chr(13)+Chr(10)+Chr(13)+Chr(10)+"Please check your internet connection & try again later...")
ProcedureReturn
EndIf
CreateDirectory(PurebasicHome+"SubSystems\dx9")
Text$ = PurebasicHome+"SubSystems\dx9\purelibraries"
CreateDirectory(Text$)
If OpenPack(0, file$)
If ExaminePack(0)
While NextPackEntry(0)
Text$+"\MP3D_Library"
UncompressPackFile(0, Text$)
AddGadgetItem(pbeditor, 3, "Wrote File: "+Text$+" Successfully!")
WindowEvent()
Wend
EndIf
ClosePack(0)
EndIf
AddGadgetItem(pbeditor, 4, "Installed MP3D Successfully!")
SetGadgetState(progressbar, 1000)
EndProcedure
Procedure Window_0_Events(event)
Select event
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Gadget
Select EventGadget()
Case install
SetGadgetState(install, 0)
PBdir.s = GetGadgetText(pbhome)
If ExamineDirectory(0, PBdir, "*.*")
a = 1
FinishDirectory(0)
EndIf
If a = 0
MessageRequester("Error :: 404","File(s) not found in directory '"+PBdir+"'...", #PB_MessageRequester_Ok)
ProcedureReturn
EndIf
PurebasicHome = GetGadgetText(pbhome)
If GetGadgetState(mp3d_libonly) ; Install mp3dlib only
Write_Mp3dlib()
Else
Write_help()
Write_lib()
Write_Demos()
Write_Mp3dlib()
EndIf
Case exitinstall
End
EndSelect
EndSelect
ProcedureReturn #True
EndProcedure
OpenWindow_0()
Repeat
Event = WindowEvent()
Select EventWindow()
Case MainWindow
Window_0_Events(event)
EndSelect
Until Event = #PB_Event_CloseWindow
; IDE Options = PureBasic 5.22 LTS (Windows - x86)
; CursorPosition = 229
; FirstLine = 177
; Folding = --
; EnableAsm
; EnableXP
; EnableAdmin
; DisableDebugger

Credit for the original script goes to @mpz!
Thanks!
~Mythros