Thread: Arhg - OGL MilkShape Model Loading

  1. #1
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968

    Arhg - OGL MilkShape Model Loading

    I'll attach all the relevant code I can in files, for some reason I get my error only when calling pModel->DrawMS3DModels();

    Code:
    --------------------Configuration: NeHeGL - Win32 Debug--------------------
    Compiling...
    Example.cpp
    C:\Documents and Settings\Jonathan\Desktop\RenderEngine\Example.cpp(77) : error C2065: 'pModel' : undeclared identifier
    C:\Documents and Settings\Jonathan\Desktop\RenderEngine\Example.cpp(77) : error C2227: left of '->DrawMS3DModels' must point to class/struct/union
    Error executing cl.exe.
    Creating browse info file...
    
    NeHeGL.exe - 2 error(s), 0 warning(s)
    pModel is declared right in the winmain section of NeHeGL.cpp.... nehegl.h is included where I'm trying to call pModel....

    why oh why!
    Last edited by Shamino; 12-03-2005 at 06:58 PM.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  2. #2

    Join Date
    May 2005
    Posts
    1,042
    I don't see it declared anywhere in Winmain. Regardless, that wouldn't work, seeing as how the rendering function DrawMS3DModels is called in a completely different function that also happens to be in a different file (the Draw() function that evidently comes along with the NeHeGL code). So, you have a few options.

    If you want to do the loading in WinMain, I'd suggest you make pModel a global variable, load it in WinMain, and in the file that has the Draw() function at the top of it put

    "extern MS3DModel *pModel"

    extern tells the compiler that pModel is a variable of type MS3DModel* that exists, but is to be found in another file.

    Or, you can just add the ms3d model to the renderer, and call RenderAllMS3DModels in the Draw() function (although you'll likely have to setup the GLRenderer in a similar manner as I described above for the ms3dmodel).
    I'm not immature, I'm refined in the opposite direction.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cargo loading system
    By kyle rull in forum C Programming
    Replies: 1
    Last Post: 04-20-2009, 12:16 PM
  2. Replies: 14
    Last Post: 06-28-2006, 01:58 AM
  3. Getting Errors when calling pModel (Model Loading again)
    By Shamino in forum Game Programming
    Replies: 8
    Last Post: 12-06-2005, 08:20 PM
  4. multiple file loading. so fruturated! help!
    By psychopath in forum Game Programming
    Replies: 5
    Last Post: 05-09-2005, 05:13 PM
  5. Help with file reading/dynamic memory allocation
    By Quasar in forum C++ Programming
    Replies: 4
    Last Post: 05-17-2004, 03:36 PM