if (tex.getType() == Type.TwoDimensional) { GL30C.glFramebufferTexture2D(GL30C.GL_FRAMEBUFFER, GL30C.GL_COLOR_ATTACHMENT0 + colorsAdded, GL11C.GL_TEXTURE_2D, tex.getTextureIdForContext(context), tex.getTexRenderMipLevel()); } else if (tex.getType() == Type.CubeMap) { GL30C.glFramebufferTexture2D(GL30C.GL_FRAMEBUFFER, GL30C.GL_COLOR_ATTACHMENT0 + colorsAdded, Lwjgl3TextureStateUtil.getGLCubeMapFace(((TextureCubeMap) tex).getCurrentRTTFace()), tex.getTextureIdForContext(context), tex.getTexRenderMipLevel()); } else { throw new IllegalArgumentException("Invalid texture type: " + tex.getType()); GL11C.GL_TEXTURE_2D, tex.getTextureIdForContext(context), tex.getTexRenderMipLevel()); } else if (tex.getType() == Type.CubeMap) { GL30C.glFramebufferTexture2D(GL30C.GL_FRAMEBUFFER, GL30C.GL_DEPTH_ATTACHMENT, Lwjgl3TextureStateUtil.getGLCubeMapFace(((TextureCubeMap) tex).getCurrentRTTFace()), tex.getTextureIdForContext(context), tex.getTexRenderMipLevel()); } else { throw new IllegalArgumentException("Invalid texture type: " + tex.getType());
int textureId = texture != null ? texture.getTextureIdForContext(context) : 0; textureId = texture.getTextureIdForContext(context); if (textureId == 0) { continue; textureId = texture.getTextureIdForContext(context); if (textureId == 0) { continue;
if (tex.getType() == Type.TwoDimensional) { gl.glFramebufferTexture2D(GL.GL_FRAMEBUFFER, GL.GL_COLOR_ATTACHMENT0 + colorsAdded, GL.GL_TEXTURE_2D, tex.getTextureIdForContext(context.getGlContextRep()), 0); } else if (tex.getType() == Type.CubeMap) { gl.glFramebufferTexture2D(GL.GL_FRAMEBUFFER, GL.GL_COLOR_ATTACHMENT0 + colorsAdded, JoglTextureStateUtil.getGLCubeMapFace(((TextureCubeMap) tex).getCurrentRTTFace()), tex.getTextureIdForContext(context.getGlContextRep()), 0); } else { throw new IllegalArgumentException("Invalid texture type: " + tex.getType()); tex.getTextureIdForContext(context.getGlContextRep()), 0); } else if (tex.getType() == Type.CubeMap) { gl.glFramebufferTexture2D(GL.GL_FRAMEBUFFER, GL.GL_DEPTH_ATTACHMENT, JoglTextureStateUtil.getGLCubeMapFace(((TextureCubeMap) tex).getCurrentRTTFace()), tex.getTextureIdForContext(context.getGlContextRep()), 0); } else { throw new IllegalArgumentException("Invalid texture type: " + tex.getType());
TextureManager.addToCache(texture); } else { final int textureId = cached.getTextureIdForContext(context); if (textureId != 0) { doTextureBind(cached, unit, false);
/** * Useful for external lwjgl based classes that need to safely set the current texture. */ public static void doTextureBind(final Texture texture, final int unit, final boolean invalidateState) { // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final ContextCapabilities caps = context.getCapabilities(); final TextureStateRecord record = (TextureStateRecord) context.getStateRecord(StateType.Texture); if (invalidateState) { // Set this to null because no current state really matches anymore context.setCurrentState(StateType.Texture, null); } checkAndSetUnit(unit, record, caps); final int id = texture.getTextureIdForContext(context); GL11C.glBindTexture(getGLType(texture.getType()), id); if (Constants.stats) { StatCollector.addStat(StatType.STAT_TEXTURE_BINDS, 1); } if (record != null) { record.units[unit].boundTexture = id; } }
TextureManager.addToCache(texture); } else { final int textureId = cached.getTextureIdForContext(context.getGlContextRep()); if (textureId != 0) { doTextureBind(cached, unit, false);
/** * Useful for external lwjgl based classes that need to safely set the current texture. */ public static void doTextureBind(final Texture texture, final int unit, final boolean invalidateState) { // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final ContextCapabilities caps = context.getCapabilities(); final TextureStateRecord record = (TextureStateRecord) context.getStateRecord(StateType.Texture); if (invalidateState) { // Set this to null because no current state really matches anymore context.setCurrentState(StateType.Texture, null); } checkAndSetUnit(unit, record, caps); final int id = texture.getTextureIdForContext(context.getGlContextRep()); GL11.glBindTexture(getGLType(texture.getType()), id); if (Constants.stats) { StatCollector.addStat(StatType.STAT_TEXTURE_BINDS, 1); } if (record != null) { record.units[unit].boundTexture = id; } }
/** * Useful for external jogl based classes that need to safely set the current texture. */ public static void doTextureBind(final Texture texture, final int unit, final boolean invalidateState) { final GL gl = GLContext.getCurrentGL(); // ask for the current state record final RenderContext context = ContextManager.getCurrentContext(); final ContextCapabilities caps = context.getCapabilities(); final TextureStateRecord record = (TextureStateRecord) context.getStateRecord(StateType.Texture); if (invalidateState) { // Set this to null because no current state really matches anymore context.setCurrentState(StateType.Texture, null); } checkAndSetUnit(unit, record, caps); final int id = texture.getTextureIdForContext(context.getGlContextRep()); gl.glBindTexture(getGLType(texture.getType()), id); if (Constants.stats) { StatCollector.addStat(StatType.STAT_TEXTURE_BINDS, 1); } if (record != null) { record.units[unit].boundTexture = id; } }
TextureManager.addToCache(texture); } else { final int textureId = cached.getTextureIdForContext(context.getGlContextRep()); if (textureId != 0) { doTextureBind(cached, unit, false);
} else if (tex.getTextureIdForContext(context.getGlContextRep()) != 0) { throw new Ardor3dException("Texture is already setup and has id.");
} else if (tex.getTextureIdForContext(context.getGlContextRep()) != 0) { throw new Ardor3dException("Texture is already setup and has id.");
@Override protected void setupForSingleTexDraw(final Texture tex) { final RenderContext context = ContextManager.getCurrentContext(); final int textureId = tex.getTextureIdForContext(context.getGlContextRep());
final int textureId = tex.getTextureIdForContext(context.getGlContextRep());
} else if (tex.getTextureIdForContext(context) != 0) { throw new Ardor3dException("Texture is already setup and has id.");
@Override protected void setupForSingleTexDraw(final Texture tex) { final RenderContext context = ContextManager.getCurrentContext(); final int textureId = tex.getTextureIdForContext(context);
} else if (tex.getTextureIdForContext(context.getGlContextRep()) != 0) { throw new Ardor3dException("Texture is already setup and has id.");
} else if (tex.getTextureIdForContext(context.getGlContextRep()) != 0) { throw new Ardor3dException("Texture is already setup and has id.");
if (destination.getTextureIdForContext(ContextManager.getCurrentContext().getGlContextRep()) == 0) { logger.warning("Attempting to update a texture that is not currently on the card."); return;
if (destination.getTextureIdForContext(ContextManager.getCurrentContext()) == 0) { logger.warning("Attempting to update a texture that is not currently on the card."); return;
if (destination.getTextureIdForContext(ContextManager.getCurrentContext().getGlContextRep()) == 0) { logger.warning("Attempting to update a texture that is not currently on the card."); return;