Ejemplo n.º 1
0
ShaderProgram::ShaderProgram(const char* vertex_file_path, const char* fragment_file_path, const char* geometry_file_path) 
	: shader_program_(0) {
		if ( vertex_file_path ) {
			shaders_.push_back( ShaderInfo(vertex_file_path, GL_VERTEX_SHADER) );
		}
		if ( fragment_file_path ) {
			shaders_.push_back( ShaderInfo(fragment_file_path, GL_FRAGMENT_SHADER) );
		}
		if ( geometry_file_path ) {
			shaders_.push_back( ShaderInfo(geometry_file_path, GL_GEOMETRY_SHADER) );
		}
}
Ejemplo n.º 2
0
ShaderInfo ShaderSource::getShaderInfo(u32 id)
{
	MutexAutoLock lock(m_shaderinfo_cache_mutex);

	if(id >= m_shaderinfo_cache.size())
		return ShaderInfo();

	return m_shaderinfo_cache[id];
}
Ejemplo n.º 3
0
ShaderSource::ShaderSource(IrrlichtDevice *device):
		m_device(device)
{
	assert(m_device); // Pre-condition

	m_main_thread = thr_get_current_thread_id();

	// Add a dummy ShaderInfo as the first index, named ""
	m_shaderinfo_cache.push_back(ShaderInfo());

	// Add main global constant setter
	addShaderConstantSetterFactory(new MainShaderConstantSetterFactory());
}
Ejemplo n.º 4
0
ShaderSource::ShaderSource(IrrlichtDevice *device):
		m_device(device)
{
	assert(m_device); // Pre-condition

	m_shader_callback = new ShaderCallback(this, "default");

	m_main_thread = get_current_thread_id();

	// Add a dummy ShaderInfo as the first index, named ""
	m_shaderinfo_cache.push_back(ShaderInfo());

	// Add main global constant setter
	addGlobalConstantSetter(new MainShaderConstantSetter(device));
}