Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
|
Render stage responsible for rendering any texture attached as source to the screen. More...
#include <render_stage.hpp>
Public Member Functions | |
ScreenRenderStage (const std::string &shaderFilepath) | |
virtual void | setup (const glm::u16vec2 &targetDimensions) override |
Sets up the program per its configuration. | |
virtual void | validate () override |
Validates this stage by checking for availability of required resources, connections with adjacent render stages. | |
virtual void | execute () override |
Executes this render stage, presumably after preceding render stages have been executed. | |
![]() | |
BaseRenderStage (const std::string &shaderFilepath) | |
Constructs a new BaseRenderStage object. | |
BaseRenderStage (const BaseRenderStage &other)=delete | |
BaseRenderStage (BaseRenderStage &&other)=delete | |
BaseRenderStage & | operator= (const BaseRenderStage &other)=delete |
BaseRenderStage & | operator= (BaseRenderStage &&other)=delete |
virtual | ~BaseRenderStage () |
Destroys the Base Render Stage object. | |
void | attachTexture (const std::string &name, std::shared_ptr< Texture > textureHandle) |
Attaches a named texture to this rendering stage. | |
void | attachMesh (const std::string &name, std::shared_ptr< StaticMesh > meshHandle) |
Attaches a named texture to this rendering stage. | |
void | attachMaterial (const std::string &name, std::shared_ptr< Material > materialHandle) |
Attaches a named material to this rendering stage. | |
std::shared_ptr< Texture > | getTexture (const std::string &name) |
Gets a reference to an attached texture by its name. | |
std::shared_ptr< StaticMesh > | getMesh (const std::string &name) |
Gets a reference to an attached mesh by its name. | |
std::shared_ptr< Material > | getMaterial (const std::string &name) |
Gets a reference to an attached material by its name. | |
void | useViewport () |
Should be called once this stage's shader is made active; applies the viewport config associated with this render stage. | |
void | setTargetViewport (const SDL_Rect &targetViewport) |
Sets the rendering area for this stage, a rectangular sub-region of the target texture. | |
void | submitToRenderQueue (OpaqueRenderUnit renderUnit) |
Adds an opaque render unit expected by this stage to its associated render queue. | |
void | submitToRenderQueue (LightRenderUnit lightRenderUnit) |
Adds a light render unit expected by this stage to its associated render queue. | |
Additional Inherited Members | |
![]() | |
GLuint | mVertexArrayObject {} |
The OpenGL vertex array object associated with this object. | |
std::shared_ptr< ShaderProgram > | mShaderHandle |
A handle to the compiled and uploaded shader program associated with this render stage. | |
std::map< std::string, std::shared_ptr< Texture > > | mTextureAttachments {} |
This stage's named texture attachments. | |
std::map< std::string, std::shared_ptr< StaticMesh > > | mMeshAttachments {} |
This stage's named mesh attachments. | |
std::map< std::string, std::shared_ptr< Material > > | mMaterialAttachments {} |
This stage's named material attachments. | |
std::priority_queue< OpaqueRenderUnit > | mOpaqueMeshQueue {} |
A queue containing all the opaque meshes to be rendered this frame by this stage. | |
std::priority_queue< LightRenderUnit > | mLightQueue {} |
A queue containing all the light units to be rendered this frame by this stage. | |
SDL_Rect | mTargetViewport {0, 0, 800, 600} |
The rectangle defining the sub-region of its target texture to which this render stage renders. | |
Render stage responsible for rendering any texture attached as source to the screen.
Expects as input a "renderSource" texture attachment.
Produces no output, but has the side effect of rendering to the window/screen per its configuration.
|
overridevirtual |
Executes this render stage, presumably after preceding render stages have been executed.
Mostly anything can happen here, where this stage's behaviour is assumed to be defined in the material properties of the things it renders.
Implements ToyMaker::BaseRenderStage.
|
overridevirtual |
Sets up the program per its configuration.
A part of this process includes creating and storing needed resources, and registering material properties used by this render stage.
targetDimensions | The dimensions of the texture to which this stage will render. |
Implements ToyMaker::BaseRenderStage.
|
overridevirtual |
Validates this stage by checking for availability of required resources, connections with adjacent render stages.
Implements ToyMaker::BaseRenderStage.