Page 21 of 24
Posted: Tue May 12, 2009 6:35 pm
by AndyMK
Hi Mistrel, just found a serious bug with the latest version. Cant use the WindowEvent() purebasic command in more than one app at a time if one of the apps uses puregdk.
Run these two separately then together then rem out the Puregdk command in the second one and repeat.
Code: Select all
OpenWindow(0, 0, 0, 250, 100, "Purebasic", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
Repeat
Delay(1)
Event = WindowEvent()
Until Event = #PB_Event_CloseWindow
Code: Select all
OpenWindow(0, 0, 0, 250, 100, "PureGDK", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
hDBWnd = OpenDBWnd(WindowID(0), 0, 0, 250, 100)
Repeat
Delay(1)
Event = WindowEvent()
Until Event = #PB_Event_CloseWindow
Posted: Wed May 13, 2009 8:45 am
by Mistrel
There seems to be a conflict between PureGDK's method of hooking the executable and PureBasic's debugger:
Code: Select all
An Error has been detected in the IDE!
Error: Invalid memory access
To clarify the bug: this is not an issue with the final executable. You can run multiple instances directly or from the IDE so long as only one is being debugged at a time.
If you need multiple executables debugged at the same time use the stand-alone GUI or console debugger (from the IDE preferences). This seems to work.
I don't know what the debugger does when multiple executables are run concurrently but I will look into this and see what I can do.
Posted: Wed May 13, 2009 1:14 pm
by AndyMK
*UPDATE*
Works with the normal debugger on both apps only if you run the PureGDK app first. This also applies when running both apps without the debugger(from IDE). Please Please fix this as it makes finding bugs very difficult at the moment. Thanks
Posted: Wed May 13, 2009 6:32 pm
by Mistrel
AndyMK wrote:Please Please fix this as it makes finding bugs very difficult at the moment. Thanks
It does work when using the external debugger so you should be able to continue working on your project for the time being.
Posted: Wed May 13, 2009 8:33 pm
by Olby
Hey Mistrel, could you please drop an eye on this third party Octree culling plugin I have converted over to GDK. It doesn't seem to work, but I can't understand why... There is a DBA example and my coverted PB example supplied.
http://olby.times.lv/Downloads/PureGDK/dbOctree.zip
Thanks,
Olby
Posted: Wed May 13, 2009 10:33 pm
by AndyMK
Mistrel, if you mean the "Standalone GUI Degugger" or the console debugger then exactly the same occurs with the programs above unless you run the app containing the PureGDK commands first.
Posted: Thu May 14, 2009 1:16 am
by Mistrel
AndyMK wrote:Mistrel, if you mean the "Standalone GUI Degugger" or the console debugger then exactly the same occurs with the programs above unless you run the app containing the PureGDK commands first.
Are you sure? I've enabled the standalone gui debugger and can run the PureBasic executable and then the PureGDK executable with the debugger on without anything locking up or throwing errors. I tried the example source you posted above.
Olby wrote:Hey Mistrel, could you please drop an eye on this third party Octree culling plugin I have converted over to GDK. It doesn't seem to work, but I can't understand why... There is a DBA example and my coverted PB example supplied.
Can you be specific about what the expected output is and what's actually happening? It seems to work just fine here.
Posted: Thu May 14, 2009 1:29 am
by AndyMK
Sorry, i didnt realize i had to compile to a file and then execute the file from windows for it to work.. I was running each one from the ide using the compile/run button
Posted: Thu May 14, 2009 1:33 am
by Mistrel
AndyMK wrote:Sorry, i didnt realize i had to compile to a file and then execute the file from windows for it to work.. I was running each one from the ide using the compile/run button
I'm running it from the IDE (Compile/Run) using the standalone or console debugger. I don't see any errors.
Posted: Thu May 14, 2009 8:33 am
by Olby
Mistrel wrote:Can you be specific about what the expected output is and what's actually happening? It seems to work just fine here.
Well, yes, there should be some boxes that represent the rooms. If they are solid then the plugin is not working correctly as one of the commands are not returning the ID of box area (I am at work so I can't tell the command name but you will see).
If it works for you then you can check the culling by turning the camera so that it does not see the green door into the first box and you will notice that the room inside the parent room will be culled as it is not visible actually (that's why the wireframe is turned on).
If these both conditions are true for you and it works ok then something is wrong with my computer. But as far as I can tell the problem is that the command which creates a box area for culling is not returning any value, but in DB it does.
Here is the original source in case you still don't understand what it does:
http://forum.thegamecreators.com/?m=for ... 122321&b=5
Thanks,
Olby
Posted: Thu May 14, 2009 2:01 pm
by AndyMK
does not matter which app is using the external debugger, if you run the non puregdk app first then the the puregdk app will not work and the other app will freeze. i have tried every combination of debugger between both apps. im on vista by the way
Posted: Thu May 14, 2009 7:01 pm
by Mistrel
AndyMK wrote:does not matter which app is using the external debugger, if you run the non puregdk app first then the the puregdk app will not work and the other app will freeze. i have tried every combination of debugger between both apps. im on vista by the way
I'm using XP. I'll look into this and see if there's something I can do.
Olby, I see wireframe and it appears as if things are being culled:
http://puregdk.com/files/upload/octree.zip
Posted: Fri May 15, 2009 7:38 am
by Olby
Ok, then I am maybe incorrectly compiled the library ? Did you simply used the gdt file I created and compiled it with tailbite with no alterations ? This is weird... I'll get back home and report about this.

Posted: Fri May 15, 2009 7:48 am
by Mistrel
I made no changes. I opened the source file you provided and compiled from the IDE which puts the library in the right location. You also have to put the .gde and .dll in the correct locations too.
The .gde goes in your "..\PureBasic\PureGDK\commands" folder and the .dll goes into the plugin-user folder of wherever you specified the PureGDK application data folder to be. It's typically located in: "..\Documents and Settings\Username\Application Data\PureGDK\plugins-user".
You'll also have to restart the PureBasic compiler after making any changes to the Tailbite library. This can be done by restarting the IDE or resetting the compiler manually from the Compiler menu.
Please let me know if this was an oversight or if the documentation isn't clear. Creating a framework plugin is straightforward if you know how but there are several files and several key steps that must be followed. I've had many people inquire but I don't think anyone other than myself has actually used the framework.
Posted: Fri May 15, 2009 7:51 am
by Olby
Yes, I knew about the user plugin folder. All my plugins are located there, but frankly i hear about the gde files for the first time ? Does TailBite compiles them ?