vigs_vector_resize(&gl_backend->dpy_v2, 0);
for (i = 0; i < mt_count; i++) {
- GLfloat w = (GLfloat)gl_backend->mt_tex_width *
- ((GLfloat)gl_backend->dpy_tex_width / (GLfloat)qt5_window_width);
- GLfloat h = (GLfloat)gl_backend->mt_tex_height *
- ((GLfloat)gl_backend->dpy_tex_height / (GLfloat)qt5_window_height);
+ GLfloat w = (GLfloat)gl_backend->mt_tex_width;
+ GLfloat h = (GLfloat)gl_backend->mt_tex_height;
GLfloat x = qt5_mt_points[2 * i + 0] - w / 2;
- GLfloat y = gl_backend->dpy_tex_height - qt5_mt_points[2 * i + 1] - h / 2;
+ GLfloat y = qt5_window_height - qt5_mt_points[2 * i + 1] - h / 2;
vert_coords = vigs_vector_append(&gl_backend->dpy_v1,
(12 * sizeof(GLfloat)));
}
if (mt_count) {
+ vigs_gl_create_ortho(0.0f, qt5_window_width,
+ 0.0f, qt5_window_height,
+ -1.0f, 1.0f,
+ gl_backend->mt_tex_ortho);
+
gl_backend->Enable(GL_BLEND);
gl_backend->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- if (scale) {
- vigs_gl_draw_dpy_scale_prog(gl_backend, mt_count * 6);
- } else {
- vigs_gl_draw_dpy_tex_prog(gl_backend, mt_count * 6);
- }
+ gl_backend->UseProgram(gl_backend->dpy_tex_prog_id);
+ gl_backend->UniformMatrix4fv(gl_backend->dpy_tex_prog_proj_loc, 1, GL_FALSE,
+ gl_backend->mt_tex_ortho);
+ gl_backend->Uniform1f(gl_backend->dpy_tex_prog_brightness_loc, 1.0f);
+
+ vigs_gl_draw_dpy_tex_prog(gl_backend, mt_count * 6);
gl_backend->Disable(GL_BLEND);
}
this->hostPos = hostPos;
this->guestPos = guestPos;
- qt5_mt_points[2 * (this->id - 1) + 0] = guestPos.x();
- qt5_mt_points[2 * (this->id - 1) + 1] = guestPos.y();
+ qt5_mt_points[2 * (this->id - 1) + 0] = hostPos.x();
+ qt5_mt_points[2 * (this->id - 1) + 1] = hostPos.y();
qt5_graphic_hw_invalidate();
}
painter.setPen(QColor(255, 255, 255, 255));
painter.setBrush(QBrush(QColor(128, 128, 128, 128)));
painter.setRenderHint(QPainter::Antialiasing, true);
- painter.drawEllipse(0, 0, 31, 31);
+ painter.drawEllipse(1, 1, 30, 30);
qt5_mt_points = new float[2 * maxTouchPoint]();
qt5_mt_count = 0;
touchPointList.append(point);
qDebug() << "ID" << point->getID() << "point touching" << hostPos << guestPos;
- qt5_mt_points[2 * qt5_mt_count + 0] = guestPos.x();
- qt5_mt_points[2 * qt5_mt_count + 1] = guestPos.y();
+ qt5_mt_points[2 * qt5_mt_count + 0] = hostPos.x();
+ qt5_mt_points[2 * qt5_mt_count + 1] = hostPos.y();
qt5_mt_count++;
qt5_graphic_hw_invalidate();