Thanks for the replies. I didn't have the graphics in the right folder, but when I put them there (and double checked the paths) it still does the same thing. When I debugged it, it told me it can't watch this variable:
Code:
IAnimatedMesh* Ship1 = scenemgr->getMesh("...GFX/Crafts/Small/Civilian/Shuttle.3ds");
I'm not really sure what that means, but here's the rest of the code, :P.
Code:
// Abiotica- Zero G
// Irrlicht Headers
#include "irrlicht.h"
#include <iostream>
#include <stdlib.h>
#include <string>
#include <stdio.h>
#include <wchar.h>
// Irrlicht Namespaces
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
using namespace std;
// Declaration of Global Variables
int quit = 0;
// Classes
// Irrlicht Initialization Class
class Init_Irrlicht
{
// Private Class Variables/Functions
protected:
// Protected Class Variables/Functions
bool FullScreen;
int FullScreen_Choice;
int VideoMode_Choice;
E_DRIVER_TYPE VideoMode;
public:
// Public Class Variables/Functions
void FuncInit_Irrlicht(void);
E_DRIVER_TYPE FuncVideo_Mode(void);
bool FuncFullScreen(void);
void GFX_Irrlicht(void);
IrrlichtDevice *device;
IVideoDriver* driver;
ISceneManager* scenemgr;
IGUIEnvironment* guienv;
};
// Graphics Display Class
class GFX_Irrlicht: public Init_Irrlicht
{
public:
// Public Class Variables/Functions
bool FuncLoad_All(void);
void FuncLoad_GUI(void);
void FuncDraw_All(void);
IAnimatedMesh* Ship1;
IAnimatedMeshSceneNode* Ship1Node;
};
// Event Handling Class
class Event_Receiver: public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if(event.EventType == EET_KEY_INPUT_EVENT &&
!event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_ESCAPE:
{
quit = 1;
}
return true;
}
}
// Exit Without Event Trigger
return false;
}
};
// Main Game Loop
int main()
{
// Initialize Irrlicht
Init_Irrlicht IrrInit_Object;
GFX_Irrlicht IrrGFX_Object;
IrrInit_Object.FuncInit_Irrlicht();
// Load Graphics
IrrGFX_Object.FuncLoad_GUI();
IrrGFX_Object.FuncLoad_All();
// Main Loop
while(quit == 0)
{
IrrGFX_Object.FuncDraw_All();
}
// Exit Main Function And Clean Up Irrlicht
IrrInit_Object.device->drop();
return 0;
}
// Function Declarations
// Irrlicht Initialization Function
void Init_Irrlicht::FuncInit_Irrlicht(void)
{
// Initialize Objects
Event_Receiver Input_Object;
// Initialize Irrlicht Engine
// [Default]OpenGL Driver, 800x600 Display...
// 16 Bit Depth, [Default]FullScreen
device = createDevice(FuncVideo_Mode(),
dimension2d<s32>(800, 600), 16, FuncFullScreen(), false, false, &Input_Object);
// Setup Device Pointers
driver = device->getVideoDriver();
scenemgr = device->getSceneManager();
guienv = device->getGUIEnvironment();
// Exit Function
return;
}
// Video Mode Query
E_DRIVER_TYPE Init_Irrlicht::FuncVideo_Mode()
{
// Ask Video Mode
cout << "Choose Video Mode...\n";
cout << "1: Software.\n";
cout << "2: DirectX9.\n";
cout << "3: DirectX8.\n";
cout << "4: OpenGL.\n";
cin >> VideoMode_Choice;
// Change Character String Accordingly
switch(VideoMode_Choice)
{
case 1:
VideoMode = EDT_SOFTWARE;
break;
case 2:
VideoMode = EDT_DIRECTX9;
break;
case 3:
VideoMode = EDT_DIRECTX8;
break;
case 4:
VideoMode = EDT_OPENGL;
break;
default:
VideoMode = EDT_OPENGL;
}
// Exit Function And Return Video Mode Choice String
return VideoMode;
}
// FullScreen Query
bool Init_Irrlicht::FuncFullScreen()
{
// Initial User Setup
// Ask Fullscreen
cout << "Fullscreen?\n";
cout << "1: Yes.\n";
cout << "2: No.\n";
cin >> FullScreen_Choice;
// If Yes Or No, Change Appropriately; Otherwise, Fullscreen
switch(FullScreen_Choice)
{
case 1:
FullScreen = true;
break;
case 2:
FullScreen = false;
break;
default:
FullScreen = true;
}
// Return Appropriate Boolean Value
return FullScreen;
}
// Load All Graphics (For In-Game Purposes)
bool GFX_Irrlicht::FuncLoad_All(void)
{
IAnimatedMesh* Ship1 = scenemgr->getMesh("...GFX/Crafts/Small/Civilian/Shuttle.3ds");
IAnimatedMeshSceneNode* Ship1Node = scenemgr->addAnimatedMeshSceneNode(Ship1);
Ship1Node->setMaterialFlag(EMF_LIGHTING, false);
scenemgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
return true;
}
// Load All Graphics (For GUI Purposes)
void GFX_Irrlicht::FuncLoad_GUI(void)
{
return;
}
// Draw All Graphics (GUI Environment And Scene Manager)
void GFX_Irrlicht::FuncDraw_All(void)
{
// Begin Scene Rendering
driver->beginScene(true, true, SColor(0,200,200,200));
// Draw Scene Manager and GUI Environment
scenemgr->drawAll();
guienv->drawAll();
// End Scene Rendering
driver->endScene();
// Exit Function
return;
}