GUInity
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
GraphicsSystem Class Referenceabstract

#include <GraphicsSystem.hpp>

Inheritance diagram for GraphicsSystem:
GLFWGraphicsSystem

Public Member Functions

 GraphicsSystem (GraphicsSystem const &)
 
void operator= (GraphicsSystem const &)
 
virtual int init (int width, int height)=0
 
virtual void shutdown ()=0
 
virtual void swap ()=0
 
virtual void clear ()=0
 
virtual void createDebugShader ()=0
 
virtual int getScreenWidth ()=0
 
virtual int getScreenHeight ()=0
 
virtual void render (shared_ptr< Camera > camera, const physx::PxRenderBuffer &rb, const glm::vec4 &color)=0
 
virtual void render (shared_ptr< Camera > camera, vector< shared_ptr< MeshRenderer >> &renderers, vector< shared_ptr< Light >> &lights)=0
 
virtual void renderGUI (vector< shared_ptr< UIWidget >> uiWidgetVector)=0
 
virtual void generateVertexArrays (const GLuint size, GLuint &vao)=0
 
virtual void generateBuffer (const GLuint size, GLuint &bo, GLenum type, int dataSize, void *dataPointer, GLenum drawType)=0
 
virtual void deleteBuffer (GLuint size, GLuint &bo)=0
 
virtual GLuint createShader (GLenum shaderType)=0
 
virtual void compileShader (GLuint shaderID, GLuint size, const char *dataPointer)=0
 
virtual GLuint createShaderProgram ()=0
 
virtual void attachAndLinkShader (GLuint ProgramID, GLuint VertexShaderID, GLuint FragmentShaderID)=0
 
virtual void deleteShader (GLuint shaderID)=0
 
virtual GLint getUniformLocation (GLuint programID, const char *name)=0
 
virtual shared_ptr< TexturegetDefaultTexture ()=0
 
virtual shared_ptr< GLFWwindow > getWindow ()
 

Static Public Member Functions

static GraphicsSystemgetInstance ()
 

Protected Attributes

shared_ptr< GLFWwindow > window
 
shared_ptr< ShaderdebugShader
 
shared_ptr< MaterialdebugMaterial
 
shared_ptr< ShaderguiShader
 
shared_ptr< MaterialguiMaterial
 
glm::mat4 GUIMatrix
 

Detailed Description

GraphicsSystem handles the Graphics of the Engine.

The idea behind creating an abstract class would be to allow for different Graphic API's to handle how images are drawn. For example, change from OpenGL to DirectX easily.

This is the class that knows how to draw images on the screen.

Member Function Documentation

virtual void GraphicsSystem::attachAndLinkShader ( GLuint  ProgramID,
GLuint  VertexShaderID,
GLuint  FragmentShaderID 
)
pure virtual

Merge VertexShader and FragmentShader to one

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::clear ( )
pure virtual

Clear buffers

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::compileShader ( GLuint  shaderID,
GLuint  size,
const char *  dataPointer 
)
pure virtual

Compile the shader

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::createDebugShader ( )
pure virtual

create debug shader to display Physics information on the screen

Implemented in GLFWGraphicsSystem.

virtual GLuint GraphicsSystem::createShader ( GLenum  shaderType)
pure virtual

Creates a new shader

Implemented in GLFWGraphicsSystem.

virtual GLuint GraphicsSystem::createShaderProgram ( )
pure virtual

Creates a new shader program

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::deleteBuffer ( GLuint  size,
GLuint &  bo 
)
pure virtual

Release buffer

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::deleteShader ( GLuint  shaderID)
pure virtual

Release shader

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::generateBuffer ( const GLuint  size,
GLuint &  bo,
GLenum  type,
int  dataSize,
void *  dataPointer,
GLenum  drawType 
)
pure virtual

Generates a new Buffer Array

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::generateVertexArrays ( const GLuint  size,
GLuint &  vao 
)
pure virtual

Generates a new Vertex Array - Used for mesh vertice data

Implemented in GLFWGraphicsSystem.

virtual int GraphicsSystem::getScreenHeight ( )
pure virtual

screen height Getter

Implemented in GLFWGraphicsSystem.

virtual int GraphicsSystem::getScreenWidth ( )
pure virtual

screen width Getter

Implemented in GLFWGraphicsSystem.

virtual GLint GraphicsSystem::getUniformLocation ( GLuint  programID,
const char *  name 
)
pure virtual

Gets the uniform location for a string in a shader

Implemented in GLFWGraphicsSystem.

virtual shared_ptr<GLFWwindow> GraphicsSystem::getWindow ( )
inlinevirtual

window Getter

virtual int GraphicsSystem::init ( int  width,
int  height 
)
pure virtual

Initialize the system, create the window and such

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::render ( shared_ptr< Camera camera,
const physx::PxRenderBuffer &  rb,
const glm::vec4 &  color 
)
pure virtual

Renders Physics information on screen from the camera point of view

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::render ( shared_ptr< Camera camera,
vector< shared_ptr< MeshRenderer >> &  renderers,
vector< shared_ptr< Light >> &  lights 
)
pure virtual

Renders meshes on the screen from the camera point of view

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::renderGUI ( vector< shared_ptr< UIWidget >>  uiWidgetVector)
pure virtual

Render Widgets on screen

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::shutdown ( )
pure virtual

Shutdown the system, destroy window and release any allocated memory

Implemented in GLFWGraphicsSystem.

virtual void GraphicsSystem::swap ( )
pure virtual

Swap buffers

Implemented in GLFWGraphicsSystem.

Member Data Documentation

shared_ptr<Material> GraphicsSystem::debugMaterial
protected

Material used to debug Physics Information

shared_ptr<Shader> GraphicsSystem::debugShader
protected

Shader used to debug Physics Information

shared_ptr<Material> GraphicsSystem::guiMaterial
protected

Material used to render GUI

shared_ptr<Shader> GraphicsSystem::guiShader
protected

Shader used to render GUI

shared_ptr<GLFWwindow> GraphicsSystem::window
protected

Handle to the window


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