New finding, new post.
After doing some reading, I believe it's possible to call a function from a C++ .dll file, from within C#, without rewriting the C++ code.
I compiled the DDSTextureLoader.cpp file to a .dll, and it compiled fine. I think this may be a foxhole worth gettin' stuck in, as DDSTextureLoader has a function that checks the alpha channel of a .dds texture.
Thing is, err, I've no clue how to proceed with this. This is what I've gathered so far:
using System.Runtime.InteropServices;
namespace WindowsFormsApplication1
{
public partial class formProgramWindow : Form
{
[DllImport("DDSTextureLoader.dll")]
public static extern void LoadTextureDataFromFile(string dllDDSFilename);
That "LoadTextureDataFromFile(string dllDDSFilename);" line should call the following function from the .dll:
HRESULT LoadTextureDataFromFile(
_In_z_ const wchar_t* fileName,
std::unique_ptr<uint8_t[]>& ddsData,
DDS_HEADER** header,
uint8_t** bitData,
size_t* bitSize)
Now, I think that I only need to provide it a string, as there is only one variable (a collection of chars? called fileName) with the _In_ prefix, which I assume is the argument that the function takes, with the other variables being what the function punts out. Hovering my mouse over "HRESULT" causes Visual Studio to say "Typedef long HRESULT". Maybe this causes the function to return a large integer, with subsections that we can reference.
There is also the following function in the .dll:
DDS_ALPHA_MODE GetAlphaMode( _In_ const DDS_HEADER* header )
with DDS_ALPHA_MODE being "Typedef enum DirectX::DDS_ALPHA_MODE"
What I think I need to do (no idea how), is do something like:
intDDSTextureData = LoadTextureDataFromFile(string dllDDSFilename);
GetAlphaMode( _In_ const intDDSTextureData.DDS_Header)
But, err, GetAlphaMode returns an enum as well, whatever that is. Really, at this point, I'm just regurgitating what my mouse tells me when I hover over things.
Yup, no clue what I'm doing. Send help.