Exemple #1
0
TextureID ResourceManagerImpl::new_texture_with_alias_from_file(const unicode& alias, const unicode& path, TextureFlags flags, bool garbage_collect) {
    TextureID t = new_texture_from_file(path, flags, garbage_collect);
    try {
        TextureManager::manager_store_alias(alias, t);
    } catch(...) {
        delete_texture(t);
        throw;
    }
    return t;
}
Exemple #2
0
TextureID ResourceManagerImpl::new_texture_with_alias(const unicode& alias, bool garbage_collect) {
    TextureID t = new_texture(garbage_collect);
    try {
        TextureManager::manager_store_alias(alias, t);
    } catch(...) {
        delete_texture(t);
        throw;
    }
    return t;
}
Exemple #3
0
void rows_exit(void)
{
	deregister_event("draw opaque", draw_rows);
	delete_texture(&row_texes[6]);
	delete_texture(&row_texes[5]);
	delete_texture(&row_texes[4]);
	delete_texture(&row_texes[3]);
	delete_texture(&row_texes[2]);
	delete_texture(&row_texes[1]);
	delete_texture(&row_texes[0]);
}
Exemple #4
0
void glcu::create_texture(GLuint &texture, int width, int height)
{
    // Make sure we don't already have a texture defined here
    delete_texture( texture );

    glGenTextures( 1, &texture );
    glBindTexture( GL_TEXTURE_2D, texture );

    // set basic parameters
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);

    // Create texture data (4-component unsigned byte)
    glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL );

    // Unbind the texture
    glBindTexture( GL_TEXTURE_2D, 0 );
}
Exemple #5
0
GLFluids::~GLFluids(){

    cudaGraphicsUnregisterResource(cuda_vbo_resource);

    unbind_texture();
    delete_texture();

    // Free all host and device resources
    free(hvfield);
    free(particles);
    cudaFree(dvfield);
    cudaFree(vxfield);
    cudaFree(vyfield);
    cufftDestroy(planr2c);
    cufftDestroy(planc2r);

    glBindBuffer(GL_ARRAY_BUFFER, 0);
    glDeleteBuffers(1, &vbo);

}
Exemple #6
0
void delete_font_atlas(FontAtlas* fa) {
  delete_texture(&fa->t);
}
Exemple #7
0
void bigstars_exit(void)
{
	deregister_event("draw transparent", draw_stars);
	delete_texture(&stars[1]);
	delete_texture(&stars[0]);
}