Package org.newdawn.slick

Examples of org.newdawn.slick.SlickException


   * @throws SlickException Indicates a failure during copy or a invalid particle system to be duplicated
   */
  public ParticleSystem duplicate() throws SlickException {
    for (int i=0;i<emitters.size();i++) {
      if (!(emitters.get(i) instanceof ConfigurableEmitter)) {
        throw new SlickException("Only systems contianing configurable emitters can be duplicated");
      }
    }
 
    ParticleSystem theCopy = null;
    try {
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      ParticleIO.saveConfiguredSystem(bout, this);
      ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
      theCopy = ParticleIO.loadConfiguredSystem(bin);
    } catch (IOException e) {
      Log.error("Failed to duplicate particle system");
      throw new SlickException("Unable to duplicated particle system", e);
    }
   
    return theCopy;
  }
View Full Code Here


             
        objectGroups.add(objectGroup);
      }
    } catch (Exception e) {
      Log.error(e);
      throw new SlickException("Failed to parse tilemap", e);
    }
  }
View Full Code Here

        Document doc = builder.parse(in);
        Element docElement = doc.getDocumentElement();
        element = docElement; //(Element) docElement.getElementsByTagName("tileset").item(0);
      } catch (Exception e) {
        Log.error(e);
        throw new SlickException("Unable to load or parse sourced tileset: "+this.map.tilesLocation+"/"+source);
      }
    }
        String tileWidthString = element.getAttribute("tilewidth");
        String tileHeightString = element.getAttribute("tileheight");
        if(tileWidthString.length() == 0 || tileHeightString.length() == 0) {
            throw new SlickException("TiledMap requires that the map be created with tilesets that use a " +
                    "single image.  Check the WiKi for more complete information.");
        }
    tileWidth = Integer.parseInt(tileWidthString);
    tileHeight = Integer.parseInt(tileHeightString);
   
View Full Code Here

     
      loadChildren(root, new Transform());
     
      return diagram;
    } catch (Exception e) {
      throw new SlickException("Failed to load inkscape document", e);
    }
  }
View Full Code Here

   * @throws SlickException Indicates a failure during copy or a invalid particle system to be duplicated
   */
  public ParticleSystem duplicate() throws SlickException {
    for (int i=0;i<emitters.size();i++) {
      if (!(emitters.get(i) instanceof ConfigurableEmitter)) {
        throw new SlickException("Only systems contianing configurable emitters can be duplicated");
      }
    }
 
    ParticleSystem theCopy = null;
    try {
      ByteArrayOutputStream bout = new ByteArrayOutputStream();
      ParticleIO.saveConfiguredSystem(bout, this);
      ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
      theCopy = ParticleIO.loadConfiguredSystem(bin);
    } catch (IOException e) {
      Log.error("Failed to duplicate particle system");
      throw new SlickException("Unable to duplicated particle system", e);
    }
   
    return theCopy;
  }
View Full Code Here

   
    Log.debug("Creating FBO "+image.getWidth()+"x"+image.getHeight());
   
    boolean FBOEnabled = GLContext.getCapabilities().GL_EXT_framebuffer_object;
    if (!FBOEnabled) {
      throw new SlickException("Your OpenGL card does not support PBuffers and hence can't handle the dynamic images required for this application.");
    }
 
    init();
 
View Full Code Here

    int framebuffer = EXTFramebufferObject.glCheckFramebufferStatusEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT);
    switch ( framebuffer ) {
      case EXTFramebufferObject.GL_FRAMEBUFFER_COMPLETE_EXT:
        break;
      case EXTFramebufferObject.GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
        throw new SlickException( "FrameBuffer: " + FBO
            + ", has caused a GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT exception" );
      case EXTFramebufferObject.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
        throw new SlickException( "FrameBuffer: " + FBO
            + ", has caused a GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT exception" );
      case EXTFramebufferObject.GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
        throw new SlickException( "FrameBuffer: " + FBO
            + ", has caused a GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT exception" );
      case EXTFramebufferObject.GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
        throw new SlickException( "FrameBuffer: " + FBO
            + ", has caused a GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT exception" );
      case EXTFramebufferObject.GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
        throw new SlickException( "FrameBuffer: " + FBO
            + ", has caused a GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT exception" );
      case EXTFramebufferObject.GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
        throw new SlickException( "FrameBuffer: " + FBO
            + ", has caused a GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT exception" );
      default:
        throw new SlickException( "Unexpected reply from glCheckFramebufferStatusEXT: " + framebuffer);
    }
  }
View Full Code Here

      // keep hold of the original content
      drawImage(image, 0, 0);
      image.setTexture(tex);
     
    } catch (Exception e) {
      throw new SlickException("Failed to create new texture for FBO");
    }
  }
View Full Code Here

    super(image.getTexture().getTextureWidth(), image.getTexture().getTextureHeight());
    this.image = image;
   
    Log.debug("Creating pbuffer(unique) "+image.getWidth()+"x"+image.getHeight());
    if ((Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) == 0) {
      throw new SlickException("Your OpenGL card does not support PBuffers and hence can't handle the dynamic images required for this application.");
    }
 
    init();
 
View Full Code Here

      image.setTexture(tex);
     
      Display.makeCurrent();
    } catch (Exception e) {
      Log.error(e);
      throw new SlickException("Failed to create PBuffer for dynamic image. OpenGL driver failure?");
    }
  }
View Full Code Here

TOP

Related Classes of org.newdawn.slick.SlickException

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.