@Provides @Singleton TextureCacheService provideTextureCacheService() { ResourceService resourceService = new LocalResourceReciver(); TextureCacheServiceImpl service = new TextureCacheServiceImpl(); service.setFileUrlReciverService(resourceService); return service; }
@Provides @Singleton TextureCacheService provideTextureCacheService(ResourceService pUrlReciverService) { TextureCacheServiceImpl textureCacheService = new TextureCacheServiceImpl(); textureCacheService.setFileUrlReciverService(pUrlReciverService); textureCacheService.addTextureBuilder(new ColorTextureBuilder()); textureCacheService.addTextureBuilder(new BwFileTextureBuilder(pUrlReciverService)); return textureCacheService; }
/** * {@inheritDoc} * * @see kendzi.buildings.example.BaseJoglFrame#init(com.jogamp.opengl.GLAutoDrawable) */ @Override public void init(GLAutoDrawable drawable) { super.init(drawable); /* * This is required only for textures file finding. Renderer use it to * load files with textures. If textures are not used but only colored * materials it is not required. */ ResourceService resourceService = new LocalResourceReciver(); // cache for textures files. TextureCacheServiceImpl textureCacheService = new TextureCacheServiceImpl(); textureCacheService.setFilter(true); // Manual injection of dependencies. textureCacheService.setFileUrlReciverService(resourceService); textureLibraryStorageService = new TextureLibraryService(resourceService); // Set up of my model renderer to display my model modelRender = new ModelRender(); // Manual injection of dependencies. modelRender.setTextureCacheService(textureCacheService); // Create model mesh. model = createRoofModel(); }