0.44.0
|
#include <iRenderer.h>
Inherits igor::iModule< iRenderer >.
Classes | |
struct | iRendererStats |
Public Member Functions | |
void | init () |
void | deinit () |
void | setShaderMaterial (const iShaderMaterialPtr &material) |
const iShaderMaterialPtr & | getMaterial () const |
void | setPerspective (float64 fov, float64 aspect, float64 nearPlain, float64 farPlain) |
void | setOrtho (float64 left, float64 right, float64 bottom, float64 top, float64 nearPlain, float64 farPlain) |
void | setModelMatrix (const iaMatrixd &matrix) |
void | setViewMatrix (const iaMatrixd &matrix) |
void | setViewMatrixFromCam (const iaMatrixd &camMatrix) |
void | setProjectionMatrix (const iaMatrixd &matrix) |
const iaMatrixd & | getCamMatrix () const |
const iaMatrixd & | getModelMatrix () const |
const iaMatrixd & | getViewMatrix () const |
const iaMatrixd & | getProjectionMatrix () const |
const iaMatrixd & | getModelViewMatrix () const |
const iaMatrixd & | getModelViewProjectionMatrix () const |
void | setFallbackTexture (const iTexturePtr &texture) |
template<typename T > | |
void | drawPoint (T x, T y, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawPoint (const iaVector2< T > &v, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawPoint (const iaVector3< T > &v, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawLine (T x1, T y1, T x2, T y2, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawLine (const iaVector2< T > &v1, const iaVector2< T > &v2, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawLine (const iaVector3< T > &v1, const iaVector3< T > &v2, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawLineStrip (const std::vector< iaVector2< T > > &points, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawLineStrip (const std::vector< iaVector3< T > > &points, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawLineLoop (const std::vector< iaVector2< T > > &points, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawLineLoop (const std::vector< iaVector3< T > > &points, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawRectangle (T x, T y, T width, T height, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawRectangle (const iaRectangle< T > &rect, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawFilledRectangle (const iaRectangle< T > &rect, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawFilledRectangle (T x, T y, T width, T height, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawFilledRectangleColored (const iaRectangle< T > &rect, const iaColor4f &color1, const iaColor4f &color2, const iaColor4f &color3, const iaColor4f &color4) |
template<typename T > | |
void | drawQuad (const iaVector3< T > &o, const iaVector3< T > &u, const iaVector3< T > &v, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawQuad (const iaMatrix< T > &matrix, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawQuad (const iaVector3< T > &v1, const iaVector3< T > &v2, const iaVector3< T > &v3, const iaVector3< T > &v4, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawTexturedRectangle (T x, T y, T width, T height, const iTexturePtr &texture, const iaColor4f &color=iaColor4f::white, bool blend=false, const iaVector2< T > &tiling=iaVector2< T >(static_cast< T >(1), static_cast< T >(1))) |
template<typename T > | |
void | drawTexturedRectangle (const iaRectangle< T > &rect, const iTexturePtr &texture, const iaColor4f &color=iaColor4f::white, bool blend=false, const iaVector2< T > &tiling=iaVector2< T >(static_cast< T >(1), static_cast< T >(1))) |
template<typename T > | |
void | drawTexturedQuad (const iaMatrix< T > &matrix, const iTexturePtr &texture, const iaColor4f &color=iaColor4f::white, bool blend=false, const iaVector2< T > &tiling=iaVector2< T >(static_cast< T >(1), static_cast< T >(1))) |
template<typename T > | |
void | drawTexturedQuad (const iaVector3< T > &o, const iaVector3< T > &u, const iaVector3< T > &v, iTexturePtr texture, const iaColor4f &color=iaColor4f::white, bool blend=false, const iaVector2< T > &tiling=iaVector2< T >(static_cast< T >(1), static_cast< T >(1))) |
template<typename T > | |
void | drawTexturedQuad (const iaVector3< T > &v1, const iaVector3< T > &v2, const iaVector3< T > &v3, const iaVector3< T > &v4, const iTexturePtr &texture, const iaColor4f &color=iaColor4f::white, bool blend=false, const iaVector2< T > &tiling=iaVector2< T >(static_cast< T >(1), static_cast< T >(1))) |
template<typename T > | |
void | drawSprite (const iaMatrix< T > &matrix, const iSpritePtr &sprite, uint32 frameIndex=0, const iaVector2< T > &size=iaVector2< T >(1.0f, 1.0f), const iaColor4f &color=iaColor4f::white, bool blend=false) |
void | drawString (float32 x, float32 y, const iaString &text, iHorizontalAlignment horz, iVerticalAlignment vert, const iaColor4f &color=iaColor4f::white, float32 maxWidth=0.0f) |
void | drawString (float32 x, float32 y, const iaString &text, const iaColor4f &color=iaColor4f::white, float32 maxWidth=0.0f) |
template<typename T > | |
void | drawCircle (T x, T y, T radius, int segments=16, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawCircle (const iaVector2< T > &pos, T radius, int segments=16, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawCircle (const iaCircle< T > &circle, int segments=16, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawFilledCircle (T x, T y, T radius, int segments=16, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawFilledCircle (const iaVector2< T > &pos, T radius, int segments=16, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawFilledCircle (const iaCircle< T > &circle, int segments=16, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawBox (const iAACube< T > &cube, const iaColor4f &color=iaColor4f::white) |
template<typename T > | |
void | drawBox (const iAABox< T > &box, const iaColor4f &color=iaColor4f::white) |
void | drawMesh (iMeshPtr mesh, iMaterialPtr material) |
void | drawMeshInstanced (iMeshPtr mesh, iInstancingBufferPtr instancingBuffer, iMaterialPtr material=nullptr) |
void | drawBuffer (iVertexArrayPtr vertexArray, iRenderPrimitive primitiveType, iMaterialPtr material=nullptr) |
void | setLightPosition (int32 lightnum, const iaVector3d &pos) |
void | setLightAmbient (int32 lightnum, iaColor3f &ambient) |
void | setLightDiffuse (int32 lightnum, iaColor3f &diffuse) |
void | setLightSpecular (int32 lightnum, iaColor3f &specular) |
void | setLineWidth (float32 lineWidth) |
float32 | getLineWidth () const |
void | setPointSize (float32 pointSize) |
float32 | getPointSize () const |
void | setIgnoreRenderOrder (bool ignoreRenderOrder=true) |
bool | isIgnoringRenderOrder () |
void | setFont (const iTextureFontPtr &font) |
const iTextureFontPtr & | getFont () const |
void | setFontSize (float32 fontSize) |
float32 | getFontSize () const |
void | setFontLineHeight (float32 lineHeight) |
float32 | getFontLineHeight () const |
const iaRectanglei & | getViewport () const |
void | setViewport (const iaRectanglei &viewport) |
void | setViewport (int32 x, int32 y, int32 width, int32 height) |
void | clearStencilBuffer (int32 index=0) |
void | clearColorBuffer (const iaColor4f &color=iaColor4f::black) |
void | clearDepthBuffer (float32 depth=1.0) |
const iaVector3d | unProject (const iaVector3d &screenpos, const iaMatrixd &modelview, const iaMatrixd &projection, const iaRectanglei &viewport) const |
const iaVector3d | project (const iaVector3d &objectSpacePos, const iaMatrixd &modelview, const iaMatrixd &projection, const iaRectanglei &viewport) const |
void | setStencilTestActive (bool enable) |
bool | isStencilTestActive () const |
void | setStencilFunction (iStencilFunction function, int32 ref, uint32 mask) |
void | setStencilOperation (iStencilOperation fail, iStencilOperation zfail, iStencilOperation zpass) |
void | setStencilMask (uint8 mask) |
void | setDepthTestActive (bool enable) |
bool | isDepthTestActive () const |
const iRendererStats & | getStats () const |
void | destroyBuffer (uint32 bufferID) |
void | setColorID (uint64 colorID) |
void | setColor (const iaColor4f &color) |
iRenderTargetID | createRenderTarget (uint32 width, uint32 height, iColorFormat format, iRenderTargetType renderTargetType, bool useDepthBuffer) |
void | destroyRenderTarget (iRenderTargetID id) |
void | setRenderTarget (iRenderTargetID id=DEFAULT_RENDER_TARGET) |
iRenderTargetID | getRenderTarget () const |
void | readPixels (int32 x, int32 y, int32 width, int32 height, iColorFormat format, uint8 *data) |
void | setWireframeEnabled (bool active) |
bool | isWireframeEnabled () const |
const iShaderMaterialPtr & | getDefaultShader () const |
const iShaderMaterialPtr & | getColorIDMaterial () const |
void | flush () |
template<typename T > | |
void | drawPoint (const iaVector2< T > &v, const iaColor4f &color) |
template<typename T > | |
void | drawPoint (T x, T y, const iaColor4f &color) |
template<typename T > | |
void | drawPoint (const iaVector3< T > &v, const iaColor4f &color) |
template<typename T > | |
void | drawLine (T x1, T y1, T x2, T y2, const iaColor4f &color) |
template<typename T > | |
void | drawLine (const iaVector2< T > &v1, const iaVector2< T > &v2, const iaColor4f &color) |
template<typename T > | |
void | drawLine (const iaVector3< T > &v1, const iaVector3< T > &v2, const iaColor4f &color) |
template<typename T > | |
void | drawLineStrip (const std::vector< iaVector2< T > > &points, const iaColor4f &color) |
template<typename T > | |
void | drawLineStrip (const std::vector< iaVector3< T > > &points, const iaColor4f &color) |
template<typename T > | |
void | drawLineLoop (const std::vector< iaVector2< T > > &points, const iaColor4f &color) |
template<typename T > | |
void | drawLineLoop (const std::vector< iaVector3< T > > &points, const iaColor4f &color) |
template<typename T > | |
void | drawRectangle (T x, T y, T width, T height, const iaColor4f &color) |
template<typename T > | |
void | drawRectangle (const iaRectangle< T > &rect, const iaColor4f &color) |
template<typename T > | |
void | drawQuad (const iaVector3< T > &o, const iaVector3< T > &u, const iaVector3< T > &v, const iaColor4f &color) |
template<typename T > | |
void | drawQuad (const iaMatrix< T > &matrix, const iaColor4f &color) |
template<typename T > | |
void | drawQuad (const iaVector3< T > &v1, const iaVector3< T > &v2, const iaVector3< T > &v3, const iaVector3< T > &v4, const iaColor4f &color) |
template<typename T > | |
void | drawFilledRectangle (const iaRectangle< T > &rect, const iaColor4f &color) |
template<typename T > | |
void | drawFilledRectangleColored (const iaRectangle< T > &rect, const iaColor4f &color1, const iaColor4f &color2, const iaColor4f &color3, const iaColor4f &color4) |
template<typename T > | |
void | drawFilledRectangle (T x, T y, T width, T height, const iaColor4f &color) |
template<typename T > | |
void | drawTexturedRectangle (T x, T y, T width, T height, const iTexturePtr &texture, const iaColor4f &color, bool blend, const iaVector2< T > &tiling) |
template<typename T > | |
void | drawTexturedRectangle (const iaRectangle< T > &rect, const iTexturePtr &texture, const iaColor4f &color, bool blend, const iaVector2< T > &tiling) |
template<typename T > | |
void | drawTexturedQuad (const iaVector3< T > &o, const iaVector3< T > &u, const iaVector3< T > &v, iTexturePtr texture, const iaColor4f &color, bool blend, const iaVector2< T > &tiling) |
template<typename T > | |
void | drawTexturedQuad (const iaMatrix< T > &matrix, const iTexturePtr &texture, const iaColor4f &color, bool blend, const iaVector2< T > &tiling) |
template<typename T > | |
void | drawTexturedQuad (const iaVector3< T > &v1, const iaVector3< T > &v2, const iaVector3< T > &v3, const iaVector3< T > &v4, const iTexturePtr &texture, const iaColor4f &color, bool blend, const iaVector2< T > &tiling) |
template<typename T > | |
void | drawSprite (const iaMatrix< T > &matrix, const iSpritePtr &sprite, uint32 frameIndex, const iaVector2< T > &size, const iaColor4f &color, bool blend) |
template<typename T > | |
void | drawCircle (const iaCircle< T > &circle, int segments, const iaColor4f &color) |
template<typename T > | |
void | drawCircle (const iaVector2< T > &pos, T radius, int segments, const iaColor4f &color) |
template<typename T > | |
void | drawCircle (T x, T y, T radius, int segments, const iaColor4f &color) |
template<typename T > | |
void | drawFilledCircle (const iaCircle< T > &circle, int segments, const iaColor4f &color) |
template<typename T > | |
void | drawFilledCircle (const iaVector2< T > &pos, T radius, int segments, const iaColor4f &color) |
template<typename T > | |
void | drawFilledCircle (T x, T y, T radius, int segments, const iaColor4f &color) |
template<typename T > | |
void | drawBox (const iAACube< T > &cube, const iaColor4f &color) |
template<typename T > | |
void | drawBox (const iAABox< T > &box, const iaColor4f &color) |
template<> | |
void | drawSprite (const iaMatrix< float32 > &matrix, const iSpritePtr &sprite, uint32 frameIndex, const iaVector2< float32 > &size, const iaColor4f &color, bool blend) |
template<> | |
void | drawTexturedQuad (const iaVector3< float32 > &v1, const iaVector3< float32 > &v2, const iaVector3< float32 > &v3, const iaVector3< float32 > &v4, const iTexturePtr &texture, const iaColor4f &color, bool blend, const iaVector2< float32 > &tiling) |
template<> | |
void | drawTexturedQuad (const iaMatrix< float32 > &matrix, const iTexturePtr &texture, const iaColor4f &color, bool blend, const iaVector2< float32 > &tiling) |
template<> | |
void | drawTexturedQuad (const iaVector3< float32 > &o, const iaVector3< float32 > &u, const iaVector3< float32 > &v, iTexturePtr texture, const iaColor4f &color, bool blend, const iaVector2< float32 > &tiling) |
template<> | |
void | drawQuad (const iaMatrix< float32 > &matrix, const iaColor4f &color) |
template<> | |
void | drawLineStrip (const std::vector< iaVector3< float32 > > &points, const iaColor4f &color) |
template<> | |
void | drawLine (const iaVector3< float32 > &v1, const iaVector3< float32 > &v2, const iaColor4f &color) |
template<> | |
void | drawPoint (const iaVector3< float32 > &v, const iaColor4f &color) |
template<> | |
void | drawBox (const iAABox< float32 > &box, const iaColor4f &color) |
template<> | |
void | drawQuad (const iaVector3< float32 > &o, const iaVector3< float32 > &u, const iaVector3< float32 > &v, const iaColor4f &color) |
Friends | |
class | iModule< iRenderer > |
class | iWindow |
class | iView |
class | iEntityScene |
Additional Inherited Members | |
Static Public Member Functions inherited from igor::iModule< iRenderer > | |
static IGOR_INLINE iRenderer & | getInstance () |
static IGOR_INLINE bool | isInstantiated () |
static void | create () |
static void | destroy () |
Protected Member Functions inherited from igor::iModule< iRenderer > | |
iModule ()=default | |
virtual | ~iModule ()=default |
renderer interface
void igor::iRenderer::clearColorBuffer | ( | const iaColor4f & | color = iaColor4f::black | ) |
clears color buffer with given color
color | the given clear color |
void igor::iRenderer::clearDepthBuffer | ( | float32 | depth = 1.0 | ) |
clears depth buffer with given depth
depth | the given depth |
void igor::iRenderer::clearStencilBuffer | ( | int32 | index = 0 | ) |
clears swtencil buffer with clear depth
iRenderTargetID igor::iRenderer::createRenderTarget | ( | uint32 | width, |
uint32 | height, | ||
iColorFormat | format, | ||
iRenderTargetType | renderTargetType, | ||
bool | useDepthBuffer | ||
) |
creates a render target
width | the width of the render target in pixel/texel |
height | the height of the render target in pixel/texel |
format | the color format of the render target |
renderTargetType | the render target type |
useDepthBuffer | if true render target is having a depth buffer |
void igor::iRenderer::deinit | ( | ) |
cleanup renderer
void igor::iRenderer::destroyBuffer | ( | uint32 | bufferID | ) |
// TODO remove
void igor::iRenderer::destroyRenderTarget | ( | iRenderTargetID | id | ) |
destroys render target by id
id | the given render target id |
|
inline |
void igor::iRenderer::drawBox | ( | const iAABox< T > & | box, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawBox | ( | const iAABox< T > & | box, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draw box based on given axis aligned box
box | the given box |
color | the color to draw with |
void igor::iRenderer::drawBox | ( | const iAACube< T > & | cube, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawBox | ( | const iAACube< T > & | cube, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draw box based on given axis aligned cube
positioned based on current model view and projection matrices
cube | the given cube |
color | the color to draw with |
void igor::iRenderer::drawBuffer | ( | iVertexArrayPtr | vertexArray, |
iRenderPrimitive | primitiveType, | ||
iMaterialPtr | material = nullptr |
||
) |
draws buffer with given target material and primitive type
vertexArray | the buffer to draw |
primitiveType | the given primitive type |
material | the target material (optional) |
void igor::iRenderer::drawCircle | ( | const iaCircle< T > & | circle, |
int | segments, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawCircle | ( | const iaCircle< T > & | circle, |
int | segments = 16 , |
||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw a circle.
circle | circle definition to draw |
segments | segments count |
color | the color to draw with |
void igor::iRenderer::drawCircle | ( | const iaVector2< T > & | pos, |
T | radius, | ||
int | segments, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawCircle | ( | const iaVector2< T > & | pos, |
T | radius, | ||
int | segments = 16 , |
||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw a circle.
pos | center position |
radius | radius of the circle |
segments | segments count |
color | the color to draw with |
void igor::iRenderer::drawCircle | ( | T | x, |
T | y, | ||
T | radius, | ||
int | segments, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawCircle | ( | T | x, |
T | y, | ||
T | radius, | ||
int | segments = 16 , |
||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw a circle.
x | horizontal center position |
y | vertical center position |
radius | radius of the circle |
segments | segments count |
color | the color to draw with |
void igor::iRenderer::drawFilledCircle | ( | const iaCircle< T > & | circle, |
int | segments, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawFilledCircle | ( | const iaCircle< T > & | circle, |
int | segments = 16 , |
||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw a filled circle.
circle | circle definition to draw |
segments | segments count |
color | the color to draw with |
void igor::iRenderer::drawFilledCircle | ( | const iaVector2< T > & | pos, |
T | radius, | ||
int | segments, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawFilledCircle | ( | const iaVector2< T > & | pos, |
T | radius, | ||
int | segments = 16 , |
||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw a filled circle.
pos | center position |
radius | radius of the circle |
segments | segments count |
color | the color to draw with |
void igor::iRenderer::drawFilledCircle | ( | T | x, |
T | y, | ||
T | radius, | ||
int | segments, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawFilledCircle | ( | T | x, |
T | y, | ||
T | radius, | ||
int | segments = 16 , |
||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw a filled circle.
x | horizontal center position |
y | vertical center position |
radius | radius of the circle |
segments | segments count |
color | the color to draw with |
void igor::iRenderer::drawFilledRectangle | ( | const iaRectangle< T > & | rect, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawFilledRectangle | ( | const iaRectangle< T > & | rect, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draw filled rectangle (z = 0)
rect | the rectangle to draw |
color | the color to draw with |
void igor::iRenderer::drawFilledRectangle | ( | T | x, |
T | y, | ||
T | width, | ||
T | height, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawFilledRectangle | ( | T | x, |
T | y, | ||
T | width, | ||
T | height, | ||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw filled rectangle (z = 0)
x | horizontal position |
y | vertical position |
width | horizontal size |
height | vertical size |
color | the color to draw with |
void igor::iRenderer::drawFilledRectangleColored | ( | const iaRectangle< T > & | rect, |
const iaColor4f & | color1, | ||
const iaColor4f & | color2, | ||
const iaColor4f & | color3, | ||
const iaColor4f & | color4 | ||
) |
draw filled rectangle (z = 0)
rect | the rectangle to draw |
color1 | the color top left |
color2 | the color bottom left |
color3 | the color bottom right |
color4 | the color top right |
void igor::iRenderer::drawFilledRectangleColored | ( | const iaRectangle< T > & | rect, |
const iaColor4f & | color1, | ||
const iaColor4f & | color2, | ||
const iaColor4f & | color3, | ||
const iaColor4f & | color4 | ||
) |
void igor::iRenderer::drawLine | ( | const iaVector2< T > & | v1, |
const iaVector2< T > & | v2, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawLine | ( | const iaVector2< T > & | v1, |
const iaVector2< T > & | v2, | ||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw line (z = 0)
v1 | position of line start |
v2 | position of line end |
color | the color to draw with |
|
inline |
void igor::iRenderer::drawLine | ( | const iaVector3< T > & | v1, |
const iaVector3< T > & | v2, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawLine | ( | const iaVector3< T > & | v1, |
const iaVector3< T > & | v2, | ||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw line
v1 | position of line start |
v2 | position of line end |
color | the color to draw with |
void igor::iRenderer::drawLine | ( | T | x1, |
T | y1, | ||
T | x2, | ||
T | y2, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawLine | ( | T | x1, |
T | y1, | ||
T | x2, | ||
T | y2, | ||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw line (z = 0)
x1 | horizontal position of line start |
y1 | vertical position of line start |
x2 | horizontal position of line end |
y2 | vertical position of line end |
color | the color to draw with |
void igor::iRenderer::drawLineLoop | ( | const std::vector< iaVector2< T > > & | points, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawLineLoop | ( | const std::vector< iaVector2< T > > & | points, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draw line loop (z = 0)
last point will be connected to the first point to close the loop
points | points to draw the line strip with |
color | the color to draw with |
void igor::iRenderer::drawLineLoop | ( | const std::vector< iaVector3< T > > & | points, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawLineLoop | ( | const std::vector< iaVector3< T > > & | points, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draw line loop
last point will be connected to the first point to close the loop
points | points to draw the line strip with |
color | the color to draw with |
void igor::iRenderer::drawLineStrip | ( | const std::vector< iaVector2< T > > & | points, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawLineStrip | ( | const std::vector< iaVector2< T > > & | points, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draw line strip (z = 0)
points | points to draw the line strip with |
color | the color to draw with |
|
inline |
void igor::iRenderer::drawLineStrip | ( | const std::vector< iaVector3< T > > & | points, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawLineStrip | ( | const std::vector< iaVector3< T > > & | points, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draw line strip
points | points to draw the line strip with |
color | the color to draw with |
void igor::iRenderer::drawMesh | ( | iMeshPtr | mesh, |
iMaterialPtr | material | ||
) |
draw mesh
positioned based on current model view and projection matrices
mesh | the given mesh to draw |
material | the target material to use |
void igor::iRenderer::drawMeshInstanced | ( | iMeshPtr | mesh, |
iInstancingBufferPtr | instancingBuffer, | ||
iMaterialPtr | material = nullptr |
||
) |
draw mesh instanced
positioned based on current model view and projection matrices
mesh | the given mesh to draw |
instancingBuffer | the instancing buffer |
material | the target material to use |
void igor::iRenderer::drawPoint | ( | const iaVector2< T > & | v, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawPoint | ( | const iaVector2< T > & | v, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draw point at given position (z = 0)
v | position |
color | the color to draw with |
|
inline |
void igor::iRenderer::drawPoint | ( | const iaVector3< T > & | v, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawPoint | ( | const iaVector3< T > & | v, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draw point at given position
v | position |
color | the color to draw with |
void igor::iRenderer::drawPoint | ( | T | x, |
T | y, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawPoint | ( | T | x, |
T | y, | ||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw point at given position (z = 0)
x | horizontal position |
y | vertical position |
color | the color to draw with |
|
inline |
void igor::iRenderer::drawQuad | ( | const iaMatrix< T > & | matrix, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawQuad | ( | const iaMatrix< T > & | matrix, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draws a unit sized quad multiplied with given matrix
matrix | the given matrix |
color | the color to draw with |
|
inline |
void igor::iRenderer::drawQuad | ( | const iaVector3< T > & | o, |
const iaVector3< T > & | u, | ||
const iaVector3< T > & | v, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawQuad | ( | const iaVector3< T > & | o, |
const iaVector3< T > & | u, | ||
const iaVector3< T > & | v, | ||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw quad
o | center/origin position of quad |
u | u/x/horizontal extension of quad |
v | v/y/vertical extension of quad |
color | the color to draw with |
void igor::iRenderer::drawQuad | ( | const iaVector3< T > & | v1, |
const iaVector3< T > & | v2, | ||
const iaVector3< T > & | v3, | ||
const iaVector3< T > & | v4, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawQuad | ( | const iaVector3< T > & | v1, |
const iaVector3< T > & | v2, | ||
const iaVector3< T > & | v3, | ||
const iaVector3< T > & | v4, | ||
const iaColor4f & | color = iaColor4f::white |
||
) |
draws a quad with 4 given points
v1 | first given point |
v2 | second given point |
v3 | third given point |
v4 | fourth given point |
color | the color to draw with |
void igor::iRenderer::drawRectangle | ( | const iaRectangle< T > & | rect, |
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawRectangle | ( | const iaRectangle< T > & | rect, |
const iaColor4f & | color = iaColor4f::white |
||
) |
draw rectangle (z = 0)
rect | the rectangle to draw |
color | the color to draw with |
void igor::iRenderer::drawRectangle | ( | T | x, |
T | y, | ||
T | width, | ||
T | height, | ||
const iaColor4f & | color | ||
) |
void igor::iRenderer::drawRectangle | ( | T | x, |
T | y, | ||
T | width, | ||
T | height, | ||
const iaColor4f & | color = iaColor4f::white |
||
) |
draw rectangle (z = 0)
x | horizontal position |
y | vertical position |
width | horizontal size |
height | vertical size |
color | the color to draw with |
|
inline |
void igor::iRenderer::drawSprite | ( | const iaMatrix< T > & | matrix, |
const iSpritePtr & | sprite, | ||
uint32 | frameIndex, | ||
const iaVector2< T > & | size, | ||
const iaColor4f & | color, | ||
bool | blend | ||
) |
void igor::iRenderer::drawSprite | ( | const iaMatrix< T > & | matrix, |
const iSpritePtr & | sprite, | ||
uint32 | frameIndex = 0 , |
||
const iaVector2< T > & | size = iaVector2< T >(1.0f, 1.0f) , |
||
const iaColor4f & | color = iaColor4f::white , |
||
bool | blend = false |
||
) |
draw specified frame of given sprite
matrix | the matrix to position and scale the frame |
sprite | the sprite texture to use |
frameIndex | the frame index in the sprite |
size | the size of the sprite (on top of matrix scale) |
color | the color to draw with |
blend | if true blending is used to draw the rectangle |
void igor::iRenderer::drawString | ( | float32 | x, |
float32 | y, | ||
const iaString & | text, | ||
const iaColor4f & | color = iaColor4f::white , |
||
float32 | maxWidth = 0.0f |
||
) |
draw string
x | horizontal position |
y | vertical position |
text | the text to draw |
color | the color to draw with |
maxWidth | the maximum width to render or else there will be line breaks |
void igor::iRenderer::drawString | ( | float32 | x, |
float32 | y, | ||
const iaString & | text, | ||
iHorizontalAlignment | horz, | ||
iVerticalAlignment | vert, | ||
const iaColor4f & | color = iaColor4f::white , |
||
float32 | maxWidth = 0.0f |
||
) |
draw string
x | horizontal position |
y | vertical position |
text | the text to draw |
horz | the horizontal alignment |
vert | the vertical alignment |
color | the color to draw with |
maxWidth | the maximum width to render or else there will be line breaks |
|
inline |
void igor::iRenderer::drawTexturedQuad | ( | const iaMatrix< T > & | matrix, |
const iTexturePtr & | texture, | ||
const iaColor4f & | color, | ||
bool | blend, | ||
const iaVector2< T > & | tiling | ||
) |
void igor::iRenderer::drawTexturedQuad | ( | const iaMatrix< T > & | matrix, |
const iTexturePtr & | texture, | ||
const iaColor4f & | color = iaColor4f::white , |
||
bool | blend = false , |
||
const iaVector2< T > & | tiling = iaVector2< T >(static_cast< T >(1), static_cast< T >(1)) |
||
) |
draw textured unit quad multiplied by a matrix
matrix | the given matrix |
texture | the texture to use. if invalid fallback texture is used |
color | the color to draw with |
blend | if true blending is used to draw the rectangle |
tiling | tiling of the texture in two dimensions |
|
inline |
|
inline |
void igor::iRenderer::drawTexturedQuad | ( | const iaVector3< T > & | o, |
const iaVector3< T > & | u, | ||
const iaVector3< T > & | v, | ||
iTexturePtr | texture, | ||
const iaColor4f & | color, | ||
bool | blend, | ||
const iaVector2< T > & | tiling | ||
) |
void igor::iRenderer::drawTexturedQuad | ( | const iaVector3< T > & | o, |
const iaVector3< T > & | u, | ||
const iaVector3< T > & | v, | ||
iTexturePtr | texture, | ||
const iaColor4f & | color = iaColor4f::white , |
||
bool | blend = false , |
||
const iaVector2< T > & | tiling = iaVector2< T >(static_cast< T >(1), static_cast< T >(1)) |
||
) |
draw textured quad
o | center/origin position of quad |
u | u/x/horizontal extension of quad |
v | v/y/vertical extension of quad |
texture | the texture to use. if invalid fallback texture is used |
color | the color to draw with |
blend | if true blending is used to draw the rectangle |
tiling | tiling of the texture in two dimensions |
void igor::iRenderer::drawTexturedQuad | ( | const iaVector3< T > & | v1, |
const iaVector3< T > & | v2, | ||
const iaVector3< T > & | v3, | ||
const iaVector3< T > & | v4, | ||
const iTexturePtr & | texture, | ||
const iaColor4f & | color, | ||
bool | blend, | ||
const iaVector2< T > & | tiling | ||
) |
void igor::iRenderer::drawTexturedQuad | ( | const iaVector3< T > & | v1, |
const iaVector3< T > & | v2, | ||
const iaVector3< T > & | v3, | ||
const iaVector3< T > & | v4, | ||
const iTexturePtr & | texture, | ||
const iaColor4f & | color = iaColor4f::white , |
||
bool | blend = false , |
||
const iaVector2< T > & | tiling = iaVector2< T >(static_cast< T >(1), static_cast< T >(1)) |
||
) |
draw textured quad with four given points
v1 | first given point |
v2 | second given point |
v3 | third given point |
v4 | fourth given point |
texture | the texture to use. if invalid fallback texture is used |
color | the color to draw with |
blend | if true blending is used to draw the rectangle |
tiling | tiling of the texture in two dimensions |
void igor::iRenderer::drawTexturedRectangle | ( | const iaRectangle< T > & | rect, |
const iTexturePtr & | texture, | ||
const iaColor4f & | color, | ||
bool | blend, | ||
const iaVector2< T > & | tiling | ||
) |
void igor::iRenderer::drawTexturedRectangle | ( | const iaRectangle< T > & | rect, |
const iTexturePtr & | texture, | ||
const iaColor4f & | color = iaColor4f::white , |
||
bool | blend = false , |
||
const iaVector2< T > & | tiling = iaVector2< T >(static_cast< T >(1), static_cast< T >(1)) |
||
) |
draw textured rectangle (z = 0)
rect | the rectangle to draw |
texture | the texture to use. if invalid fallback texture is used |
color | the color to draw with |
blend | if true blending is used to draw the rectangle |
tiling | tiling of the texture in two dimensions |
void igor::iRenderer::drawTexturedRectangle | ( | T | x, |
T | y, | ||
T | width, | ||
T | height, | ||
const iTexturePtr & | texture, | ||
const iaColor4f & | color, | ||
bool | blend, | ||
const iaVector2< T > & | tiling | ||
) |
void igor::iRenderer::drawTexturedRectangle | ( | T | x, |
T | y, | ||
T | width, | ||
T | height, | ||
const iTexturePtr & | texture, | ||
const iaColor4f & | color = iaColor4f::white , |
||
bool | blend = false , |
||
const iaVector2< T > & | tiling = iaVector2< T >(static_cast< T >(1), static_cast< T >(1)) |
||
) |
draw textured rectangle (z = 0)
x | horizontal position |
y | vertical position |
width | horizontal size |
height | vertical size |
texture | the texture to use. if invalid fallback texture is used |
color | the color to draw with |
blend | if true blending is used to draw the rectangle |
tiling | tiling of the texture in two dimensions |
void igor::iRenderer::flush | ( | ) |
draws everything that is still in the queue
const iaMatrixd & igor::iRenderer::getCamMatrix | ( | ) | const |
const iShaderMaterialPtr & igor::iRenderer::getColorIDMaterial | ( | ) | const |
const iShaderMaterialPtr & igor::iRenderer::getDefaultShader | ( | ) | const |
const iTextureFontPtr & igor::iRenderer::getFont | ( | ) | const |
float32 igor::iRenderer::getFontLineHeight | ( | ) | const |
float32 igor::iRenderer::getFontSize | ( | ) | const |
float32 igor::iRenderer::getLineWidth | ( | ) | const |
const iShaderMaterialPtr & igor::iRenderer::getMaterial | ( | ) | const |
const iaMatrixd & igor::iRenderer::getModelMatrix | ( | ) | const |
const iaMatrixd & igor::iRenderer::getModelViewMatrix | ( | ) | const |
const iaMatrixd & igor::iRenderer::getModelViewProjectionMatrix | ( | ) | const |
float32 igor::iRenderer::getPointSize | ( | ) | const |
const iaMatrixd & igor::iRenderer::getProjectionMatrix | ( | ) | const |
iRenderTargetID igor::iRenderer::getRenderTarget | ( | ) | const |
const iRenderer::iRendererStats & igor::iRenderer::getStats | ( | ) | const |
const iaMatrixd & igor::iRenderer::getViewMatrix | ( | ) | const |
const iaRectanglei & igor::iRenderer::getViewport | ( | ) | const |
void igor::iRenderer::init | ( | ) |
initializes renderer
bool igor::iRenderer::isDepthTestActive | ( | ) | const |
bool igor::iRenderer::isIgnoringRenderOrder | ( | ) |
bool igor::iRenderer::isStencilTestActive | ( | ) | const |
bool igor::iRenderer::isWireframeEnabled | ( | ) | const |
const iaVector3d igor::iRenderer::project | ( | const iaVector3d & | objectSpacePos, |
const iaMatrixd & | modelview, | ||
const iaMatrixd & | projection, | ||
const iaRectanglei & | viewport | ||
) | const |
projects a object space position in to screen space
objectSpacePos | the object space position to project |
modelview | the model view matrix |
projection | the projection matrix |
viewport | the viewport |
void igor::iRenderer::readPixels | ( | int32 | x, |
int32 | y, | ||
int32 | width, | ||
int32 | height, | ||
iColorFormat | format, | ||
uint8 * | data | ||
) |
reads rectangular area from screen buffer
x | horizontal position in pixel |
y | vertical position in pixel |
width | width in pixel |
height | height in pixel |
format | color format |
data | destination buffer to store the data in |
void igor::iRenderer::setColor | ( | const iaColor4f & | color | ) |
sets the solid color
only used by specialized shaders. see UNIFORM_SOLIDCOLOR
color | the color to set |
void igor::iRenderer::setColorID | ( | uint64 | colorID | ) |
sets color Id to render with
is used by materials which use UNIFORM_SOLIDCOLOR to encode a color id
colorID | next color ID to render with |
void igor::iRenderer::setDepthTestActive | ( | bool | enable | ) |
sets the depth test active/inactive
enable | if true the depth test is enabled |
void igor::iRenderer::setFallbackTexture | ( | const iTexturePtr & | texture | ) |
sets a fallback texture if no other texture is available
by default this is already set with a generated texture by the iTextureResourceFactory
texture | the texture to use |
void igor::iRenderer::setFont | ( | const iTextureFontPtr & | font | ) |
sets font to use
font | the font to use |
void igor::iRenderer::setFontLineHeight | ( | float32 | lineHeight | ) |
sets font line height
lineHeight | the font line height |
void igor::iRenderer::setFontSize | ( | float32 | fontSize | ) |
sets font size to use
fontSize | the font size to use |
void igor::iRenderer::setIgnoreRenderOrder | ( | bool | ignoreRenderOrder = true | ) |
sets ignore render order flag
If render order is ignored the amount of draw calls will be reduced but this could cause massive artefacts. Only use this if you know what xou are doing.
By default the renderer will always flush when the next render call changes the type of thing we are rendering.
For example: Points to Lines or Buffers to Quads
ignoreRenderOrder | if true render order will be ignored |
void igor::iRenderer::setLightPosition | ( | int32 | lightnum, |
const iaVector3d & | pos | ||
) |
void igor::iRenderer::setLineWidth | ( | float32 | lineWidth | ) |
sets line render width
lineWidth | line render width |
void igor::iRenderer::setModelMatrix | ( | const iaMatrixd & | matrix | ) |
sets the model matrix
matrix | matrix to set the model matrix |
void igor::iRenderer::setOrtho | ( | float64 | left, |
float64 | right, | ||
float64 | bottom, | ||
float64 | top, | ||
float64 | nearPlain, | ||
float64 | farPlain | ||
) |
set projection matrix with orthogonal projection
left | left bounding |
right | right bounding |
bottom | bottom bounding |
top | top bounding |
nearPlain | near plane distance |
farPlain | far plane distance |
void igor::iRenderer::setPerspective | ( | float64 | fov, |
float64 | aspect, | ||
float64 | nearPlain, | ||
float64 | farPlain | ||
) |
set projection matrix with perspective projection
fov | field of view in degrees |
aspect | aspect ratio of screen |
nearPlain | near plane distance |
farPlain | far plane distance |
void igor::iRenderer::setPointSize | ( | float32 | pointSize | ) |
sets point size
pointSize | point size |
void igor::iRenderer::setProjectionMatrix | ( | const iaMatrixd & | matrix | ) |
sets projection matrix
matrix | the new projection matrix |
void igor::iRenderer::setRenderTarget | ( | iRenderTargetID | id = DEFAULT_RENDER_TARGET | ) |
sets the current render target by id
id | the render target id to be set current |
void igor::iRenderer::setShaderMaterial | ( | const iShaderMaterialPtr & | material | ) |
sets current material to render with
material | the material to render with |
void igor::iRenderer::setStencilFunction | ( | iStencilFunction | function, |
int32 | ref, | ||
uint32 | mask | ||
) |
sets the stencil function
function | the stencil function (legal values are Never, Less, LessOrEqual, Greater, GreaterOrEqual, Equal, NotEqual, and Always) |
ref | the reference value |
mask | the mask value to gate the result of the test |
void igor::iRenderer::setStencilMask | ( | uint8 | mask | ) |
sets the stencil mask value
mask | the stencil mas |
void igor::iRenderer::setStencilOperation | ( | iStencilOperation | fail, |
iStencilOperation | zfail, | ||
iStencilOperation | zpass | ||
) |
sets the stencil test actions
legal values are Keep, Zero, Replace, Increment, IncrementWrap, Decrement, DecrementWrap, and Invert
fail | action when stencil test fails |
zfail | action when stencil test passes but depth test fails |
zpass | action when stencil and depth test passed |
void igor::iRenderer::setStencilTestActive | ( | bool | enable | ) |
enables/disables stencil test
enable | if true stencil test will be enabled |
void igor::iRenderer::setViewMatrix | ( | const iaMatrixd & | matrix | ) |
sets the model matrix
matrix | matrix to set the model matrix |
void igor::iRenderer::setViewMatrixFromCam | ( | const iaMatrixd & | camMatrix | ) |
sets view matrix from camera matrix
camMatrix | the camera position and orientation in world space |
void igor::iRenderer::setViewport | ( | const iaRectanglei & | viewport | ) |
sets viewport dimensions
viewport | the new viewport |
sets viewport dimensions
x | horizontal position |
y | vertical position |
width | width |
height | height |
void igor::iRenderer::setWireframeEnabled | ( | bool | active | ) |
sets globally forced wireframe mode
active | if true from now on everything is rendered in wireframe |
const iaVector3d igor::iRenderer::unProject | ( | const iaVector3d & | screenpos, |
const iaMatrixd & | modelview, | ||
const iaMatrixd & | projection, | ||
const iaRectanglei & | viewport | ||
) | const |
projects a screen position in to object space position
screenpos | the screen position (vertical origin is at top of screen) |
modelview | the model view matrix |
projection | the projection matrix |
viewport | the viewport |
|
friend |
|
friend |
|
friend |