private Texture getTexture(GL gl, String file) { if (file != null) { return textureCacheService.getTexture(gl, file); } return textureCacheService.getTexture(gl, "/textures/undefined.png"); }
texture = textureCacheService.getTexture(gl, TextureCacheService.TEXTURES_UNDEFINED_PNG); texture = textureCacheService.getTexture(gl, textName);
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);
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); }
double maxy = miny + size; Texture texture = textureCacheService.getTexture(gl, icon); if (texture == null) { return;