RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
QGLGameViewport Class Reference

#include <qglgameviewport.h>

Inheritance diagram for QGLGameViewport:
QGLBaseViewport QGLGameEditorViewport

Signals

void afterInitializeGL (QGLGameViewport *game_viewport)
 

Public Member Functions

 QGLGameViewport (CLScene *collada_scene, QGLWidget *shared_widget)
 
void setColladaScene (CLScene *collada_scene)
 
CLScenecolladaScene () const
 
 ~QGLGameViewport ()
 
- Public Member Functions inherited from QGLBaseViewport
 QGLBaseViewport (QWidget *parent, QGLWidget *shared_widget)
 
QGLViewportDrawMode drawMode () const
 
void setDrawMode (const QGLViewportDrawMode &value)
 
bool hasFocus () const
 
virtual void paintGL ()
 
 ~QGLBaseViewport ()
 

Protected Member Functions

virtual void initializeGL ()
 
virtual void preDraw ()
 
virtual void step ()
 
virtual void customDraw ()
 
virtual void postDraw ()
 
virtual void drawSkybox ()
 
virtual void drawWorldAxis ()
 
virtual void drawGameObject (CGameObject *game_object)
 
virtual void drawCrosshair ()
 
void bindTextures ()
 
- Protected Member Functions inherited from QGLBaseViewport
void recalculateAspectRatio ()
 
virtual void resizeGL (int, int)
 
void mousePressEvent (QMouseEvent *event)
 
virtual void focusInEvent (QFocusEvent *)
 
virtual void focusOutEvent (QFocusEvent *)
 

Protected Attributes

CLScenem_colladaScene
 
- Protected Attributes inherited from QGLBaseViewport
GLdouble m_projectionRatio
 
QPoint m_lastPos
 
QColor m_clearColor
 
Matrix4 m_modelViewMatrix
 
QGLShaderProgram * m_selectedProgram
 
QGLShaderProgram * m_texturedProgram
 
QGLShaderProgram * m_solidColorsProgram
 

Additional Inherited Members

- Public Types inherited from QGLBaseViewport
enum  QGLViewportDrawMode { WIRED, SOLID, TEXTURED }
 

Detailed Description

Definition at line 41 of file qglgameviewport.h.

Constructor & Destructor Documentation

QGLGameViewport::QGLGameViewport ( CLScene collada_scene,
QGLWidget *  shared_widget 
)

Definition at line 46 of file qglgameviewport.cpp.

QGLGameViewport::~QGLGameViewport ( )

Definition at line 223 of file qglgameviewport.cpp.

Member Function Documentation

void QGLGameViewport::afterInitializeGL ( QGLGameViewport game_viewport)
signal
void QGLGameViewport::bindTextures ( )
protected

Binds all textures to the OpenGL context. It works but it is not the best approach. Most of the textures may never be used in the game scene. This method is just a leftover, now I don't have time to code a better approach.

Definition at line 186 of file qglgameviewport.cpp.

CLScene * QGLGameViewport::colladaScene ( ) const

Definition at line 61 of file qglgameviewport.cpp.

void QGLGameViewport::customDraw ( )
protectedvirtual

Reimplemented from QGLBaseViewport.

Reimplemented in QGLGameEditorViewport.

Definition at line 138 of file qglgameviewport.cpp.

void QGLGameViewport::drawCrosshair ( )
protectedvirtual

Draws the crosshair during gameplay TODO The crosshair must be drawn using a SpriteRenderer/GUIManager or something more appropiate, this is just a workaround.

Reimplemented in QGLGameEditorViewport.

Definition at line 203 of file qglgameviewport.cpp.

void QGLGameViewport::drawGameObject ( CGameObject game_object)
protectedvirtual

Reimplemented in QGLGameEditorViewport.

Definition at line 89 of file qglgameviewport.cpp.

void QGLGameViewport::drawSkybox ( )
protectedvirtual

Reimplemented in QGLGameEditorViewport.

Definition at line 67 of file qglgameviewport.cpp.

void QGLGameViewport::drawWorldAxis ( )
protectedvirtual

Definition at line 76 of file qglgameviewport.cpp.

void QGLGameViewport::initializeGL ( )
protectedvirtual

Reimplemented from QGLBaseViewport.

Definition at line 115 of file qglgameviewport.cpp.

void QGLGameViewport::postDraw ( )
protectedvirtual

Reimplemented from QGLBaseViewport.

Reimplemented in QGLGameEditorViewport.

Definition at line 176 of file qglgameviewport.cpp.

void QGLGameViewport::preDraw ( )
protectedvirtual

Reimplemented from QGLBaseViewport.

Reimplemented in QGLGameEditorViewport.

Definition at line 128 of file qglgameviewport.cpp.

void QGLGameViewport::setColladaScene ( CLScene collada_scene)

Definition at line 54 of file qglgameviewport.cpp.

void QGLGameViewport::step ( )
protectedvirtual

Reimplemented from QGLBaseViewport.

Reimplemented in QGLGameEditorViewport.

Definition at line 109 of file qglgameviewport.cpp.

Member Data Documentation

CLScene* QGLGameViewport::m_colladaScene
protected

Definition at line 80 of file qglgameviewport.h.


The documentation for this class was generated from the following files: