|
|
@ -6,16 +6,19 @@ using namespace cv::v4d; |
|
|
|
|
|
|
|
|
|
|
|
int main() { |
|
|
|
int main() { |
|
|
|
Ptr<V4D> window = V4D::make(Size(1280, 720), cv::Size(), "Vector Graphics and Framebuffer"); |
|
|
|
Ptr<V4D> window = V4D::make(Size(1280, 720), cv::Size(), "Vector Graphics and Framebuffer"); |
|
|
|
|
|
|
|
#ifdef __EMSCRIPTEN__ |
|
|
|
|
|
|
|
float start = emscripten_get_now() / 1000.0f; |
|
|
|
|
|
|
|
#endif |
|
|
|
//Render the framebuffer in the native window in an endless loop
|
|
|
|
//Render the framebuffer in the native window in an endless loop
|
|
|
|
window->run([=]() { |
|
|
|
window->run([=]() { |
|
|
|
//Creates a NanoVG context and draws eyes
|
|
|
|
//Creates a NanoVG context and draws eyes
|
|
|
|
window->nvg([](const Size& sz) { |
|
|
|
window->nvg([=](const Size& sz) { |
|
|
|
//Calls from this namespace may only be used inside a nvg context
|
|
|
|
//Calls from this namespace may only be used inside a nvg context
|
|
|
|
using namespace cv::v4d::nvg; |
|
|
|
using namespace cv::v4d::nvg; |
|
|
|
clear(); |
|
|
|
clear(); |
|
|
|
|
|
|
|
|
|
|
|
float t = cv::getTickCount() / cv::getTickFrequency(); |
|
|
|
static long start = cv::getTickCount() / cv::getTickFrequency(); |
|
|
|
|
|
|
|
float t = cv::getTickCount() / cv::getTickFrequency() - start; |
|
|
|
float x = 0; |
|
|
|
float x = 0; |
|
|
|
float y = 0; |
|
|
|
float y = 0; |
|
|
|
float w = sz.width / 4; |
|
|
|
float w = sz.width / 4; |
|
|
|