Esempio n. 1
0
void PictureResource::load(byte *source, int size) {
	if (READ_BE_UINT32(source) == MKTAG('F','l','e','x')) {
		loadChunked(source, size);
	} else {
		loadRaw(source, size);
	}
}
Esempio n. 2
0
bool Texture::load(FS::IFile& file)
{
	PROFILE_FUNCTION();

	const char* path = getPath().c_str();
	size_t len = getPath().length();
	bool loaded = false;
	if (len > 3 && compareString(path + len - 4, ".dds") == 0)
	{
		loaded = loadDDS(file);
	}
	else if (len > 3 && compareString(path + len - 4, ".raw") == 0)
	{
		loaded = loadRaw(file);
	}
	else
	{
		loaded = loadTGA(file);
	}
	if (!loaded)
	{
		g_log_warning.log("Renderer") << "Error loading texture " << path;
		return false;
	}

	m_size = file.size();
	return true;
}
Esempio n. 3
0
 void makeBuffer(GLuint bufferName, const std::string &filePath){
     std::vector<float> values = loadRaw(filePath);
     float data[values.size()];
     std::copy(values.begin(), values.end(), data);
     glBindBuffer(GL_ARRAY_BUFFER, bufferName);
     glBufferData(GL_ARRAY_BUFFER, sizeof(data), data, GL_STATIC_DRAW);
 }
Esempio n. 4
0
void testApp::update() {
	if(reloadImage) {		
		curKinect = loadRaw(kinectList.getPath(curImage), 640, 480);
//		curKinect.loadRaw(kinectList.getPath(curImage), 640, 480);	

		kinectCalibration.undistort(toCv(curKinect));
		updatePointCloud();
		
		curColor.loadImage(colorList.getPath(curImage));
		curColor.update();
		updateColors();
		
		reloadImage = false;
	}	
}
Esempio n. 5
0
int main( int argc, char** argv )
{
	char rawFile[]="head.raw";
	loadRaw(rawFile);

//	cvNamedWindow( "6dofHead", 1 );
	ehciInit();
	atexit(ehciExit);
	openGLCustomInit(argc,argv,320.0, 240.0);


	//cvDestroyWindow("6dofHead");

	return 0;
}
Esempio n. 6
0
void Texture::loaded(FS::IFile& file, bool success, FS::FileSystem& fs)
{
	PROFILE_FUNCTION();
	if (success)
	{
		const char* path = m_path.c_str();
		size_t len = m_path.length();
		bool loaded = false;
		if (len > 3 && strcmp(path + len - 4, ".dds") == 0)
		{
			loaded = loadDDS(file);
		}
		else if (len > 3 && strcmp(path + len - 4, ".raw") == 0)
		{
			loaded = loadRaw(file);
		}
		else
		{
			loaded = loadTGA(file);
		}
		if (!loaded)
		{
			g_log_warning.log("renderer") << "Error loading texture "
										  << m_path.c_str();
			onFailure();
		}
		else
		{
			m_size = file.size();
			decrementDepCount();
		}
	}
	else
	{
		g_log_warning.log("renderer") << "Error loading texture "
									  << m_path.c_str();
		onFailure();
	}
}