Пример #1
0
void EMIModel::draw() {
	prepareForRender();
	// We will need to add a call to the skeleton, to get the modified vertices, but for now,
	// I'll be happy with just static drawing
	for (uint32 i = 0; i < _numFaces; i++) {
		setTex(_faces[i]._texID);
		g_driver->drawEMIModelFace(this, &_faces[i]);
	}
}
Пример #2
0
void CTexture2D::setSize(GLuint p_width, GLuint p_height){
	if(p_width > GL_MAX_TEXTURE_SIZE || p_height > GL_MAX_TEXTURE_SIZE)
		pLog::logE(this, pLog::ERROR_NONE, "GL_MAX_TEXTURE_SIZE");

	if(p_width != m_width || p_height != m_height){
		m_width = p_width;
		m_height = p_height;
		setTex();
	}
}
Пример #3
0
void VideoNode::updateGeometry(const PaintAreas & areas)
{
    QSGGeometry *g = geometry();

    if (m_materialType == MaterialTypeVideo) {
        if (!m_validGeometry)
            g = new QSGGeometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4);

        QSGGeometry::TexturedPoint2D *v = g->vertexDataAsTexturedPoint2D();

        // Set geometry first
        setGeom(v + 0, areas.videoArea.topLeft());
        setGeom(v + 1, areas.videoArea.bottomLeft());
        setGeom(v + 2, areas.videoArea.topRight());
        setGeom(v + 3, areas.videoArea.bottomRight());

        // and then texture coordinates
        setTex(v + 0, areas.sourceRect.topLeft());
        setTex(v + 1, areas.sourceRect.bottomLeft());
        setTex(v + 2, areas.sourceRect.topRight());
        setTex(v + 3, areas.sourceRect.bottomRight());
    } else {
        if (!m_validGeometry)
            g = new QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), 4);

        QSGGeometry::Point2D *v = g->vertexDataAsPoint2D();

        setGeom(v + 0, areas.videoArea.topLeft());
        setGeom(v + 1, areas.videoArea.bottomLeft());
        setGeom(v + 2, areas.videoArea.topRight());
        setGeom(v + 3, areas.videoArea.bottomRight());
    }

    if (!m_validGeometry) {
        setGeometry(g);
        m_validGeometry = true;
    }

    markDirty(DirtyGeometry);
}
Пример #4
0
Particles::Particles(float xpos, float ypos, float zpos, float rr, float gg, float bb, float rotate){
	tools = new Tools();
	pt_texture = tools->GetBmp(L"fire.bmp");
	x = xpos;
	y = ypos;
	z = zpos;
	r = rr;
	g = gg;
	b = bb;
	protate = rotate + 180;
	init_pars();
	setTex();
}
Пример #5
0
Particles::Particles(){
	tools = new Tools();
	pt_texture = tools->GetBmp(L"fire.bmp");
	x = 0;
	y = 0;
	z = 0;
	r = 0;
	g = 0;
	b = 0;
	protate = 0;
	init_pars();
	setTex();
}
Пример #6
0
void CTexture2D::appendImg(const QString& p_filename){
	QImage img;

	if( ! img.load(p_filename) ) qDebug() << "error loading texture " + p_filename ;

	m_image = QGLWidget::convertToGLFormat(img);
	if( m_image.isNull() ) qDebug() << "error GL_formatted_image" ;

	m_width = m_image.width();
	m_height = m_image.height();
	m_internalFormat = GL_RGBA;
	m_format = GL_RGBA;
	m_type = GL_UNSIGNED_BYTE;
	m_data = m_image.bits();
	setTex();
}
Пример #7
0
void CTexture3D::setDepth(int p_d){
	m_depth = p_d;
	setTex();
}
Пример #8
0
void CTexture3D::setHeight(int p_h){
	m_height = p_h;
	setTex();
}
Пример #9
0
void CTexture3D::setWidth(int p_w){
	m_width = p_w;
	setTex();
}