PureGDK Open Beta - DarkBasic for PureBasic

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Can you be more specific about the hanging? Can you not end it even from the task manager?

Ending the process from the "Kill Program" button on the IDE will cause the program to hang momentarily if there is a deadlock (mutex conflict for example). I haven't been able to figure out what's causing this.

A PureGDK executable will close itself quickly after it receives a #WM_CLOSE message either from the x button, by hitting escape, or some other source. The PureBasic IDE does not send this message because it assumes that your program is in a locked state.
freak wrote:There is no WM_CLOSE posted.
The Kill function is intended for cases when the program does not respond anymore,
in which case a WM_CLOSE would be of no help anyway.
I've asked freak to at least PostMessage a #WM_CLOSE or #WM_QUIT but I don't think he agrees.
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

works now with or without compiler:
matrix-2

some others not, but i must test all.
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

sigi wrote:works now with or without compiler:
matrix-2

some others not, but i must test all.
Please post what the error says since I cannot reproduce these errors locally. If it fails try compiling more than once to be sure it isn't a hiccup from the PureGDK compiler.

PureGDK is not supporting 4.20 beta right now. Please test only with the latest stable release 4.10.

Please also post whether or not the pre-compiled exe runs or not.
Last edited by Mistrel on Wed Feb 20, 2008 10:16 pm, edited 1 time in total.
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

will do but i am not ready yet :)
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

Ok here my list:

matrix-2.pb (works now with debugger on or off / executable works too)
animation-1.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
basic3d-1.pb (doesn`t work with debug on or off / error: Variable RGBA does not exist in program)
basic3d-3.pb (works now with debugger on or off / executable works too)
bitmap-1.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
camera-1.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
music-1.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
image-2.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
particles-1.pb (doesn`t work with debug on or off / error: Could not understand command at line 26 )
basic3d-2.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
basic3d-4.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
light-1.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
sound-1.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
matrix-1.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
world-1.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
animation-2.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
basic2d-1.pb (doesn`t work with debug on or off / error: Could not understand command at line 26)
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

darryl_bartlett wrote:Hi Mistrel.

Just wanted to confirm that the update has solved the compilation problem. Thank you for that. I must say I think PureGDK is very impressive.

FIXED THIS ISSUE -> The only issue I have now is when I try to close down a compiled exe (by clicking on the red X) that .exe just hangs. I have tried killing the process (GDKTemp.exe) using Task Manager, to no avail.

The problem with NOT with PureGDK, but with ZoneAlarm. It seems that Zone Alarm was stopping PureGDK applications from interacting with cmd.exe. Once I configured zone alarm to allow GDKTemp to access cmd.exe, everything shuts down properly.
Just to clarify: PureGDK calls cmd.exe to clean some temporary files that are created at runtime. These files cannot be removed during the cleanup process because they are still running in memory. PureGDK calls cmd and tells it to wait until the program has closed before cleaning up these files.

This method was proposed by PB a few weeks ago here on the forum http://www.purebasic.fr/english/viewtopic.php?t=30664.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

I've uploaded a new version which should fix the errors you've listed, sigi. I'm not certain about the RGBA one. Please download and reinstall to see if this helps.

Please test all of the examples.
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

Juhuuu, only two left and you have a new buyer :D

matrix-2.pb (works now with debugger on or off / create executable works too.)
animation-1.pb (works now with debugger on or off / create executable works too.)
basic3d-3.pb (works now with debugger on or off / create executable works too.)
bitmap-1.pb (works now with debugger on or off / create executable works too.)
camera-1.pb (works now with debugger on or off / create executable works too.)
image-2.pb (works now with debugger on or off / create executable works too.)
particles-1.pb (works now with debugger on or off / create executable works too.)
basic3d-2.pb (works now with debugger on or off / create executable works too.)
basic3d-4.pb (works now with debugger on or off / create executable works too.)
light-1.pb (works now with debugger on or off / create executable works too.)
sound-1.pb (works now with debugger on or off / create executable works too.)
matrix-1.pb (works now with debugger on or off / create executable works too.)
world-1.pb (works now with debugger on or off / create executable works too.)
animation-2.pb (works now with debugger on or off / create executable works too.)
basic2d-1.pb (works now with debugger on or off / create executable works too.)

basic3d-1.pb (doesn`t work with debug on or off / error: Variable RGBA does not exist in program)
music-1.pb (doesn`t work with debug on or off / error: File does not exist Line 18 File: music-1.pb)
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

I've released a new beta that should fix the RGBA bug you've been experiencing, sigi.

The error you have from music-1.pb sounds like the example isn't compiling to the local directory which would cause it to fail to find the media files.

Make certain that "Create temporary executable in source directory" is checked under Compiler -> Compiler Options -> Compile/Run Tab.

If it still fails try re-downloading the source from http://puregdk.com and see if that fixes it.
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

Great, all examples are working now. :D
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Excellent! I'm glad to hear that's all fixed. Remember that you can also submit bug reports through the form at http://puregdk.com. Your reports are linked to your account so I can follow up by e-mail.

If you program anything cool with PureGDK please post your source here for others to try.
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

Will do, you have done a great job on this :)
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
darryl_bartlett
User
User
Posts: 13
Joined: Tue Apr 29, 2003 8:26 am
Location: South Wales, UK

Unity example

Post by darryl_bartlett »

I have just successfully converted one of the Unity (LUA) DBPro plugin examples to PureGDK.

The only change I have made from the original DBPro project installed as part of the Unity installer is I have moved all the media into the media directory.

I am very very impressed with PureGDK. You can consider me a customer when this is released.

I have several other DBPro extensions so I am going to try converting some of these. I will post more when they are done.

Anyway, here is the code......

Code: Select all

;Conversion of an example of using Unity

Procedure.l f(frame, obj)
  fr = Int(frame * (dbTotalObjectFrames(obj) / 650.0))
  ProcedureReturn fr
EndProcedure


;A few Interface functions
Procedure MakePath(name.s)
  dbLuaSetFunction("MakePath", 1, 0)
  dbLuaPushString(name)
  dbLuaCall()
EndProcedure  


Procedure AddWayPoint(path.s, x.f, y.f, z.f)
  dbLuaSetFunction("AddWaypoint", 4, 0)
  dbLuaPushString(path)
  dbLuaPushFloat(x)
  dbLuaPushFloat(y)
  dbLuaPushFloat(z)
  dbLuaCall()  
EndProcedure


Procedure AddObject(objnum.l, path.s, speed.f)
  dbLuaSetFunction("AddObject", 3, 0)
  dbLuaPushInt(objnum)
  dbLuaPushString(path)
  dbLuaPushFloat(speed)
  dbLuaCall()  
EndProcedure

; show the PureGDK render window
hDBWnd=OpenDBWnd(0,0,800,600,32,#GDK_Window_SystemMenu|#GDK_Window_ScreenCentered)

;set up the environment
dbSetAmbientLight(50)
dbColorBackdrop(0)
dbSyncRate(70)
dbSyncOn()
dbSetTextFont("verdana")

dbSetDir("media")

;load the main lua script
r = dbLoadLua("waypointscript.lua")

;load the example level
dbLoadObject("warehouse.x", 1)
dbLoadObject("warehouse_lmap.x",2)
dbGhostObjectOn(2)

;Make an object to be used as our 'cursor'
dbMakeObjectCube(999, 20)
dbHideObject(999)


;Load the security men
For o = 100 To 101
  dbLoadObject("security.x", o)
  dbScaleObject(o, 300, 300, 300)
  dbXRotateObject(o, 270)
  dbFixObjectPivot(o)
  dbSetObjectSpeed(o, 15000)
  dbLoopObject(o,f(570,o),f(630,o))
Next

;Set default camera position
camx.f = 0
camy.f = 0
camz.f = 0
dbPositionCamera(0, 900, 500)

;Make some paths, interfacing with the lua functions
MakePath("Patrol1")
AddWaypoint("Patrol1",-950,0,-728)
AddWaypoint("Patrol1",-950,0,-72)
AddWaypoint("Patrol1",-294,0,-72)
AddWaypoint("Patrol1",-294,0,-728)
AddObject(100,"Patrol1",4)

MakePath("Patrol2")
AddWaypoint("Patrol2",-950,0,-1432)
AddWaypoint("Patrol2",-238,0,-1432)
AddWaypoint("Patrol2",-174,0,-1968)
AddWaypoint("Patrol2",60,0,-2216)
AddWaypoint("Patrol2",0,0,-2536)
AddWaypoint("Patrol2",-136,0,-2448)
AddWaypoint("Patrol2",100,0,-2176)
AddWaypoint("Patrol2",-120,0,-2000)
AddWaypoint("Patrol2",-64,0,-1368)
AddObject(101,"Patrol2",4)


Repeat  
  If dbMouseY() < 10 
    camz = camz + 8
  EndIf
  
  If dbMouseY() > dbScreenHeight() - 10 
    camez = camez - 8
  EndIf
  

  If dbMouseX()<10
    camx = camx - 8    
  EndIf
  
  If dbMouseX()> dbScreenWidth() -10 
    camx = camx + 8
  EndIf

  If camx > 0 
    camx = 0
  EndIf
  
  If camx < -950 
    camx = -950
  EndIf
  
  If camz > 1100
    camz = 1100
  EndIf
  
  If camz < -2800
    camz = -2800
  EndIf

  dbPositionCamera(dbCurveValue(camx, dbCameraPositionX(), 10), dbCurveValue(camy + 900, dbCameraPositionY(), 10), dbCurveValue(camz -500, dbCameraPositionZ(), 10))  
  dbPositionObject(999, camx, 10, camz)
  dbPointCamera(camx, camy, camz)
  
  
  ;Call lua function to update position of the objects
  dbLuaSetFunction("UpdateObject",1,0)
  dbLuaPushInt(100)
  dbLuaCall()
  
  
  dbLuaSetFunction("UpdateObject",1,0)
  dbLuaPushInt(101)
  dbLuaCall()

  dbText(10,5,"LUA WAYPOINTS DEMO: movement of units controlled entirely by scripts")
  dbText(10,15,"Move mouse to sides of screen to move")
  dbText(10,30,"Frames per second: "+ Str(dbScreenFPS()))
    
  dbSync()
ForEver

; IDE Options = PureBasic 4.10 (Windows - x86)
; CursorPosition = 151
; FirstLine = 108
; Folding = -
; EnableXP
; Executable = Unity_Example.exe
; CompileSourceDirectory
darryl_bartlett
User
User
Posts: 13
Joined: Tue Apr 29, 2003 8:26 am
Location: South Wales, UK

zParticle Example

Post by darryl_bartlett »

This is the conversion of one of the example supplied with zParticles plugin.

Code: Select all

;Conversion of Volcano example supplied with zParticle plugin
;Original DBPro code by Eric PL Smith 


; show the PureGDK render window
hDBWnd=OpenDBWnd(0,0,800,600,32,#GDK_Window_SystemMenu|#GDK_Window_ScreenCentered)

;set up the environment
dbBackdropOn()
dbAutoCamOff()
dbColorBackdrop(0)
dbSyncRate(76)
dbSyncOn()
dbColorBackdrop(dbRGB(0,0,0))

;Initialise zParticles
dbZPInitialize()

dbLoadImage("media\nightsky.jpg",1)
dbMakeObjectBox(2, 500, 500, 500)
dbTextureObject(2, 1)
dbSetObjectCull(2, 0)
dbSetObjectLight(2, 0)

dbZPLoad("volcano.zpi")

dbZPCreateEmitter(1, "ThickSmoke", -10,7,30)
dbZPCreateEmitter(2, "Fire", -10,7,30)
dbZPCreateEmitter(3, "Explosion", -10,7,30)
dbPositionCamera(0, 14, -60)

dbZPSetWind(1,0,0)

Repeat  
  dbZPUpdate()
  dbSync()
ForEver

; IDE Options = PureBasic 4.10 (Windows - x86)
; CursorPosition = 13
; Folding = -
; EnableXP
; Executable = Unity_Example.exe
; CompileSourceDirectory
sigi
User
User
Posts: 79
Joined: Fri Apr 25, 2003 7:16 pm
Location: Germany

Post by sigi »

Some questions:

1- is it possible to use menus and gadgets from PB with this (for making Editors) ?
2- how to make a fullscreen scene ?

Thank`s
Athlon X2 7850 - Geforce 8800 GTS 640mb - 8 GB Ram - Vista Home Premium 64 bit SP2
Post Reply