Welcome
Ladies and Gents:

These forums are now closed and registration disabled.

Please join us at our new forum on Proboards. Our hope is that these new forums are more stable, provide more and better features, and allow continuation of the project forums in a safer, more secure, long term environment.

me3explorer.proboards.com

--The ME3Explorer Team

C++ & D3D Stuff

Non-toolset utilities for the ME Trilogy developed by community coders. Note: Restricted to coder- or modder-oriented tools. User-oriented tools belong where they can be adequately supported (e.g., Nexusmods).

C++ & D3D Stuff

Postby saltisgood » 26 Jul 2013, 11:17

I wanted to learn C++ and Direct3D so I had a little fun porting the static mesh display from ME3Explorer to C++. This is my first C++ program and it's more of a learning exercise than a proper program but I still thought it might be interesting enough to share. Basically you just give it the raw data from a static mesh export and it'll read it in and generate the 3D preview just like in ME3Explorer. As I said, nothing Earth shatteringly cool but at least it shows how desktop programs work at their most basic level and some stuff in Dx9.

It's thoroughly commented, basically every step is explained in the source code, so if you're thinking learning C++ I'd recommend checking it out and stepping through the source code. The only assumed knowledge is a basic understanding of the C language and a rough idea of memory management. So just google stack, heap and pointers and you should be right. Other than that I tried to use a pretty diverse range of different concepts, so you've got classes, structs, custom operators, pointers, references, typedefs, delegates, etc. and should be free of any memory leaks.

I just pretty much implemented it as I felt was right at the time, so there might be some C++ pros out there who could tell me if there's any design choices that aren't normally in line with C++ style (for instance, coming from C I had been allocating with malloc, when apparently it's more correct to use new).

Download link

Instructions are in the readme file in the archive.

Important thanks:
zophusX - A Beginner's Source to Direct3D 9
^Really helped me out to begin with. The Window and D3DManager classes are his doing. This guy has a great explanation style, everything is explained fully, which is great for starting out.

and of course to WarrantyVoider. The static mesh stuff in this program is pretty much just a direct port of the StaticMesh class from ME3Explorer. I dunno how you figured a lot of that stuff out dude, it's pretty crazy. :D

The program in action
MeshDisplay.gif

saltisgood has been thanked by:
User avatar
saltisgood
Emeritus
 
Posts: 279
Joined: 03 Sep 2012, 05:20
Location: Sydney
Has thanked: 39 time
Have thanks: 155 time

Re: C++ & D3D Stuff

Postby WarrantyVoider » 26 Jul 2013, 11:21

Thats cool work man! This is actually good that you posted it here, I have an entire tutorial on how to write an 3D editor with managed DirectX (9) in C# from scratch, including psk format and such. Once I got my mark from uni for it, Ill release it here :P

greetz WV
always backup your files!
mess with the best or die like the rest!
"I tried everything!" - "mkay, please list that..." ; please dont pm me for help, we have a help section
User avatar
WarrantyVoider
Emeritus
 
Posts: 2270
Joined: 22 Aug 2012, 11:33
Has thanked: 480 time
Have thanks: 626 time

Re: C++ & D3D Stuff

Postby saltisgood » 26 Jul 2013, 11:27

Sweet, I look forward to seeing it
User avatar
saltisgood
Emeritus
 
Posts: 279
Joined: 03 Sep 2012, 05:20
Location: Sydney
Has thanked: 39 time
Have thanks: 155 time

Re: C++ & D3D Stuff

Postby Fog.Gene » 27 Jul 2013, 00:07

Much appreciated, especially with the comments.
Regere: Let the world know of its sovereign. I shall be the rule by which all things are measured.
Polyhistor: Then I am to be the slave, for all things shall be my master.
Fog.Gene
Emeritus
 
Posts: 259
Joined: 20 Feb 2013, 05:09
Has thanked: 119 time
Have thanks: 65 time


Return to Third-Party Utilities

Who is online

Users browsing this forum: No registered users and 0 guests

suspicion-preferred