Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::CanvasGL Class Referenceabstract
+ Inheritance diagram for inviwo::CanvasGL:

Public Member Functions

virtual void render (std::shared_ptr< const Image > image, LayerType layerType=LayerType::Color, size_t idx=0) override
 
virtual void glSwapBuffers ()=0
 
virtual void update () override
 
virtual size2_t getCanvasDimensions () const =0
 
virtual size2_t getImageDimensions () const
 
double getDepthValueAtCoord (ivec2 canvasCoordinate) const
 Retrieve depth value in normalized device coordinates at screen coordinate.
 
double getDepthValueAtNormalizedCoord (dvec2 normalizedScreenCoordinate) const
 
- Public Member Functions inherited from inviwo::Canvas
virtual void activate ()=0
 
void setEventPropagator (EventPropagator *propagator)
 
virtual std::unique_ptr< CanvascreateHiddenCanvas ()=0
 
virtual ContextID activeContext () const =0
 
virtual ContextID contextId () const =0
 
virtual void releaseContext ()=0
 

Static Public Member Functions

static void defaultGLState ()
 

Protected Member Functions

void setupDebug ()
 
void renderLayer ()
 
void renderNoise ()
 
void drawSquare ()
 
void renderTexture (int)
 
bool ready ()
 

Protected Attributes

std::weak_ptr< const Imageimage_
 
std::unique_ptr< Meshsquare_
 
const MeshGLsquareGL_ = nullptr
 Non-owning reference.
 
bool ready_ = false
 
LayerType layerType_ = LayerType::Color
 
size_t layerIdx_ = 0
 
ShadertextureShader_ = nullptr
 non-owning reference
 
ShadernoiseShader_ = nullptr
 non-owning reference
 
- Protected Attributes inherited from inviwo::Canvas
EventPropagatorpropagator_
 
PickingController pickingController_
 

Additional Inherited Members

- Public Types inherited from inviwo::Canvas
using ContextID = const void*
 

Member Function Documentation

◆ getDepthValueAtCoord()

double inviwo::CanvasGL::getDepthValueAtCoord ( ivec2 canvasCoordinate) const

Retrieve depth value in normalized device coordinates at screen coordinate.

Depth is defined in [-1 1], where -1 is the near plane and 1 is the far plane. Will be 1 if no depth value is available.

Parameters
canvasCoordinateCanvas coordinates [0 dim-1]^2
Returns
NDC depth in [-1 1], 1 if no depth value exist.

◆ ready()

bool inviwo::CanvasGL::ready ( )
protected

Sometime on OSX in renderNoise when on the first time using a canvas we get a INVALID_FRAMEBUFFER_OPERATION error to avoid this we have this ready flag to check that the frame buffer is complete.

◆ render()

virtual void inviwo::CanvasGL::render ( std::shared_ptr< const Image > image,
LayerType layerType = LayerType::Color,
size_t idx = 0 )
overridevirtual

Implements inviwo::Canvas.

◆ update()

virtual void inviwo::CanvasGL::update ( )
overridevirtual

Implements inviwo::Canvas.

Member Data Documentation

◆ squareGL_

const MeshGL* inviwo::CanvasGL::squareGL_ = nullptr
protected

Non-owning reference.

Each canvas must have its own MeshGL since the vertex array object in MeshGL cannot be shared.


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