Skip to content

Commit

Permalink
Add a all header file
Browse files Browse the repository at this point in the history
  • Loading branch information
Joy Zhang committed Apr 27, 2012
1 parent 7cc7233 commit 5f3663d
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 6 deletions.
16 changes: 16 additions & 0 deletions AbstractScene.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef ABSTRACT_SCENE_H
#define ABSTRACT_SCENE_H
#include "Vector3D.h"


namespace QtGameEngine
{
using namespace Math;
class AbstractScene
{
public:
void setCoordinate(Vector3D& coordinate);
Vector3D getCoordinate();
};
}
#endif // ABSTRACTSCENE_H
2 changes: 1 addition & 1 deletion AbstractSpirit.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class AbstractSpirit

private:
Vector3D coordinate;

Vector3D direction;
};

}
Expand Down
5 changes: 3 additions & 2 deletions Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
namespace QtGameEngine
{

Game::Game(int argc, char *argv[])
Game::Game(int& argc, char *argv[])
:QApplication(argc,argv)
{
display = new GameDisplayWidget;
timerID = startTimer(34);
display->setInputMapper(&mapper);
connect(this,SIGNAL(frame()),display,SLOT(updateGL()));
}

Expand All @@ -27,6 +27,7 @@ void Game::timerEvent(QTimerEvent *e)
int Game::start()
{
display->show();
timerID = startTimer(34);
return exec();
}

Expand Down
5 changes: 4 additions & 1 deletion Game.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ class Game : public QApplication
{
Q_OBJECT
public:
Game(int argc,char* argv[]);
Game(int& argc,char* argv[]);
~Game();
int start();
InputMapper* getInputMapper();
signals:
void initialize();
void frame();
Expand All @@ -21,6 +22,8 @@ class Game : public QApplication
private:
GameDisplayWidget* display;
int timerID;

InputMapper mapper;
};

}
Expand Down
3 changes: 2 additions & 1 deletion GameDisplayWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ namespace UI {
GameDisplayWidget::GameDisplayWidget(QWidget *parent) :
QGLWidget(parent)
{

setRenderer(0);
setInputMapper(0);
}


Expand Down
13 changes: 13 additions & 0 deletions QtGameEngine
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef QT_GAME_ENGINE_H
#define QT_GAME_ENGINE_H
#include "AbstractInputHandler.h"
#include "AbstractRenderer.h"
#include "AbstractRenderingObject.h"
#include "AbstractScene.h"
#include "AbstractSpirit.h"
#include "Vector3D.h"
#include "Game.h"



#endif // QTGAMEENGINE_H
13 changes: 12 additions & 1 deletion QtGameEngine.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
QT += opengl


TARGET = QtGameEngine
TEMPLATE = lib
CONFIG += staticlib



HEADERS += \
AbstractSpirit.h \
Vector3D.h \
Expand All @@ -8,7 +15,9 @@ HEADERS += \
AbstractRenderer.h \
AbstractRenderingObject.h \
InputMapper.h \
AbstractInputHandler.h
AbstractInputHandler.h \
AbstractScene.h \
QtGameEngine

SOURCES += \
Vector3D.cpp \
Expand Down Expand Up @@ -36,6 +45,8 @@ SOURCES += \








0 comments on commit 5f3663d

Please sign in to comment.