Page 1 of 1
the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly
Posted: Thu Mar 20, 2025 2:01 pm
by tan9p
I tested the water.pb file located in the ./Example/3D/ directory. In PureBasic, it functions properly when I compile or run it. However, when I create an executable .exe file, the .exe runs without any error messages, but all it shows is a black window.
I suspect that the file location is the root cause of this issue. So, I modified the water.pb file as follows:
Code: Select all
Add3DArchive("C:/Users/xxx/Desktop/Examples/3D/Data/Textures", #PB_3DArchive_FileSystem)
After that, it can be compiled and run smoothly, and the display is correct. Nevertheless, when I run the generated .exe file, it only shows a black window and then exits shortly.
Could anyone help me?
Re: the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly
Posted: Thu Mar 20, 2025 2:25 pm
by Caronte3D
Maybe you forgot the dll?
Re: the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly
Posted: Thu Mar 20, 2025 2:55 pm
by tan9p
thanks for the reply.
how to link the dll?
I tested the example sources Advanced Waponez II.
If the exe is in the folder,it works well.but if it is moved to other location. it also gave a black window, but did not auto exit. So I guess it is not a dll issue.
Re: the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly
Posted: Thu Mar 20, 2025 3:37 pm
by miso
Hello.
Ship your exe together with engine3d.dll. Also better to put your resources/media to your programs directory, and change those paths to fit.
They are good for an example, but those example paths might not present on other computers.
Personally, I don't like anything, that writes or read things above/outside it's program directory.
Re: the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly
Posted: Thu Mar 20, 2025 3:57 pm
by tan9p
to miso:
thanks! actually the engine3d.dll is the cause of my problem. I went in the wrong direction because Waponez II is a 2D example.