PureGDK - 3D Programming for PureBasic

Developed or developing a new product in PureBasic? Tell the world about it.
ale870
Enthusiast
Enthusiast
Posts: 180
Joined: Wed Jul 09, 2008 7:02 am
Contact:

Post by ale870 »

Ok, solved (I forgot to install Dark basic 7.1 :-)
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

The timeout issue is related to the new thread safety code. The application doesn't end until it can verifies that all of the mutex lock has been released and the function queue has reached zero.

This error identifies that the wait/release functions aren't being handled properly somewhere. It may be a special-case that I'll have to deal with specifically for the custom error handler, but I won't know until I look into it.
Olby wrote:is it okay that the command prompt is visible along with the GUI of the GDK compiler like this
The command prompt should not be visible when compiling from the IDE. I believe this is an oversight in the installer, which I will fix. Go to Tools -> Configure Tools... and set each entry for PureGDK as "Run Hidden". This won't affect the GUI that pops up.
ale870 wrote:I tried to install it but I get an installation error:

Couldn't copy the file.
c:\program files\The game creators\Dark basic online\compiler\effects\quad.fx

I have no "quad.fx" file inside.
As a test please uninstall DBP and delete the entire directory. Reinstall DBP, update to 7.1, and tell me if that file still does not exist. I'm pretty sure it's a core file and not something from a plugin. I have all of the plugins installed for debugging right now so it might have come from one of those.

I also don't check the contents of the effects folder when porting DBP data to PureGDK. If a plugin does copy one of these files then I will need to handle this.

If this is an oversight (please confirm by reinstalling DBP!), just create any file quad.fx to quiet the installer.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

ale870 wrote:Ok, solved (I forgot to install Dark basic 7.1 :-)
Thank you for confirming this. :)
ale870
Enthusiast
Enthusiast
Posts: 180
Joined: Wed Jul 09, 2008 7:02 am
Contact:

Post by ale870 »

Now I get, using this procedure:

Code: Select all

Procedure ErrorHandler()
   description.s=GetErrorDescription()
   module.s=GetErrorModuleName()
   string.s+dbGetErrorDescription(@description.s)+#CRLF$
   string.s+"Line: "+Str(GetErrorLineNR())+#CRLF$
   string.s+"AFile: "+dbGetErrorFilename(@module.s)+#CRLF$
   MessageRequester("Custom Error",string.s)
   End
EndProcedure
Processing compiler parameters ..
Found APP_DATA_PATH C:\ProgramData\PureGDK\
Initializing basic parser ..
DBPProc found at line 91
Debugger off
Initializing full parser ..
Replaced End keyword at line 25
Found command dbsetambientlight at line 39
Found command dbphystart at line 98
Found command dbbackdropon at line 105
Found command dbloadimage at line 159
Found command dbmakeobjectterrain at line 181
Found command dbpositionobject at line 191
Found command dbhidemouse at line 256
Found command dbtext at line 327
Found command dbsubtractvector3 at line 369
Compiling GDKMain..
Resolving error lines...
Error: C:\temp\terrain puregdk\media1\prova_ale.pb
Error: Line 23 - dbGetErrorFilename() is not a function, array, macro or linked list.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

ale870, see this line from the changelog:
The PureGDK functions for handling errors have changed. Please consult the 'How to... -> Reference Manual -> PureGDK' section of the documentation to see a list of revised commands.
None of the examples from the website will compile without modification. It will be faster if you use the examples provided for PureGDK 7.1 and compare what has changed if you want to debug the problem.

I've already gone through and updated all of the examples for you. :)
Olby
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Jan 12, 2009 10:33 am
Contact:

Post by Olby »

hmm strange but almost all of the examples when closed display standard 'application failed' dialog of Windows. Looks like there are problems when releasing data or cleaning up after thread usage ?
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Olby wrote:Looks like there are problems when releasing data or cleaning up after thread usage ?
It shouldn't. PureGDK 1.1 cleans up differently than the previous versions. It works fine on XP but I haven't tested on Vista, which I think is what you're using.

The crash on my Vista machine points to nvd3dum.dll, which is an nvidia file. Can you confirm this? This does not appear to be a PureGDK issue perse:
http://forums.nvidia.com/lofiversion/in ... 43258.html

Try this patch and see if it fixes the problem for you. Copy it to your "\Users\UserName\AppData\Roaming\PureGDK\plugins-user" folder. If it's not there check your "\Program Files (x86)\PureBasic\PureGDK\PureGDK.ini" for your application data path.

http://puregdk.com/files/upload/PureGDK ... vd3dum.zip

If for some reason this doesn't work (I think it should!) try updating your video card drivers.

Please let me know what fixes it for you!
Last edited by Mistrel on Sat Jan 24, 2009 1:01 pm, edited 1 time in total.
Olby
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Jan 12, 2009 10:33 am
Contact:

Post by Olby »

No it did not fix the problem I copied both to the Users path of PGDK and also to where the rest of the PGDK files are located, recompiled and got the same error. Speaking about the video drivers I updated them a week ago and now I have December 2008 drivers which are the last that nvidia officially supports for laptops, I will try to install a different release and see if it helps.

And yes the problem indeed occurs with the nvidia file you mentioned.
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Are you sure that it you copied it to the proper location?

The correct location for me would be:
"C:\Documents and Settings\UserName\Application Data\PureGDK\plugins-user"

I can confirm that it does correct the problem here for me on my nvidia notebook.

I may have sent you the wrong file -- let me double-check.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Sorry, I wasn't clear with my initial instructions. I gave the incorrect folder. The correct location is:

"\Users\UserName\AppData\Roaming\PureGDK\plugins-user"

I left out the plugins-user folder at the end. This is important! :)

Also, please remove PureGDK.dll from wherever else you put it. Although it's unlikely, it might introduce an unexpected problem somewhere else.
Olby
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Jan 12, 2009 10:33 am
Contact:

Post by Olby »

Yes, thank you. I can confirm that it works now as expected.
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
Captn. Jinguji
User
User
Posts: 94
Joined: Sun Oct 24, 2004 9:25 am

Post by Captn. Jinguji »

Hi Mistrel
Great work.

When I compile matrix-2.pb without debugger, at run time, I am greeted with

Code: Select all

"PureGDK Error"
Function Wait mutex released without lock. Line 72
Address 2088839915
File: P:\Devl\DBPro\matrix\matrix-2.pb
line 72 reads

Code: Select all

dbGetMatrixPositionVector(@Vector3.v3, MatrixNumber)
With debugger enabled, all seems to be running smoothly.
Forgot to mention: The error occurs when i do a left click in the window.


Environment :
Win Xp 32/sp3, up to date patchlevel,
nvidia 8600M GS 512 MB Graphics Ram (not shared), nvida driver level: 6.14.11.7694,
db7.1,
pb4.3
core2duo 2 GB phys RAM

All other demos compile & run fine

kind regards

*edit: changed 8600GS to 8600M GS
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

Captn. Jinguji wrote:When I compile matrix-2.pb without debugger, at run time, I am greeted with

Code: Select all

"PureGDK Error"
Function Wait mutex released without lock. Line 72
Address 2088839915
File: P:\Devl\DBPro\matrix\matrix-2.pb
Fixed. :)

This bug is related to the new thread safety code. Most of the code is all the same. Special-case functions like the 3D Math library, anything that accepts/returns a vector/matrix4, and other "custom" PureGDK functions may exhibit this type of error because this code has to be tweaked by hand.

You may run into these every once in a while. But they are the easiest to fix.
Captn. Jinguji
User
User
Posts: 94
Joined: Sun Oct 24, 2004 9:25 am

Post by Captn. Jinguji »

Mistrel wrote:
Captn. Jinguji wrote:When I compile matrix-2.pb without debugger, at run time, I am greeted with

Code: Select all

"PureGDK Error"...
Fixed. :)
Thanks. :)
Mistrel wrote: This bug is related to the new thread safety code.
You may run into these every once in a while. But they are the easiest to fix.
That's ok with me if you keep fixing 'em as fast as you fixed this one ;)
Keep up the good work.
Olby
Enthusiast
Enthusiast
Posts: 461
Joined: Mon Jan 12, 2009 10:33 am
Contact:

Post by Olby »

I cannot get PGDK to work perfectly in fullscreen windowed mode just like it should work in DBPro. I tried the example posted by Mistrel before but that didn't work. Then I tried to stretch window created by PB to my screen resolution, but that made the program to run very very slowly. This is very strange because I know that in DBPro I always use fs windowed mode and it was even faster than the old fullscreen exclusive mode. I don't want to change end user's desktop resolution because when the app will crash it will certainly leave the changed resolution and mess up the icons and such. You should really include a template for creating the same fullscreen windowed mode DBPro uses without affecting users desktop resolution. It utilizes a stretching to stretch small resolutions to fullscreen, but when used with users real desktop resolution there is no quality loss.
Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
Post Reply