#include "qt_drawitem.h"
#include <QPixmap>
#include <QColor>
+#include <QImageReader>
CSP_LabelVirtualDevice::CSP_LabelVirtualDevice(QWidget *parent,
int width, float point,
+varying vec2 v_texcoord;
+uniform sampler2D a_texture;
uniform vec4 color;
void main ()
{
- gl_FragColor = color;
+ gl_FragColor = (texture2D (a_texture, v_texcoord) * color);
}
QColor LG = QColor(250, 0, 0, 196);
QColor FG = QColor(255, 255, 255, 196);
+#if 0
do_update_icon(0, 0, QString::fromUtf8(""), BG, FG, LG, TG, 12.0f);
if(using_flags->is_use_laser_disc()) {
do_update_icon(7, 0, QString::fromUtf8("LD"), BG, FG, LG, TG, 12.0f);
do_update_icon(5, i, tmps, W_BG, C_FG, LG, C_TG, 12.0f); // Dedicate to 3.5/5/8? and startnum.
}
}
-
+#endif
}
void GLDrawClass::setChangeBrightness(bool flag)
prg->setUniformValue("color", color);
//prg->setUniformValue("tex_width", (float)screen_texture_width);
//prg->setUniformValue("tex_height", (float)screen_texture_height);
- prg->setUniformValue("tex_width", (float)p->width());
- prg->setUniformValue("tex_height", (float)p->height());
+ if(p != NULL) {
+ prg->setUniformValue("tex_width", (float)p->width());
+ prg->setUniformValue("tex_height", (float)p->height());
+ }
if(using_flags->is_use_screen_rotate()) {
if(using_flags->get_config_ptr()->rotate_type) {
prg->setUniformValue("rotate", GL_TRUE);
void GLDraw_2_0::uploadIconTexture(QPixmap *p, int icon_type, int localnum)
{
- if((icon_type > 7) || (icon_type <= 0)) return;
+ if((icon_type > 7) || (icon_type < 0)) return;
if((localnum >= 8) || (localnum < 0)) return;
if(p == NULL) return;
p_wid->makeCurrent();
-
QImage image = p->toImage();
GLuint texid = icon_texid[icon_type][localnum];
prg->release();
extfunc->glBindTexture(GL_TEXTURE_2D, 0);
extfunc->glDisable(GL_TEXTURE_2D);
- } else {
+ }
+ else {
extfunc->glDisable(GL_TEXTURE_2D);
vp->bind();
bp->bind();
prg->release();
extfunc->glBindTexture(GL_TEXTURE_2D, 0);
extfunc->glDisable(GL_TEXTURE_2D);
- }
+ }
}
void GLDraw_3_0::drawMain(GLScreenPack *obj,
int ii;
color = QVector4D(1.0, 1.0, 1.0, 1.0);
-
if((bp != NULL) && (vp != NULL) && (prg != NULL)) {
if((bp->isCreated()) && (vp->isCreated()) && (prg->isLinked())) {
bp->bind();
}
int vertex_loc = prg->attributeLocation("vertex");
int texcoord_loc = prg->attributeLocation("texcoord");
- //prg->setAttributeBuffer(vertex_loc, GL_FLOAT, 0, 3, sizeof(VertexTexCoord_t));
- //prg->setAttributeBuffer(texcoord_loc, GL_FLOAT, 3 * sizeof(GLfloat), 2, sizeof(VertexTexCoord_t));
+ prg->setAttributeBuffer(vertex_loc, GL_FLOAT, 0, 3, sizeof(VertexTexCoord_t));
+ prg->setAttributeBuffer(texcoord_loc, GL_FLOAT, 3 * sizeof(GLfloat), 2, sizeof(VertexTexCoord_t));
prg->enableAttributeArray(vertex_loc);
prg->enableAttributeArray(texcoord_loc);
extfunc->glEnableVertexAttribArray(vertex_loc);
icon_texid[icon_type][localnum] = p_wid->bindTexture(*p);
texid = icon_texid[icon_type][localnum];
}
+ printf("TYPE=%d LOCALNUM=%d TEXID=%d\n", icon_type, localnum, texid);
{
// Upload to main texture
extfunc->glBindTexture(GL_TEXTURE_2D, texid);