I'm still stuck with this, I can't work out what I'm missing. I'm going to post the beginning of each of the files I'm working with in the input system. I have access to the OIS namespace in every file except the one I need it in (object.h). I really hope someone can see where I'm going wrong. I've been trying to follow the layout of the other systems in the framework (eg. copying how things were set up in the graphics system).
Object.ccp
Code:
#include "OIS.h"
//
// core includes
//
#include "..\BaseTypes\BaseTypes.h"
#include "..\Interfaces\Interface.h"
//
// Input system includes
//
#include "Scene.h"
#include "Object.h"
InputObject::InputObject(ISystemScene* pSystemScene) : ISystemObject( pSystemScene, NULL )
{
}
InputObject::InputObject(ISystemScene* pSystemScene, pcstr pszType, pcstr pszName) : ISystemObject( pSystemScene, NULL )
{
}
etc...
Object.h
Code:
#pragma once
class InputSystem;
class InputScene;
class InputTask;
///////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Implementation of the ISystemObject interface.
/// See Interfaces\System.h for a definition of the class and its functions.
/// </summary>
///////////////////////////////////////////////////////////////////////////////
class InputObject : public ISystemObject, public OIS::MouseListener, public OIS::KeyListener, public OIS::JoyStickListener
{
friend class InputSystem;
friend class InputScene;
public:
virtual void Update( f32 DeltaTime );
etc...
Scene.cpp
Code:
#include "OIS.h"
//
// core includes
//
#include "..\BaseTypes\BaseTypes.h"
#include "..\Interfaces\Interface.h"
//
// Input system includes
//
#include "System.h"
#include "Scene.h"
#include "Task.h"
#include "Object.h"
#include <tchar.h>
#include "D3DX9Math.h"
InputScene::InputScene(
ISystem* pSystem
)
: ISystemScene( pSystem )
, m_pInputTask( NULL )
{
}
etc...
Scene.h
Code:
#pragma once
#define DIRECTINPUT_VERSION 0x0800
#include "dinput.h"
#include "System.h"
class InputSystem;
class InputTask;
class InputObject;
///////////////////////////////////////////////////////////////////////////////
/// <summary>
/// <c>InputScene</c> Implementation of the ISystemScene interface.
/// The input scene contains all the input objects
/// </summary>
///////////////////////////////////////////////////////////////////////////////
class InputScene : public ISystemScene
{
friend class InputSystem;
friend class InputTask;
public:
protected:
InputScene( ISystem* pSystem );
~InputScene( void );
etc...
System.ccp
Code:
#include "OIS.h"
//
// core includes
//
#include "..\BaseTypes\BaseTypes.h"
#include "..\Interfaces\Interface.h"
//
// Input system includes
//
#include "System.h"
#include "Scene.h"
InputSystem::InputSystem(
void
)
: ISystem()
{
}
etc...
System.h
Code:
#pragma once
///////////////////////////////////////////////////////////////////////////////
/// <summary>
/// <c>InputSystem</c> Implementation of the ISystem interface for generic
/// Input functionality.
/// </summary>
///////////////////////////////////////////////////////////////////////////////
class InputScene;
class InputTask;
class InputSystem : public ISystem
{
friend InputScene;
protected:
etc...
SystemInput.ccp
Code:
#include <windows.h>
//
// extern includes
//
#pragma warning( push, 0 )
// Temporarily switching warning level to 0 to ignore warnings in extern/Ogre
#include "OIS.h"
#pragma warning( pop )
//
// core includes
//
#include "..\BaseTypes\BaseTypes.h"
#include "..\Interfaces\Interface.h"
//
// system includes
//
#include "System.h"
ManagerInterfaces g_Managers;
BOOL APIENTRY
DllMain(
HMODULE hModule,
DWORD Reason,
LPVOID pReserved
)
{
UNREFERENCED_PARAM( hModule );
UNREFERENCED_PARAM( pReserved );
switch ( Reason )
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
extern "C" void __stdcall
InitializeInput(
ManagerInterfaces* pManagers
)
{
g_Managers = *pManagers;
}
extern "C" ISystem* __stdcall
CreateInputSystem(
Debug::Debugger* p_Debugger
)
{
Debug::Init( p_Debugger );
return new InputSystem();
}
extern "C" void __stdcall
DestroyInputSystem(
ISystem* pSystem
)
{
delete reinterpret_cast<InputSystem*>( pSystem );
}
I'm sorry to post so much here, I'm hoping it will just take a quick glance at the includes for someone who knows what they are doing to see the problem.
Note that currently
Code:
class InputObject : public ISystemObject, public OIS::MouseListener, public OIS::KeyListener, public OIS::JoyStickListener
is giving me a series of errors because OIS is an undefined symbol.
A huge thank you to anyone who can help me and thanks also to everyone that has replied so far