Beispiel #1
0
void TF3D::prepare_char(wchar_t chr)
{
	if (!m_vbo[chr]) {
		font_prepare_chr(font, chr, 1);
		free_shape(&font->cshape[chr]);
		m_vbo[chr] = genBuffers(chr, font->cedges[chr]);
	}
}
Beispiel #2
0
/* reload OpenGL resources */
void TF3D::reloadGL()
{
	std::map<wchar_t,GLuint*>::iterator iter;
	for (iter = m_vbo.begin(); iter != m_vbo.end(); ++iter) {
		wchar_t	chr = iter->first;
		// VBOs were already freed when the GL context was destroyed!
		//glDeleteBuffers(NUM_VBO, iter->second);
		delete iter->second;
		iter->second = NULL;
		iter->second = genBuffers(chr, font->cedges[chr]);
	}
}
Beispiel #3
0
PointBuffer::PointBuffer(const QGLContext *context)
    : GLBufferExtension(context), m_glBuffer(0), m_dirty(true),
      m_cloudTexture(0)
{
    genBuffers(1, &m_glBuffer);
    QImage img;
    bool loaded = img.load("cloud.png");
    if (loaded)
        m_cloudTexture = const_cast<QGLContext *>(context)->bindTexture(img);
    else
        qFatal("Failed to load cloud.png texture");
}
Beispiel #4
0
Skybox::Skybox( const char* top, const char* bottom, const char* left, const char* right, const char* front, const char* back )
{
	sides[SKY_LEFT].loadFromFile(left); // x negativo
	sides[SKY_RIGHT].loadFromFile(right); // x positivo
	sides[SKY_BOTTOM].loadFromFile(bottom); // y negativo
	sides[SKY_TOP].loadFromFile(top); // y positivo
	sides[SKY_BACK].loadFromFile(back); // z negativo
	sides[SKY_FRONT].loadFromFile(front);	// z positivo

	// Crea las texturas OpenGL
	genTextures();
	// Inicializa el shader
	initShader();
	// Crea y genera los buffers de vertices
	genBuffers();
}
bool Cc3dIndexVBO3d::init(){
    genBuffers();
    return true;
}