der will trotzdem net jetzt schreib ich einfach ma jeden teil des codes
Main.cpp
Code:
#include "NejiGlobal.h"
int Main()
{
SD.Device = createDevice(EDT_OPENGL,dimension2d<s32>(800,600),32,false,false,false,0);
SD.Driver = SD.Device -> getVideoDriver();
SD.Gui = SD.Device -> getGUIEnvironment();
SD.Smgr = SD.Device -> getSceneManager();
return 0;
}
bool GameEvent(SEvent event)
{
if (event.EventType == EET_KEY_INPUT_EVENT)
{
switch(event.KeyInput.Key)
{
case KEY_ESCAPE:
{
return true;
}
}
}
return false;
}
#include "NejiGlobal.h"
int Main()
{
SD.Device = createDevice(EDT_OPENGL,dimension2d<s32>(800,600),32,false,false,false,0);
SD.Driver = SD.Device -> getVideoDriver();
SD.Gui = SD.Device -> getGUIEnvironment();
SD.Smgr = SD.Device -> getSceneManager();
return 0;
}
bool GameEvent(SEvent event)
{
if (event.EventType == EET_KEY_INPUT_EVENT)
{
switch(event.KeyInput.Key)
{
case KEY_ESCAPE:
{
return true;
}
}
}
return false;
}
NejiEvent.cpp + NejiEvent.h
Code:
#include "NejiGlobal.h"
bool GameEventReceiver::OnEvent(SEvent event)
{
return GameEvent(event);
}
//////////////////////////////////////////////////////////
#ifndef NEJIEVENT_H
#define NEJIEVENT_H
#include "NejiGlobal.h"
class GameEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent( SEvent event);
};
#endif
NejiGame.h
Code:
#ifndef NEJISPIEL_H
#define NEJISPIEL_H
#include "NejiGlobal.h"
struct GameStruct
{
IrrlichtDevice* Device;
ISceneManager* Smgr;
IGUIEnvironment* Gui;
IVideoDriver* Driver;
} SD;
#endif
NejiGlobal.h
Code:
#ifndef NEJIGLOBAL_H
#define NEJIGLOBAL_H
#define _CRT_SECURE_NO_DEPRECATE // for MS VS2005
#include <irrlicht.h>
#include <windows.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
#pragma once
extern bool GameEvent(SEvent event);
//#include "NejiMainMenu.h"
//#include "NejiNetzwerk.h"
//#include "NejiMap.h"
#include "NejiEvent.h"
//#include "NejiDevice.h"
#include "NejiGame.h"
#endif
bei anregungen und verbesserungen pls reinschreiben ach und der fehler fehlt ja noch ...
Code:
--------------------Konfiguration: SpacePirates - Win32 Debug--------------------
Kompilierung läuft...
Main.cpp
Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.
NejiEvent.cpp
Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.
Linker-Vorgang läuft...
NejiEvent.obj : error LNK2005: "struct GameStruct SD" (?SD@@3UGameStruct@@A) bereits in Main.obj definiert
LIBCD.lib(crt0.obj) : error LNK2001: Nichtaufgeloestes externes Symbol _main
Debug/SpacePirates.exe : fatal error LNK1120: 1 unaufgeloeste externe Verweise
Fehler beim Ausführen von link.exe.
Browse-Informationsdatei wird erstellt...
SpacePirates.exe - 3 Fehler, 0 Warnung(en)