Skip to content

Commit

Permalink
Blend2D: ifdef to support older and newer API versions
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Jul 16, 2024
1 parent f691f11 commit 4c561c8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/osgEarth/Capabilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#include <gdal.h>
#include <sstream>
#include <osgEarth/Notify>
#ifdef OSGEARTH_HAVE_BLEND2D
#include <blend2d.h>
#endif

using namespace osgEarth;

Expand Down Expand Up @@ -267,6 +270,10 @@ Capabilities::Capabilities() :
OE_INFO << LC << "GL_VERSION: " << _version << std::endl;
//OE_INFO << LC << "GLSL: " << getGLSLVersionInt() << std::endl;

#ifdef OSGEARTH_HAVE_BLEND2D
//OE_INFO << LC << "Blend2D version: " << std::to_string(BL_VERSION) << std::endl;
#endif

#if 0
// assemble the driver version if possible.
std::vector<std::string> version_tokens;
Expand Down
10 changes: 10 additions & 0 deletions src/osgEarth/FeatureRasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,12 @@ namespace osgEarth {
ctx.scale(scale);
ctx.blitImage(BLPoint((double)g->left - GLYPH_PADDING, (double)(-g->top) - GLYPH_PADDING), sprite, glyphRect);
//ctx.blitImage(BLPoint(0, 0), sprite, glyphRect);

#if BL_VERSION >= 2820
ctx.resetTransform();
#else
ctx.resetMatrix();
#endif

#if 0
// Draw the text bounding box
Expand Down Expand Up @@ -573,7 +578,12 @@ namespace osgEarth {
ctx.translate(x, y);
ctx.scale(scale);
ctx.blitImage(BLPoint(-iconRect.w / 2.0, -iconRect.h / 2.0), sprite, iconRect);

#if BL_VERSION >= 2820
ctx.resetTransform();
#else
ctx.resetMatrix();
#endif
}
});
}
Expand Down

0 comments on commit 4c561c8

Please sign in to comment.