mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 13:43:43 +00:00
examples: add commentary for exceptions.
This commit is contained in:
parent
a0f28d0db4
commit
89d35123d8
2 changed files with 9 additions and 3 deletions
|
@ -32,7 +32,10 @@ void tvgDrawCmds(tvg::Canvas* canvas)
|
||||||
|
|
||||||
for (int i = 0; i < 5; ++i) {
|
for (int i = 0; i < 5; ++i) {
|
||||||
auto picture = tvg::Picture::gen();
|
auto picture = tvg::Picture::gen();
|
||||||
if (picture->load(EXAMPLE_DIR"/logo.png") != tvg::Result::Success) return;
|
if (picture->load(EXAMPLE_DIR"/logo.png") != tvg::Result::Success) {
|
||||||
|
cout << "PNG is not supported, Did you enable PNG Loader??" << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
picture->translate(i* 150, i * 150);
|
picture->translate(i* 150, i * 150);
|
||||||
picture->rotate(30 * i);
|
picture->rotate(30 * i);
|
||||||
picture->scale(0.25);
|
picture->scale(0.25);
|
||||||
|
|
|
@ -31,7 +31,10 @@ void tvgDrawCmds(tvg::Canvas* canvas)
|
||||||
if (!canvas) return;
|
if (!canvas) return;
|
||||||
|
|
||||||
auto picture = tvg::Picture::gen();
|
auto picture = tvg::Picture::gen();
|
||||||
picture->load(EXAMPLE_DIR"/test.tvg");
|
if (picture->load(EXAMPLE_DIR"/test.tvg") != tvg::Result::Success) {
|
||||||
|
cout << "TVG is not supported, Did you enable TVG Loader??" << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
canvas->push(move(picture));
|
canvas->push(move(picture));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,4 +142,4 @@ int main(int argc, char **argv)
|
||||||
cout << "engine is not supported" << endl;
|
cout << "engine is not supported" << endl;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue