Beatmup
Beatmup::RenderingContext Class Reference

Stores the rendering context: current program, current mapping in the scene space, common rendering properties, locked bitmaps, etc. More...

#include <rendering_context.h>

Inheritance diagram for Beatmup::RenderingContext:
Beatmup::BitmapContentLock

Classes

class  EventListener
 

Public Member Functions

void lockBitmap (AbstractBitmap *bitmap)
 
void unlockBitmap (AbstractBitmap *bitmap)
 
GraphicPipelinegetGpu ()
 
const ImageResolutiongetOutputResolution () const
 
void blend ()
 Initiates the rendering operation. More...
 
void enableProgram (GL::RenderingPrograms::Operation operation)
 
GL::ProgramgetProgram ()
 
void bindMask (AbstractBitmap &mask)
 
void setMapping (const AffineMapping &mapping)
 
const AffineMappinggetMapping () const
 
const float getOutputWidth () const
 
const bool isRenderingOnScreen () const
 
- Public Member Functions inherited from Beatmup::BitmapContentLock
 BitmapContentLock ()
 
 ~BitmapContentLock ()
 
void readLock (GraphicPipeline *gpu, AbstractBitmap *bitmap, ProcessingTarget target)
 Locks content of a bitmap for reading using a specific processing target device. More...
 
void writeLock (GraphicPipeline *gpu, AbstractBitmap *bitmap, ProcessingTarget target)
 Locks content of a bitmap for writing using a specific processing target device. More...
 
void unlock (AbstractBitmap *bitmap)
 Drops a lock to the bitmap. More...
 
void unlockAll ()
 Unlocks all the locked bitmaps unconditionally. More...
 
template<const ProcessingTarget target>
void lock (GraphicPipeline *gpu, AbstractBitmap *input, AbstractBitmap *output)
 
void lock (GraphicPipeline *gpu, ProcessingTarget target, AbstractBitmap *input, AbstractBitmap *output)
 
template<const ProcessingTarget target>
void lock (GraphicPipeline *gpu, std::initializer_list< AbstractBitmap * > read, std::initializer_list< AbstractBitmap * > write)
 
template<typename ... Args>
void unlock (AbstractBitmap *first, Args ... others)
 

Private Member Functions

 RenderingContext (GraphicPipeline &gpu, EventListener *eventListener, const ImageResolution &outputResolution, const float refWidth, const bool renderingOnScreen)
 

Private Attributes

EventListenereventListener
 
AffineMapping mapping
 
ImageResolution outputResolution
 
const float outputWidth
 
const bool renderingOnScreen
 
GraphicPipelinegpu
 

Friends

class SceneRenderer
 

Detailed Description

Stores the rendering context: current program, current mapping in the scene space, common rendering properties, locked bitmaps, etc.

Provides a set of tools and shortcuts to access rendering programs routines.

Definition at line 30 of file rendering_context.h.

Constructor & Destructor Documentation

◆ RenderingContext()

RenderingContext::RenderingContext ( GraphicPipeline gpu,
EventListener eventListener,
const ImageResolution outputResolution,
const float  refWidth,
const bool  renderingOnScreen 
)
private

Member Function Documentation

◆ lockBitmap()

void RenderingContext::lockBitmap ( AbstractBitmap bitmap)

Definition at line 30 of file rendering_context.cpp.

30  {
32 }
void readLock(GraphicPipeline *gpu, AbstractBitmap *bitmap, ProcessingTarget target)
Locks content of a bitmap for reading using a specific processing target device.
Beatmup::InternalBitmap * bitmap

◆ unlockBitmap()

void RenderingContext::unlockBitmap ( AbstractBitmap bitmap)

Definition at line 35 of file rendering_context.cpp.

35  {
36  unlock(bitmap);
37 }
void unlock(AbstractBitmap *bitmap)
Drops a lock to the bitmap.

◆ getGpu()

GraphicPipeline& Beatmup::RenderingContext::getGpu ( )
inline

Definition at line 52 of file rendering_context.h.

52 { return gpu; }

◆ getOutputResolution()

const ImageResolution& Beatmup::RenderingContext::getOutputResolution ( ) const
inline

Definition at line 54 of file rendering_context.h.

54 { return outputResolution; }

◆ blend()

void RenderingContext::blend ( )

Initiates the rendering operation.

Definition at line 40 of file rendering_context.cpp.

40  {
42 }
void blend(bool onScreen)
Performs the blending operation.
GL::RenderingPrograms & getRenderingPrograms()
Definition: pipeline.h:125

◆ enableProgram()

void RenderingContext::enableProgram ( GL::RenderingPrograms::Operation  operation)

Definition at line 45 of file rendering_context.cpp.

45  {
47 }
void enableProgram(GraphicPipeline *gpu, Operation program)
Select and enable a common program.

◆ getProgram()

GL::Program & RenderingContext::getProgram ( )

Definition at line 50 of file rendering_context.cpp.

◆ bindMask()

void RenderingContext::bindMask ( AbstractBitmap mask)

Definition at line 55 of file rendering_context.cpp.

55  {
57 }
void bindMask(GraphicPipeline *gpu, AbstractBitmap &mask)
Binds a mask to a masked rendering program.

◆ setMapping()

void Beatmup::RenderingContext::setMapping ( const AffineMapping mapping)
inline

Definition at line 66 of file rendering_context.h.

66 { this->mapping = mapping; }

◆ getMapping()

const AffineMapping& Beatmup::RenderingContext::getMapping ( ) const
inline

Definition at line 67 of file rendering_context.h.

67 { return mapping; }

◆ getOutputWidth()

const float Beatmup::RenderingContext::getOutputWidth ( ) const
inline

Definition at line 69 of file rendering_context.h.

69 { return outputWidth; }

◆ isRenderingOnScreen()

const bool Beatmup::RenderingContext::isRenderingOnScreen ( ) const
inline

Definition at line 70 of file rendering_context.h.

70 { return renderingOnScreen; }

Friends And Related Function Documentation

◆ SceneRenderer

friend class SceneRenderer
friend

Definition at line 31 of file rendering_context.h.

Member Data Documentation

◆ eventListener

EventListener* Beatmup::RenderingContext::eventListener
private

Definition at line 39 of file rendering_context.h.

◆ mapping

AffineMapping Beatmup::RenderingContext::mapping
private

Definition at line 40 of file rendering_context.h.

◆ outputResolution

ImageResolution Beatmup::RenderingContext::outputResolution
private

Definition at line 42 of file rendering_context.h.

◆ outputWidth

const float Beatmup::RenderingContext::outputWidth
private

Definition at line 43 of file rendering_context.h.

◆ renderingOnScreen

const bool Beatmup::RenderingContext::renderingOnScreen
private

Definition at line 44 of file rendering_context.h.

◆ gpu

GraphicPipeline& Beatmup::RenderingContext::gpu
private

Definition at line 46 of file rendering_context.h.


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