]> git.mxchange.org Git - simgear.git/blobdiff - simgear/canvas/ODGauge.hxx
Canvas::Text: add line-height property.
[simgear.git] / simgear / canvas / ODGauge.hxx
index 3005132c10d9b7f66aefb93422d92b10c03e4189..825b603bca7e4b959400af9b1a33fa755a6bcbba 100644 (file)
@@ -71,6 +71,8 @@ namespace canvas
        */
       void setViewSize(int width, int height = -1);
 
+      osg::Vec2s getViewSize() const;
+
       /**
        * DEPRECATED
        *
@@ -91,6 +93,12 @@ namespace canvas
        */
       void useStencil(bool use = true);
 
+      /**
+       * Enable/Disable additive alpha blending (Can improve results with
+       * transparent background)
+       */
+      void useAdditiveBlend(bool use = true);
+
       /**
        * Set sampling parameters for mipmapping and coverage sampling
        * antialiasing.
@@ -112,7 +120,7 @@ namespace canvas
        * Say if we can render to a texture.
        * @return true if rtt is available
        */
-      bool serviceable(void);
+      bool serviceable() const;
 
       /**
        * Get the OSG camera for drawing this gauge.
@@ -134,21 +142,31 @@ namespace canvas
           _size_y,
           _view_width,
           _view_height;
-      bool _use_image_coords,
-           _use_stencil,
-           _use_mipmapping;
+
+      enum Flags
+      {
+        AVAILABLE           = 1,
+        USE_IMAGE_COORDS    = AVAILABLE << 1,
+        USE_STENCIL         = USE_IMAGE_COORDS << 1,
+        USE_MIPMAPPING      = USE_STENCIL << 1,
+        USE_ADDITIVE_BLEND  = USE_MIPMAPPING << 1
+      };
+
+      uint32_t _flags;
 
       // Multisampling parameters
       int  _coverage_samples,
            _color_samples;
 
-      bool rtAvailable;
       osg::ref_ptr<osg::Camera> camera;
       osg::ref_ptr<osg::Texture2D> texture;
 
+      bool updateFlag(Flags flag, bool enable);
+
       void updateCoordinateFrame();
       void updateStencil();
       void updateSampling();
+      void updateBlendMode();
 
   };