Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / problem loading .x files

Author
Message
Abraxas77
13
Years of Service
User Offline
Joined: 26th Aug 2010
Location:
Posted: 27th Aug 2010 01:12
dbLoadObject fails to load a .x file. Originally, I was attempting to load the scout model included with DarkGDK samples ([DarkGDK]/Samples/bin/Media/media/scout) which I had copied into my project's binary environment path ([myproject]/Debug/assets/models/scout). The compiled sample that uses this model file appears to load it without error. However, in my project, the model does not load. Futhermore, a call to dbObjectExist with that model's id causes a buffer overrun exception (crash).

Here's my code:

* The buffer overrun exception does not occur until after exiting the main loop (it occurs in the delete objects section).

* The text output to the screen states: "Planet: 1 | Ship: 0 | Sky: 1"

* The planet and sky models load without error. They were taken from [DarkGDK]/Media/Modes/Planet and [DarkGDK]/Samples/bin/media/sky respectively.

* The two commented lines below // Setup Ship:
were attempts at loading other models. The "ship\\Ship.X" model (from [DarkGDK]/Media/Models/Ship) loads without error.
The "cube.x" file is a model I created from the default cube object that loads with every new Blender project. I simply added a UV Texture and exported it as DirectX file (.x). This model does not load and cause the same buffer overrun exception as mentioned above. I also tried using the DirectX utility: MeshConvert to convert it to binary. This did not work either. Here is the contents of cube.x in text form:


* All models mentioned above load in the DirectXViewer app.


Given that the sample included with DarkGDK loads the scout model, I suspect the issue is with the libraries linked to my project. I am using August 2007 DirectX 9.0c SDK as referenced on the DarkGDK download page (installed with dxsdk_aug2007.exe) and this is the only DirectX SDK installed on my system (or referenced in Visual Studio C++ library directories). Could this be an issue with the DarkGDK libraries? ... or does anyone have any other ideas?


Thanks in advance,
Andrew
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 27th Aug 2010 03:26
Change "([myproject]/Debug/assets/models/scout)" to "([myproject]/assets/models/scout)"

Remove the /Debug portion of the path. When executing/debugging etc. in the IDE, all paths are relative to the project's directory, not it's binary directory.

Hope this helps,

JTK
Abraxas77
13
Years of Service
User Offline
Joined: 26th Aug 2010
Location:
Posted: 27th Aug 2010 08:40
Quote: "Change "([myproject]/Debug/assets/models/scout)" to "([myproject]/assets/models/scout)"
"

Thanks for the reply ... that did the trick. I feel so stupid now. I spent hours trying to get that work! Turns out the other models loaded because I indeed had them [myproject]/assets/models/[...].

Thanks again,
~Andrew~


PS: I'm still slightly concerned about the exception I was getting when the model failed to load. It seemed to occur when I called dbObjectExist with the object id of the model that failed to load. But only after returning from the main loop. I can't see it being much of an issue for most users, but could it be bug in the GDK?

Login to post a reply

Server time is: 2024-07-02 09:30:42
Your offset time is: 2024-07-02 09:30:42