private Texture getTexture(GL gl, String file) { if (file != null) { return textureCacheService.getTexture(gl, file); } return textureCacheService.getTexture(gl, "/textures/undefined.png"); }
/** * @param pEnable * enable filter */ private void setTextureFilter(boolean pEnable) { if (textureCacheService instanceof TextureCacheServiceImpl) { ((TextureCacheServiceImpl) textureCacheService).setTextureFilter(pEnable); textureCacheService.clear(); } else { throw new RuntimeException("unsupported textureCacheService"); } } }
if (!textureCacheService.isTexture(textName)) { if (titleFrameCount == 0) { texture = textureCacheService.getTexture(gl, TextureCacheService.TEXTURES_UNDEFINED_PNG); texture = textureCacheService.getTexture(gl, textName);
BufferedImage image = this.textureCacheService.getImage(textureKey); if (image != null) { File textureFile = new File(parent, exporter.getTextureKeys().get(textureKey));
TextureCoords tc = new TextureCoords(0, 0, 1, 1); if (textureName != null) { Texture texture = textureCacheService.getTexture(gl, textureName); Texture t = textureCacheService.getTexture(gl, textureName); if (t != null) { t.disable(gl);
@Override protected void onOpenWindow() { dataConsumersMonitor.addDataConsumer(); /* * OpenGl context is stored per window, if we open new one we need to * clean up old textures. */ textureCacheService.clear(); /* * Data updates ware turn off after window closes. We need to rebuild * whole dataset. */ dataEventListener.add(new NewDataEvent()); }
public void draw(GL2 gl, Point3d cameraPosition) { gl.glEnable(GL2.GL_LIGHTING); gl.glEnable(GL2.GL_TEXTURE_2D); TextureData td = this.textureLibraryStorageService.getTextureDefault("ground.unknown"); Texture texture = this.textureCacheService.getTexture(gl, td.getTex0()); texture.enable(gl); texture.bind(gl); gl.glBegin(GL2.GL_POLYGON); gl.glColor3f((float) 123 / 256, (float) 111 / 256, (float) 100 / 255); double groundSize = 1500.0; Point3d c = cameraPosition; // gl.glTexCoord2d(tc.left(), tc.bottom()); double xRight = c.x + groundSize; double xLeft = c.x - groundSize; double zButtom = c.z + groundSize; double zTop = c.z - groundSize; gl.glNormal3d(0, 1, 0); gl.glTexCoord2d(xRight * td.getWidth(), zButtom * td.getHeight()); gl.glVertex3d(xRight, -0.01, zButtom); gl.glTexCoord2d(xLeft * td.getWidth(), zButtom * td.getHeight()); gl.glVertex3d(xLeft, -0.01, zButtom); gl.glTexCoord2d(xLeft * td.getWidth(), zTop * td.getHeight()); gl.glVertex3d(xLeft, -0.01, zTop); gl.glTexCoord2d(xRight * td.getWidth(), zTop * td.getHeight()); gl.glVertex3d(xRight, -0.01, zTop); gl.glEnd(); texture.disable(gl); gl.glDisable(GL2.GL_TEXTURE_2D); }
@Override public void actionPerformed(ActionEvent pE) { modelsLibraryService.clear(); textureLibraryStorageService.reload(); textureCacheService.clear(); modelCacheService.clear(); modelsLibraryLayer.cleanUp(); } }
double maxy = miny + size; Texture texture = textureCacheService.getTexture(gl, icon); if (texture == null) { return;
this.textureCacheService.clear(); this.metadataCacheService.clear(); this.textureLibraryStorageService.reload();