locked
Reading a model file.

    Question

  • I'm trying to make a model loader for a Metro App game, using the code I've used before for other projects, it simply won't work. No matter what I try the file won't load. How are you meant to do this? This is the code I'm trying to use:

     

    FILE *fp = fopen("swordsman.obj","r");

     

    Thanks for any help.

    EDIT: Ok so I think I need to do something like this:

     

    Wrappers::FileHandle file(
            CreateFile2(
                L"swordsman.obj",
                GENERIC_READ,
                0,
                OPEN_EXISTING,
                nullptr
                )
            );
        if (file.Get()==INVALID_HANDLE_VALUE)
        {
            throw ref new Platform::FailureException();
        }

     

    But that doesn't work either :(. Anyone have an idea?

    EDIT2: Ah, I figured out I had to put the file in a different location, so it's loading the file now.

    • Edited by Calneon Thursday, November 24, 2011 8:18 PM
    Thursday, November 24, 2011 5:42 PM

Answers