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);
        gl.glGenTextures(ibuf.limit(), ibuf); // TODO Check <size>
View Full Code Here


        // 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);
        gl.glGenTextures(1, ibuf);
View Full Code Here

        }
    }

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

        _inOrthoMode = true;
    }

    public void unsetOrtho() {
        if (!_inOrthoMode) {
            throw new Ardor3dException("Not in Orthographic mode.");
        }
        // remove ortho mode, and go back to original
        // state
        final JoglRendererRecord matRecord = (JoglRendererRecord) ContextManager.getCurrentContext()
                .getRendererRecord();
View Full Code Here

                case CubeMap:
                    gl.glTexSubImage2D(JoglTextureStateUtil.getGLCubeMapFace(dstFace), 0, dstOffsetX, dstOffsetY,
                            dstWidth, dstHeight, pixelFormat, GL.GL_UNSIGNED_BYTE, source);
                    break;
                default:
                    throw new Ardor3dException("Unsupported type for updateTextureSubImage: " + destination.getType());
            }
        } finally {
            // Restore the texture configuration (when necessary)...
            // Restore alignment.
            if (origAlignment[0] != alignment) {
View Full Code Here

            final int errorCode = gl.glGetError();
            if (errorCode != GL.GL_NO_ERROR) {
                throw new GLException(glu.gluErrorString(errorCode));
            }
        } catch (final GLException exception) {
            throw new Ardor3dException("Error in opengl: " + exception.getMessage(), exception);
        }
    }
View Full Code Here

            rendRecord.invalidateVBO();
            JoglRendererUtil.setBoundVBO(rendRecord, vboID);
            gl.glBufferData(GL.GL_ARRAY_BUFFER, dataBuffer.limit() * data.getByteCount(), dataBuffer,
                    getGLVBOAccessMode(data.getVboAccessMode()));
        } else {
            throw new Ardor3dException("Attempting to create a vbo id for an AbstractBufferData with no Buffer value.");
        }
        return vboID;
    }
View Full Code Here

            rendRecord.invalidateVBO();
            JoglRendererUtil.setBoundElementVBO(rendRecord, vboID);
            gl.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER, dataBuffer.limit() * data.getByteCount(), dataBuffer,
                    getGLVBOAccessMode(data.getVboAccessMode()));
        } else {
            throw new Ardor3dException("Attempting to create a vbo id for a IndexBufferData with no Buffer value.");
        }
        return vboID;
    }
View Full Code Here

                }
            } catch (final InstantiationException e) {
                logger.logp(Level.SEVERE, this.getClass().toString(), "readObject(int)",
                        "Could not access constructor of class '" + bco._className + "'! \n"
                                + "Some types may require the annotation SavableFactory.  Please double check.", e);
                throw new Ardor3dException(e);
            } catch (final NoSuchMethodException e) {
                logger
                        .logp(
                                Level.SEVERE,
                                this.getClass().toString(),
                                "readObject(int)",
                                e.getMessage()
                                        + " \n"
                                        + "Method specified in annotation does not appear to exist or has an invalid method signature.",
                                e);
                throw new Ardor3dException(e);
            }

            _capsuleTable.put(out, cap);
            _contentTable.put(id, out);

            out.read(_capsuleTable.get(out));

            _capsuleTable.remove(out);

            return out;

        } catch (final Ardor3dException e) {
            // rethrow our own exceptions
            throw e;
        } catch (final Exception e) {
            logger.logp(Level.SEVERE, this.getClass().toString(), "readObject(int)", "Exception", e);
            throw new Ardor3dException(e);
        }
    }
View Full Code Here

                        Level.SEVERE,
                        this.getClass().toString(),
                        "readSavableFromCurrentElem(Savable)",
                        "Could not access constructor of class '" + className + "'! \n"
                                + "Some types may require the annotation SavableFactory.  Please double check.");
                throw new Ardor3dException(e);
            } catch (final NoSuchMethodException e) {
                Logger.getLogger(getClass().getName())
                        .logp(Level.SEVERE,
                                this.getClass().toString(),
                                "readSavableFromCurrentElem(Savable)",
                                e.getMessage()
                                        + " \n"
                                        + "Method specified in annotation does not appear to exist or has an invalid method signature.");
                throw new Ardor3dException(e);
            } catch (final Exception e) {
                Logger.getLogger(getClass().getName()).logp(Level.SEVERE, this.getClass().toString(),
                        "readSavableFromCurrentElem(Savable)", "Exception", e);
                return null;
            }
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.