Package com.ardor3d.renderer

Examples of com.ardor3d.renderer.RenderContext


    @Override
    public void setupPointParameters(final float pointSize, final boolean antialiased, final boolean isSprite,
            final boolean useDistanceAttenuation, final FloatBuffer attenuationCoefficients, final float minPointSize,
            final float maxPointSize) {
        final RenderContext context = ContextManager.getCurrentContext();

        // TODO: make a record for point states
        GL11.glPointSize(pointSize);

        if (isSprite && context.getCapabilities().isPointSpritesSupported()) {
            GL11.glEnable(ARBPointSprite.GL_POINT_SPRITE_ARB);
            GL11.glTexEnvi(ARBPointSprite.GL_POINT_SPRITE_ARB, ARBPointSprite.GL_COORD_REPLACE_ARB, GL11.GL_TRUE);
        }

        if (useDistanceAttenuation && context.getCapabilities().isPointParametersSupported()) {
            ARBPointParameters.glPointParameterARB(ARBPointParameters.GL_POINT_DISTANCE_ATTENUATION_ARB,
                    attenuationCoefficients);
            ARBPointParameters.glPointParameterfARB(ARBPointParameters.GL_POINT_SIZE_MIN_ARB, minPointSize);
            ARBPointParameters.glPointParameterfARB(ARBPointParameters.GL_POINT_SIZE_MAX_ARB, maxPointSize);
        }
View Full Code Here


    public void renderDisplayList(final int displayListID) {
        GL11.glCallList(displayListID);
    }

    public void clearClips() {
        final RenderContext context = ContextManager.getCurrentContext();
        final RendererRecord record = context.getRendererRecord();
        record.getScissorClips().clear();

        LwjglRendererUtil.applyScissors(record);
    }
View Full Code Here

        LwjglRendererUtil.applyScissors(record);
    }

    public void popClip() {
        final RenderContext context = ContextManager.getCurrentContext();
        final RendererRecord record = context.getRendererRecord();
        record.getScissorClips().pop();

        LwjglRendererUtil.applyScissors(record);
    }
View Full Code Here

        LwjglRendererUtil.applyScissors(record);
    }

    public void pushClip(final ReadOnlyRectangle2 rectangle) {
        final RenderContext context = ContextManager.getCurrentContext();
        final RendererRecord record = context.getRendererRecord();
        record.getScissorClips().push(rectangle);

        LwjglRendererUtil.applyScissors(record);
    }
View Full Code Here

        LwjglRendererUtil.applyScissors(record);
    }

    public void pushEmptyClip() {
        final RenderContext context = ContextManager.getCurrentContext();
        final RendererRecord record = context.getRendererRecord();
        record.getScissorClips().push(null);

        LwjglRendererUtil.applyScissors(record);
    }
View Full Code Here

        LwjglRendererUtil.applyScissors(record);
    }

    public void setClipTestEnabled(final boolean enabled) {
        final RenderContext context = ContextManager.getCurrentContext();
        final RendererRecord record = context.getRendererRecord();

        LwjglRendererUtil.setClippingEnabled(record, enabled);
    }
View Full Code Here

public abstract class LwjglFogStateUtil {

    public static void apply(final FogState state) {
        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final FogStateRecord record = (FogStateRecord) context.getStateRecord(StateType.Fog);
        context.setCurrentState(StateType.Fog, state);

        if (state.isEnabled()) {
            enableFog(true, record);

            if (record.isValid()) {
                if (record.fogStart != state.getStart()) {
                    GL11.glFogf(GL11.GL_FOG_START, state.getStart());
                    record.fogStart = state.getStart();
                }
                if (record.fogEnd != state.getEnd()) {
                    GL11.glFogf(GL11.GL_FOG_END, state.getEnd());
                    record.fogEnd = state.getEnd();
                }
                if (record.density != state.getDensity()) {
                    GL11.glFogf(GL11.GL_FOG_DENSITY, state.getDensity());
                    record.density = state.getDensity();
                }
            } else {
                GL11.glFogf(GL11.GL_FOG_START, state.getStart());
                record.fogStart = state.getStart();
                GL11.glFogf(GL11.GL_FOG_END, state.getEnd());
                record.fogEnd = state.getEnd();
                GL11.glFogf(GL11.GL_FOG_DENSITY, state.getDensity());
                record.density = state.getDensity();
            }

            final ReadOnlyColorRGBA fogColor = state.getColor();
            applyFogColor(fogColor, record);
            applyFogMode(state.getDensityFunction(), record);
            applyFogHint(state.getQuality(), record);
            applyFogSource(state.getSource(), record, context.getCapabilities());
        } else {
            enableFog(false, record);
        }

        if (!record.isValid()) {
View Full Code Here

public abstract class LwjglCullStateUtil {

    public static void apply(final CullState state) {
        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final CullStateRecord record = (CullStateRecord) context.getStateRecord(StateType.Cull);
        context.setCurrentState(StateType.Cull, state);

        if (state.isEnabled()) {
            final Face useCullMode = state.getCullFace();

            switch (useCullMode) {
View Full Code Here

     * before attempting to enable this program.
     *
     * @see com.ardor3d.renderer.state.RenderState#apply()
     */
    public static void apply(final VertexProgramState state) {
        final RenderContext context = ContextManager.getCurrentContext();
        if (context.getCapabilities().isVertexProgramSupported()) {
            // ask for the current state record
            final VertexProgramStateRecord record = (VertexProgramStateRecord) context
                    .getStateRecord(StateType.VertexProgram);
            context.setCurrentState(StateType.VertexProgram, state);

            if (!record.isValid() || record.getReference() != state) {
                record.setReference(state);
                if (state.isEnabled()) {
                    // Vertex program not yet loaded
View Full Code Here

public abstract class LwjglMaterialStateUtil {

    public static void apply(final MaterialState state) {
        // ask for the current state record
        final RenderContext context = ContextManager.getCurrentContext();
        final MaterialStateRecord record = (MaterialStateRecord) context.getStateRecord(StateType.Material);
        context.setCurrentState(StateType.Material, state);

        if (state.isEnabled()) {
            // setup colormaterial, if changed.
            applyColorMaterial(state.getColorMaterial(), state.getColorMaterialFace(), record);
View Full Code Here

TOP

Related Classes of com.ardor3d.renderer.RenderContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.