Package com.ardor3d.util

Examples of com.ardor3d.util.Ardor3dException


        // check if we are already setup... if so, throw error.
        if (tex.getTextureKey() == null) {
            tex.setTextureKey(TextureKey.getRTTKey(tex.getMinificationFilter()));
        } else if (tex.getTextureIdForContext(context.getGlContextRep()) != 0) {
            throw new Ardor3dException("Texture is already setup and has id.");
        }

        // Create the texture
        final IntBuffer ibuf = BufferUtils.createIntBuffer(1);
        GL11.glGenTextures(ibuf);
View Full Code Here


                            _backgroundColor.getBlue(), _backgroundColor.getAlpha());
                    _bgColorDirty = false;
                }
            } catch (final LWJGLException e) {
                logger.logp(Level.SEVERE, this.getClass().toString(), "activate()", "Exception", e);
                throw new Ardor3dException();
            }
        }
        _active++;
    }
View Full Code Here

        if (_active == 1) {
            try {
                giveBackContext();
            } catch (final LWJGLException e) {
                logger.logp(Level.SEVERE, this.getClass().toString(), "deactivate()", "Exception", e);
                throw new Ardor3dException();
            }
        }
        _active--;
    }
View Full Code Here

        try {
            _canvasCallback.makeCurrent();
            GLContext.useContext(_context);
        } catch (final LWJGLException e) {
            throw new Ardor3dException("Unable to init CanvasRenderer.", e);
        }

        final ContextCapabilities caps = createContextCapabilities();
        _currentContext = new RenderContext(this, caps, sharedContext);
View Full Code Here

        try {
            _canvasCallback.makeCurrent();
            GLContext.useContext(_context);
            ContextManager.switchContext(this);
        } catch (final LWJGLException e) {
            throw new Ardor3dException("Failed to claim OpenGL context.", e);
        }
    }
View Full Code Here

                Display.create(format);
            }
        } catch (final Exception e) {
            logger.severe("Cannot create window");
            logger.logp(Level.SEVERE, this.getClass().toString(), "initDisplay()", "Exception", e);
            throw new Ardor3dException("Cannot create window: " + e.getMessage());
        }

        _canvasRenderer.init(_settings, true); // true - do swap in renderer.
        _inited = true;
    }
View Full Code Here

        // Set up our Ardor3D context and capabilities objects
        final LwjglContextCapabilities caps = new LwjglContextCapabilities(GLContext.getCapabilities());
        final RenderContext currentContext = new RenderContext(this, caps, null);

        if (!caps.isFBOSupported()) {
            throw new Ardor3dException("Headless requires FBO support.");
        }

        if (caps.isFBOMultisampleSupported() && caps.isFBOBlitSupported() && _settings.getSamples() > 0) {
            _useMSAA = true;
        }
View Full Code Here

        // create the Display.
        DisplayMode mode;
        if (_settings.isFullScreen()) {
            mode = getValidDisplayMode(_settings);
            if (null == mode) {
                throw new Ardor3dException("Bad display mode (w/h/bpp/freq): " + _settings.getWidth() + " / "
                        + _settings.getHeight() + " / " + _settings.getColorDepth() + " / " + _settings.getFrequency());
            }
        } else {
            mode = new DisplayMode(_settings.getWidth(), _settings.getHeight());
        }

        final PixelFormat format = new PixelFormat(_settings.getAlphaBits(), _settings.getDepthBits(),
                _settings.getStencilBits()).withSamples(_settings.getSamples()).withStereo(_settings.isStereo());

        try {
            Display.setDisplayMode(mode);
            Display.setFullscreen(_settings.isFullScreen());
            Display.create(format);
        } catch (final Exception e) {
            logger.severe("Cannot create window");
            logger.logp(Level.SEVERE, this.getClass().toString(), "initDisplay()", "Exception", e);
            throw new Ardor3dException("Cannot create window: " + e.getMessage());
        }

        _canvasRenderer.init(_settings, true); // true - do swap in renderer.
        _inited = true;
    }
View Full Code Here

    public void setIcon(final Image[] iconImages) {
        final ByteBuffer[] iconData = new ByteBuffer[iconImages.length];
        for (int i = 0; i < iconData.length; i++) {
            // Image.Format.RGBA8 is the format that LWJGL requires, so try to convert if it's not.
            if (iconImages[i].getDataType() != PixelDataType.UnsignedByte) {
                throw new Ardor3dException(
                        "Your icon is in a format that could not be converted to UnsignedByte - RGBA");
            }

            if (iconImages[i].getDataFormat() != ImageDataFormat.RGBA) {
                if (iconImages[i].getDataFormat() != ImageDataFormat.RGB) {
                    throw new Ardor3dException(
                            "Your icon is in a format that could not be converted to UnsignedByte - RGBA");
                }
                iconImages[i] = _RGB888_to_RGBA8888(iconImages[i]);
            }
View Full Code Here

        }
    }

    public void setOrtho() {
        if (_inOrthoMode) {
            throw new Ardor3dException("Already in Orthographic mode.");
        }
        // set up ortho mode
        final RendererRecord matRecord = ContextManager.getCurrentContext().getRendererRecord();
        LwjglRendererUtil.switchMode(matRecord, GL11.GL_PROJECTION);
        GL11.glPushMatrix();
View Full Code Here

TOP

Related Classes of com.ardor3d.util.Ardor3dException

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.