pull/3471/head
kallaballa 2 years ago
parent 265e241b35
commit e782a9d343
  1. 13
      modules/v4d/samples/cube-demo.cpp
  2. 9
      modules/v4d/samples/video-demo.cpp

@ -6,7 +6,7 @@
#include <opencv2/v4d/v4d.hpp>
//adapted from https://gitlab.com/wikibooks-opengl/modern-tutorials/-/blob/master/tut05_cube/cube.cpp
//Demo Parameters
//** Demo Parameters **/
constexpr long unsigned int WIDTH = 1280;
constexpr long unsigned int HEIGHT = 720;
constexpr bool OFFSCREEN = false;
@ -20,7 +20,7 @@ const int GLOW_KERNEL_SIZE = std::max(int(DIAG / 138 % 2 == 0 ? DIAG / 138 + 1 :
using std::cerr;
using std::endl;
//OpenGL constants and variables
/** OpenGL constants and variables **/
const unsigned int triangles = 12;
const unsigned int vertices_index = 0;
const unsigned int colors_index = 1;
@ -28,12 +28,12 @@ unsigned int shader_program;
unsigned int vao;
unsigned int uniform_transform;
//The centrals V4D objects
//The central V4D object
cv::Ptr<cv::v4d::V4D> window;
//Simple transform and pass-through shaders
//Simple transform & pass-through shaders
static GLuint load_shader() {
//Shader version 330 and 300 es is very similar.
//Shader versions "330" and "300 es" are very similar.
//If you are careful you can write the same code for both versions.
#if !defined(__EMSCRIPTEN__) && !defined(OPENCV_V4D_USE_ES3)
const string shaderVersion = "330";
@ -232,9 +232,6 @@ static bool iteration() {
});
#endif
//Ignored in WebAssmebly builds because there is no sink set.
window->write();
return window->display();
}

@ -11,6 +11,10 @@
#include <opencv2/v4d/v4d.hpp>
using std::cerr;
using std::endl;
/** Demo parameters **/
constexpr long unsigned int WIDTH = 1280;
constexpr long unsigned int HEIGHT = 720;
constexpr bool OFFSCREEN = false;
@ -21,9 +25,7 @@ constexpr double FPS = 60;
constexpr const char* OUTPUT_FILENAME = "video-demo.mkv";
#endif
using std::cerr;
using std::endl;
/**OpenGL contants and variables **/
const unsigned int triangles = 12;
const unsigned int vertices_index = 0;
const unsigned int colors_index = 1;
@ -197,6 +199,7 @@ static bool iteration() {
});
#endif
//Ignored in WebAssmebly builds because there is no sink set.
window->write();
return window->display();

Loading…
Cancel
Save