void LoadFBxLibraries()
{
	// Specify global memory handler callbacks to be used by the FBX SDK
	FbxSetMallocHandler(	&MyMalloc);
	FbxSetCallocHandler(	&MyCalloc);
	FbxSetReallocHandler(	&MyRealloc);
	FbxSetFreeHandler(		&MyFree);
}
void UnloadFBxLibraries()
{
	UnFbx::FFbxImporter::DeleteInstance();
	UnFbx::FFbxExporter::DeleteInstance();

	// Hack: After we have freed our fbx sdk instance we need to set back to the default fbx memory handlers. 
	// This is required because there are some allocations made in the FBX dllmain before it is possible to set up our custom allocators
	// If this is not done, memory created by one allocator will be freed by another
	FbxSetMallocHandler(	FbxGetDefaultMallocHandler() );
	FbxSetCallocHandler(	FbxGetDefaultCallocHandler() );
	FbxSetReallocHandler(	FbxGetDefaultReallocHandler() );
	FbxSetFreeHandler(		FbxGetDefaultFreeHandler() );
}
Exemple #3
0
int main(int argc, char **argv) {

	// Use a custom memory allocator
	FbxSetMallocHandler(MyMemoryAllocator::MyMalloc);
	FbxSetReallocHandler(MyMemoryAllocator::MyRealloc);
	FbxSetFreeHandler(MyMemoryAllocator::MyFree);
	FbxSetCallocHandler(MyMemoryAllocator::MyCalloc);

	// init GLUT and create window
	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
	glutInitWindowPosition(100,100);
	glutInitWindowSize(800,600);
	glutCreateWindow("FBX Loading");

	// Initialize OpenGL.
	const bool lSupportVBO = InitializeOpenGL();

//	FbxString lFilePath("zombii.FBX");
//	FbxString lFilePath("soldier.FBX");
	FbxString lFilePath("Anteater_FBX.fbx");
//    FbxString lFilePath("Turtle_FBX.fbx");
    
	gSceneContext = new FBXLoader(lFilePath, 800, 600);

	init();
	// register callbacks
	glutDisplayFunc(renderScene);
	glutReshapeFunc(changeSize);
	glutIdleFunc(renderScene);

	glutIgnoreKeyRepeat(1);
	glutKeyboardFunc(processNormalKeys);
	glutSpecialFunc(pressKey);
	glutSpecialUpFunc(releaseKey);

	// here are the two new functions
	glutMouseFunc(mouseButton);
	glutMotionFunc(mouseMove);

	// OpenGL init
	glEnable(GL_DEPTH_TEST);

	// enter GLUT event processing cycle
	glutMainLoop();

	return 1;
}
void LoadFBxLibraries()
{
#define FBX_DELAY_LOAD 0
#if PLATFORM_WINDOWS && _MSC_VER == 1700 && FBX_DELAY_LOAD
#if PLATFORM_64BITS
    FString RootFBxPath = FPaths::EngineDir() / TEXT("Binaries/ThirdParty/FBx/Win64/");
    FBxHandle = LoadLibraryW(*(RootFBxPath + "libfbxsdk.dll"));
#else
    static_assert(false, TEXT("FBX importing currently not supported in 32 bit versions"));
#endif // PLATFORM_64BITS
#endif // PLATFORM_WINDOWS && _MSC_VER == 1700

    // Specify global memory handler callbacks to be used by the FBX SDK
    FbxSetMallocHandler(	&MyMalloc);
    FbxSetCallocHandler(	&MyCalloc);
    FbxSetReallocHandler(	&MyRealloc);
    FbxSetFreeHandler(		&MyFree);

}