windows::opengl::CRenderer


All platform-dependent classes have been moved to Platform Package in release 10.0.0.

This class is available on Windows platform only

Corresponding class for Linux platform is here.

Corresponding class for Android platform is here.

You can find more information in comments below. Overrided methods can be found in corresponding base interface.

class CRenderer :public virtual IRenderer
    {
    public:
        IWindow * getWindow() override;
        ITexture *getRenderTarget() override;
        Rect getViewport() override;
        Color getClearColor() override;
        TECHNOLOGY_TYPE getTechnology() const override; // Return ttOpenGL 
        Point getMinVersion() const override; // Return { 4, 3 } 
        Point getVersion() override;
        // Since 1.3.0 
        IShaderProgram *getShaderProgram() override;
        // Since 6.0.0 
        INativeGraphics *getNativeGraphics() override; // Return instance of IOpenGL interface 
        // Since 9.0.0 
        bool isWindowSupported(IWindow *window) override;
    
        bool setWindow(IWindow *value) override;
        bool setRenderTarget(ITexture *value) override;
        void setClearColor(const Color &value) override;
        bool setShaderProgram(IShaderProgram *value) override;
    
        IPlatformFont *FontCreate(const String &fontname, const int height, const FONT_WEIGHT weight, const bool italic, const bool underline, const bool strikeout, const bool monospace) override;
        ITexture *TextureCreate(const int width, const int height, const AnsiString &format) override;
        ITexture *TextureCreate(const Bitmap &data) override;
        IShaderProgram *ShaderProgramCreate(const AnsiString &vertex, const AnsiString &fragment, const bool utils) override;
        IShaderProgram *ShaderProgramCreate(const AnsiString &fragment) override;
    
        void Release() override;
        bool DrawBegin(Rect &viewport) override;
        bool DrawEnd() override;
        bool Present() override;
        IRenderer *CreateInstance() override;
    
        // !!! IMPORTANT !!! 
        // All the methods below should NOT be called outside logical DrawBegin-DrawEnd block 
        // Also you should use correct arguments, there is no check inside due to performance optimization 
    
        bool PushMask(ITexture *mask, const Matrix &matrix) override;
        void PopMask() override;
    
        // Since 6.0.0 
        void RestoreState() override;
    
        // Since 7.0.0 
        bool BeginSplineLimitation(const CUBIC_BEZIER_SPLINE &spline1, const CUBIC_BEZIER_SPLINE &spline2, const bool apply_to_y_direction) override;
        bool EndSplineLimitation() override;
    
        void Clear() override;
        void Clear(const Color &color) override;
    
        void Line(const PointF &p1, const PointF &p2, const Color &color, const BLOCK *block) override;
        void Line(const PointF &p1, const PointF &p2, const Color &color, const Matrix &m, const BLOCK *block) override;
        void Line(const PointF &p1, const PointF &p2, const Color &c1, const Color &c2, const BLOCK *block) override;
        void Line(const PointF &p1, const PointF &p2, const Color &c1, const Color &c2, const Matrix &m, const BLOCK *block) override;
        // Since 3.0.0 
        void Line(const PointF &p1, const PointF &p2, const Color &color, const BLOCK *block, const unsigned int bitmask) override;
        void Line(const PointF &p1, const PointF &p2, const Color &color, const Matrix &m, const BLOCK *block, const unsigned int bitmask) override;
        void Line(const PointF &p1, const PointF &p2, const Color &c1, const Color &c2, const BLOCK *block, const unsigned int bitmask) override;
        void Line(const PointF &p1, const PointF &p2, const Color &c1, const Color &c2, const Matrix &m, const BLOCK *block, const unsigned int bitmask) override;
        // Since 7.0.0 
        void Line(const PointF &p1, const PointF &p2, const Color &color, const BLOCK *block, ITexture *mask) override;
        void Line(const PointF &p1, const PointF &p2, const Color &color, const Matrix &m, const BLOCK *block, ITexture *mask) override;
        void Line(const PointF &p1, const PointF &p2, const Color &c1, const Color &c2, const BLOCK *block, ITexture *mask) override;
        void Line(const PointF &p1, const PointF &p2, const Color &c1, const Color &c2, const Matrix &m, const BLOCK *block, ITexture *mask) override;
        void Line(const PointF &p1, const PointF &p2, const Color &color, const BLOCK *block, const unsigned int bitmask, ITexture *mask) override;
        void Line(const PointF &p1, const PointF &p2, const Color &color, const Matrix &m, const BLOCK *block, const unsigned int bitmask, ITexture *mask) override;
        void Line(const PointF &p1, const PointF &p2, const Color &c1, const Color &c2, const BLOCK *block, const unsigned int bitmask, ITexture *mask) override;
        void Line(const PointF &p1, const PointF &p2, const Color &c1, const Color &c2, const Matrix &m, const BLOCK *block, const unsigned int bitmask, ITexture *mask) override;
    
        void Lines(const std::vector<PointF> &points, const Color &color, const bool loop, const BLOCK *block) override;
        void Lines(const std::vector<PointF> &points, const Color &color, const bool loop, const Matrix &m, const BLOCK *block) override;
        // Since 3.0.0 
        void Lines(const std::vector<PointF> &points, const Color &color, const bool loop, const BLOCK *block, const unsigned int bitmask) override;
        void Lines(const std::vector<PointF> &points, const Color &color, const bool loop, const Matrix &m, const BLOCK *block, const unsigned int bitmask) override;
        // Since 7.0.0 
        void Lines(const std::vector<PointF> &points, const Color &color, const bool loop, const BLOCK *block, ITexture *mask) override;
        void Lines(const std::vector<PointF> &points, const Color &color, const bool loop, const Matrix &m, const BLOCK *block, ITexture *mask) override;
        void Lines(const std::vector<PointF> &points, const Color &color, const bool loop, const BLOCK *block, const unsigned int bitmask, ITexture *mask) override;
        void Lines(const std::vector<PointF> &points, const Color &color, const bool loop, const Matrix &m, const BLOCK *block, const unsigned int bitmask, ITexture *mask) override;
    
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &color, const BLOCK *block) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &color, const Matrix &m, const BLOCK *block) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &c1, const Color &c2, const Color &c3, const BLOCK *block) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &c1, const Color &c2, const Color &c3, const Matrix &m, const BLOCK *block) override;
        // Since 3.0.0 
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &color, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &color, const Matrix &m, const BLOCK *block, const unsigned int bitmask_x, 
            const unsigned int bitmask_y, const bool bitmask_form) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &c1, const Color &c2, const Color &c3, const BLOCK *block, const unsigned int bitmask_x,
            const unsigned int bitmask_y, const bool bitmask_form) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &c1, const Color &c2, const Color &c3, const Matrix &m, const BLOCK *block, 
            const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form) override;
        // Since 7.0.0 
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &color, const BLOCK *block, ITexture *mask) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &color, const Matrix &m, const BLOCK *block, ITexture *mask) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &c1, const Color &c2, const Color &c3, const BLOCK *block, ITexture *mask) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &c1, const Color &c2, const Color &c3, const Matrix &m, const BLOCK *block, ITexture *mask) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &color, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form, ITexture *mask) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &color, const Matrix &m, const BLOCK *block, const unsigned int bitmask_x, 
            const unsigned int bitmask_y, const bool bitmask_form, ITexture *mask) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &c1, const Color &c2, const Color &c3, const BLOCK *block, const unsigned int bitmask_x,
            const unsigned int bitmask_y, const bool bitmask_form, ITexture *mask) override;
        void Triangle(const PointF &p1, const PointF &p2, const PointF &p3, const Color &c1, const Color &c2, const Color &c3, const Matrix &m, const BLOCK *block, 
            const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form, ITexture *mask) override;
    
        void Rectangle(const RectF &rect, const Color &color, const BLOCK *block) override;
        void Rectangle(const RectF &rect, const Color &color, const Matrix &m, const BLOCK *block) override;
        void Rectangle(const RectF &rect, const Color &c1, const Color &c2, const Color &c3, const Color &c4, const BLOCK *block) override;
        void Rectangle(const RectF &rect, const Color &c1, const Color &c2, const Color &c3, const Color &c4, const Matrix &m, const BLOCK *block) override;
        // Since 3.0.0 
        void Rectangle(const RectF &rect, const Color &color, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form) override;
        void Rectangle(const RectF &rect, const Color &color, const Matrix &m, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, 
            const bool bitmask_form) override;
        void Rectangle(const RectF &rect, const Color &c1, const Color &c2, const Color &c3, const Color &c4, const BLOCK *block, const unsigned int bitmask_x, 
            const unsigned int bitmask_y, const bool bitmask_form) override;
        void Rectangle(const RectF &rect, const Color &c1, const Color &c2, const Color &c3, const Color &c4, const Matrix &m, const BLOCK *block, const unsigned int bitmask_x,
            const unsigned int bitmask_y, const bool bitmask_form) override;
        // Since 7.0.0 
        void Rectangle(const RectF &rect, const Color &color, const BLOCK *block, ITexture *mask) override;
        void Rectangle(const RectF &rect, const Color &color, const Matrix &m, const BLOCK *block, ITexture *mask) override;
        void Rectangle(const RectF &rect, const Color &c1, const Color &c2, const Color &c3, const Color &c4, const BLOCK *block, ITexture *mask) override;
        void Rectangle(const RectF &rect, const Color &c1, const Color &c2, const Color &c3, const Color &c4, const Matrix &m, const BLOCK *block, ITexture *mask) override;
        void Rectangle(const RectF &rect, const Color &color, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form,
            ITexture *mask) override;
        void Rectangle(const RectF &rect, const Color &color, const Matrix &m, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form,
            ITexture *mask) override;
        void Rectangle(const RectF &rect, const Color &c1, const Color &c2, const Color &c3, const Color &c4, const BLOCK *block, const unsigned int bitmask_x, 
            const unsigned int bitmask_y, const bool bitmask_form, ITexture *mask) override;
        void Rectangle(const RectF &rect, const Color &c1, const Color &c2, const Color &c3, const Color &c4, const Matrix &m, const BLOCK *block, const unsigned int bitmask_x,
            const unsigned int bitmask_y, const bool bitmask_form, ITexture *mask) override;
    
        void Gradient(const RectF &rect, nitisa::Gradient &g, const BLOCK *block) override;
        void Gradient(const RectF &rect, nitisa::Gradient &g, const Matrix &m, const BLOCK *block) override;
        // Since 3.0.0 
        void Gradient(const RectF &rect, nitisa::Gradient &g, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form) override;
        void Gradient(const RectF &rect, nitisa::Gradient &g, const Matrix &m, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, 
            const bool bitmask_form) override;
        // Since 7.0.0 
        void Gradient(const RectF &rect, nitisa::Gradient &g, const BLOCK *block, ITexture *mask) override;
        void Gradient(const RectF &rect, nitisa::Gradient &g, const Matrix &m, const BLOCK *block, ITexture *mask) override;
        void Gradient(const RectF &rect, nitisa::Gradient &g, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form, 
            ITexture *mask) override;
        void Gradient(const RectF &rect, nitisa::Gradient &g, const Matrix &m, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form,
            ITexture *mask) override;
    
        void Image(ITexture *image, const PointF &p, const float transparency, const BLOCK *block) override;
        void Image(ITexture *image, const Matrix &m, const float transparency, const BLOCK *block) override;
        void Image(ITexture *image, const RectF &part, const PointF &p, const float transparency, const BLOCK *block) override;
        void Image(ITexture *image, const RectF &part, const Matrix &m, const float transparency, const BLOCK *block) override;
        // Since 3.0.0 
        void Image(ITexture *image, const PointF &p, const float transparency, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, 
            const bool bitmask_form) override;
        void Image(ITexture *image, const Matrix &m, const float transparency, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, 
            const bool bitmask_form) override;
        void Image(ITexture *image, const RectF &part, const PointF &p, const float transparency, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form) override;
        void Image(ITexture *image, const RectF &part, const Matrix &m, const float transparency, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form) override;
        // Since 7.0.0 
        void Image(ITexture *image, const PointF &p, const float transparency, const BLOCK *block, ITexture *mask) override;
        void Image(ITexture *image, const Matrix &m, const float transparency, const BLOCK *block, ITexture *mask) override;
        void Image(ITexture *image, const RectF &part, const PointF &p, const float transparency, const BLOCK *block, ITexture *mask) override;
        void Image(ITexture *image, const RectF &part, const Matrix &m, const float transparency, const BLOCK *block, ITexture *mask) override;
        void Image(ITexture *image, const PointF &p, const float transparency, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form,
            ITexture *mask) override;
        void Image(ITexture *image, const Matrix &m, const float transparency, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form,
            ITexture *mask) override;
        void Image(ITexture *image, const RectF &part, const PointF &p, const float transparency, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form, ITexture *mask) override;
        void Image(ITexture *image, const RectF &part, const Matrix &m, const float transparency, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form, ITexture *mask) override;
    
        void Block(const RectF &block, const RectF &border, const RectF &radius, const BlockColors &colors) override;
        void Block(const RectF &rect, const RectF &block, const RectF &border, const RectF &radius, const BlockColors &colors) override;
        // Since 3.0.0 
        void Block(const RectF &block, const RectF &border, const RectF &radius, const BlockColors &colors, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form) override;
        void Block(const RectF &rect, const RectF &block, const RectF &border, const RectF &radius, const BlockColors &colors, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form) override;
        // Since 7.0.0 
        void Block(const RectF &block, const RectF &border, const RectF &radius, const BlockColors &colors, ITexture *mask) override;
        void Block(const RectF &rect, const RectF &block, const RectF &border, const RectF &radius, const BlockColors &colors, ITexture *mask) override;
        void Block(const RectF &block, const RectF &border, const RectF &radius, const BlockColors &colors, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form, ITexture *mask) override;
        void Block(const RectF &rect, const RectF &block, const RectF &border, const RectF &radius, const BlockColors &colors, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form, ITexture *mask) override;
    
        void Text(const String &text, IPlatformFont *font, const float distance, const Color &color, const PointF &p, const BLOCK *block) override;
        void Text(const String &text, IPlatformFont *font, const float distance, const Color &color, const Matrix &m, const BLOCK *block) override;
        // Since 3.0.0 
        void Text(const String &text, IPlatformFont *font, const float distance, const Color &color, const PointF &p, const BLOCK *block, const unsigned int bitmask_x,
            const unsigned int bitmask_y, const bool bitmask_form) override;
        void Text(const String &text, IPlatformFont *font, const float distance, const Color &color, const Matrix &m, const BLOCK *block, const unsigned int bitmask_x,
            const unsigned int bitmask_y, const bool bitmask_form) override;
        // Since 7.0.0 
        void Text(const String &text, IPlatformFont *font, const float distance, const Color &color, const PointF &p, const BLOCK *block, ITexture *mask) override;
        void Text(const String &text, IPlatformFont *font, const float distance, const Color &color, const Matrix &m, const BLOCK *block, ITexture *mask) override;
        void Text(const String &text, IPlatformFont *font, const float distance, const Color &color, const PointF &p, const BLOCK *block, const unsigned int bitmask_x,
            const unsigned int bitmask_y, const bool bitmask_form, ITexture *mask) override;
        void Text(const String &text, IPlatformFont *font, const float distance, const Color &color, const Matrix &m, const BLOCK *block, const unsigned int bitmask_x,
            const unsigned int bitmask_y, const bool bitmask_form, ITexture *mask) override;
    
        void Blur(ITexture *image, const int radius, const BLUR_TYPE type) override;
        void Blur(ITexture *target, ITexture *source, const int radius, const BLUR_TYPE type) override;
        // Since 3.0.0 
        void Blur(ITexture *image, const int radius, const BLUR_TYPE type, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form) override;
        void Blur(ITexture *target, ITexture *source, const int radius, const BLUR_TYPE type, const unsigned int bitmask_x, const unsigned int bitmask_y, 
            const bool bitmask_form) override;
        // Since 7.0.0 
        void Blur(ITexture *image, const int radius, const BLUR_TYPE type, ITexture *mask) override;
        void Blur(ITexture *target, ITexture *source, const int radius, const BLUR_TYPE type, ITexture *mask) override;
        void Blur(ITexture *image, const int radius, const BLUR_TYPE type, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form, ITexture *mask) override;
        void Blur(ITexture *target, ITexture *source, const int radius, const BLUR_TYPE type, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form,
                ITexture *mask) override;
    
        // Since 7.0.0 
        void Polygon(const std::vector<PointF> &points, const Color &color, const BLOCK *block) override;
        void Polygon(const std::vector<PointF> &points, const Matrix &m, const Color &color, const BLOCK *block) override;
        void Polygon(const std::vector<PointF> &points, const Color &color, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, 
            const bool bitmask_form) override;
        void Polygon(const std::vector<PointF> &points, const Matrix &m, const Color &color, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, 
            const bool bitmask_form) override;
        void Polygon(const std::vector<PointF> &points, const Color &color, const BLOCK *block, ITexture *mask) override;
        void Polygon(const std::vector<PointF> &points, const Matrix &m, const Color &color, const BLOCK *block, ITexture *mask) override;
        void Polygon(const std::vector<PointF> &points, const Color &color, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y, const bool bitmask_form,
            ITexture *mask) override;
        void Polygon(const std::vector<PointF> &points, const Matrix &m, const Color &color, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form, ITexture *mask) override;
    
        // Since 7.0.0 
        void Polygons(const std::vector<std::vector<PointF>> &polygons, const Color &color, const BLOCK *block) override;
        void Polygons(const std::vector<std::vector<PointF>> &polygons, const Matrix &m, const Color &color, const BLOCK *block) override;
        void Polygons(const std::vector<std::vector<PointF>> &polygons, const Color &color, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form) override;
        void Polygons(const std::vector<std::vector<PointF>> &polygons, const Matrix &m, const Color &color, const BLOCK *block, const unsigned int bitmask_x, 
            const unsigned int bitmask_y, const bool bitmask_form) override;
        void Polygons(const std::vector<std::vector<PointF>> &polygons, const Color &color, const BLOCK *block, ITexture *mask) override;
        void Polygons(const std::vector<std::vector<PointF>> &polygons, const Matrix &m, const Color &color, const BLOCK *block, ITexture *mask) override;
        void Polygons(const std::vector<std::vector<PointF>> &polygons, const Color &color, const BLOCK *block, const unsigned int bitmask_x, const unsigned int bitmask_y,
            const bool bitmask_form, ITexture *mask) override;
        void Polygons(const std::vector<std::vector<PointF>> &polygons, const Matrix &m, const Color &color, const BLOCK *block, const unsigned int bitmask_x, 
            const unsigned int bitmask_y, const bool bitmask_form, ITexture *mask) override;
    
        CRenderer(
            const bool double_buffered,
            const int multisample
        #ifdef _DEBUG
            , const bool use_debug_context = false
        #endif
        ); // Multisample will be selected a best one if invalid is specified 
        virtual ~CRenderer();
    
    #ifdef _DEBUG
        Since 10.0.0 
        int getTextureCount(); // Return texture count 
        int getBitmapTextureCount(); // Return bitmap texture count 
        int getMaskCount(); // Return mask count 
        int getFontCount(); // Return font count 
    
        void setDebugEnabled(const bool value); // Enable or disable debug output to std::cout 
    #endif
    };

Shader programs

There are couple of utility shader functions available. They allow to find out at which part of the block current pixel is.

int BlockPointLocation(vec2 p);
This function gets current pixel coordinates(which could be found in var_FormCoord variable if you created shader program using the second(with one argument, method) and returns integer indicating where point is. Possible results are: 0 - point is on left border, 1 - point is on top border, 2 - point is on right border, 3 - point is on bottom border, 4 - point is inside, 5 - point is outside. When you create complete custom shader(using the first method with 3 arguments) you should specifiy options described below to be able to use this function properly. Here they are.

  • ivec4 app_BlockRect; Block rectangle
  • ivec4 app_BlockBorder; Block border widths
  • ivec4 app_BlockRadius; Block corner radiuses
  • vec2 app_BlockInnerEllipse[4]; Precalculated value. You can find how to calculate in in renderer implementation source code
  • vec2 app_BlockCornerCenter[4]; Precalculated value. You can find how to calculate in in renderer implementation source code
  • vec2 app_BlockOuterRCenter[4]; Precalculated value. You can find how to calculate in in renderer implementation source code
  • bvec4 app_BlockHasInner; Whether inner corner is round or sharp. You can find how to calculate in in renderer implementation source code

vec4 BlockPointColor(vec2 p);
This function gets current pixel coordinates and return corresponding color depending on where the pixel is of the block. The same conditions are applied to this function as they are for previous one. Additionaly it requires one more option to be specified.

  • vec4 app_BlockColors[6]; Colors for block parts

All this options are automatically added to your shader program if you assigned utility library or created the program using methods with one argument.

When you create shader program using second creation method the source code should have this function
vec4 CalculateColor(vec2 tex_coord, vec2 form_coord, vec4 color);
It will be supplied with pixel texture coordinates, pixel form/render target coordinates, and interpolated color. The function should return final premultiplied color(red, green, and blue components should be multiplied by alpha; if you get color from texture, do not premultiply it because all textures have already premultiplied pixels). Also block and mask will be applied as well. Additionally in this case following option name should not be used: app_BlockPointLocation, app_Mask, app_MaskSize, app_FormToGL, app_Primitive, app_MaskInv.
The minimum shader language version should be #version 400 core.


Texture indices

This renderer uses following texture indices when performing drawing operations. Either avoid using them when activating textures for your custom shader programs or consider they may be changed during drawing operations described below.

  • 0 is used in drawing images, texts, and bluring(only 2D type) with IRenderer::Image, IRenderer::Text, IRenderer::Blur methods
  • 1, 2 are used in drawing gradients(only 1D type) with IRenderer::Gradient methods
  • 3 is used to perform masking(only 2D type) and can be used by all drawing methods

Arguments

The renderer does not provide any checking of arguments validity. A caller is responsible for such a checking. If you use invalid argument in most cases nothing will be drawn. But in some case you may get fatal error. For example if you use nullptr instead of texture.

Namespace: nitisa::standard::windows::opengl
Include: Standard/Platform/Windows/OpenGL/Renderer.h