the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly

Everything related to 3D programming
tan9p
New User
New User
Posts: 6
Joined: Thu Mar 20, 2025 1:46 pm

the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly

Post 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?
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly

Post by Caronte3D »

Maybe you forgot the dll?
tan9p
New User
New User
Posts: 6
Joined: Thu Mar 20, 2025 1:46 pm

Re: the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly

Post 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.
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly

Post 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.
Last edited by miso on Thu Mar 20, 2025 3:59 pm, edited 1 time in total.
tan9p
New User
New User
Posts: 6
Joined: Thu Mar 20, 2025 1:46 pm

Re: the 3D example compiles/runs well,but the exe created executable displayed black and exit shortly

Post 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.
Post Reply