void tvgDrawCmds(tvg::Canvas* canvas)
{
+ if (!canvas) return;
+
//Shape1
auto shape = tvg::Shape::gen();
void tvgUpdateCmds(tvg::Canvas* canvas, float progress)
{
+ if (!canvas) return;
+
/* Update shape directly.
You can update only necessary properties of this shape,
while retaining other properties. */
auto t12 = m.e11 * -sinVal + m.e12 * cosVal;
auto t21 = m.e21 * cosVal + m.e22 * sinVal;
auto t22 = m.e21 * -sinVal + m.e22 * cosVal;
- auto t31 = m.e31 * cosVal + m.e32 * sinVal;
- auto t32 = m.e31 * -sinVal + m.e32 * cosVal;
+ auto t13 = m.e31 * cosVal + m.e32 * sinVal;
+ auto t23 = m.e31 * -sinVal + m.e32 * cosVal;
m.e11 = t11;
m.e12 = t12;
m.e21 = t21;
m.e22 = t22;
- m.e31 = t31;
- m.e32 = t32;
+ m.e13 = t13;
+ m.e23 = t23;
//translate
- m.e31 = progress * 300.0f + 300.0f;
- m.e32 = progress * -100.0f + 300.0f;
+ m.e13 = progress * 300.0f + 300.0f;
+ m.e23 = progress * -100.0f + 300.0f;
pShape->transform(m);
{
//Create a Canvas
swCanvas = tvg::SwCanvas::gen();
- swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT);
+ swCanvas->target(buffer, WIDTH, WIDTH, HEIGHT, tvg::SwCanvas::ARGB8888);
/* Push the shape into the Canvas drawing list
When this shape is into the canvas list, the shape could update & prepare
cout << "tvg engine: opengl" << endl;
}
+ //Threads Count
+ auto threads = std::thread::hardware_concurrency();
+
//Initialize ThorVG Engine
- if (tvg::Initializer::init(tvgEngine) == tvg::Result::Success) {
+ if (tvg::Initializer::init(tvgEngine, threads) == tvg::Result::Success) {
elm_init(argc, argv);
cout << "engine is not supported" << endl;
}
return 0;
-}
\ No newline at end of file
+}