Package org.newdawn.slick

Examples of org.newdawn.slick.SlickException


    super(image.getTexture().getTextureWidth(), image.getTexture().getTextureHeight());
    this.image = image;
   
    Log.debug("Creating pbuffer(rtt) "+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.");
    }
    if ((Pbuffer.getCapabilities() & Pbuffer.RENDER_TEXTURE_SUPPORTED) == 0) {
      throw new SlickException("Your OpenGL card does not support Render-To-Texture 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

   * @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

      Document doc = builder.parse(in);
      Element docElement = doc.getDocumentElement();
     
      String orient = docElement.getAttribute("orientation");
      if (!orient.equals("orthogonal")) {
        throw new SlickException("Only orthogonal maps supported, found: "+orient);
      }
     
      width = Integer.parseInt(docElement.getAttribute("width"));
      height = Integer.parseInt(docElement.getAttribute("height"));
      tileWidth = Integer.parseInt(docElement.getAttribute("tilewidth"));
      tileHeight = Integer.parseInt(docElement.getAttribute("tileheight"));
     
      // now read the map properties
      Element propsElement = (Element) docElement.getElementsByTagName("properties").item(0);
      if (propsElement != null) {
        NodeList properties = propsElement.getElementsByTagName("property");
        if (properties != null) {
          props = new Properties();
          for (int p = 0; p < properties.getLength();p++) {
            Element propElement = (Element) properties.item(p);
           
            String name = propElement.getAttribute("name");
            String value = propElement.getAttribute("value");   
            props.setProperty(name, value);
          }
        }
      }
     
      if (loadTileSets) {
        TileSet tileSet = null;
        TileSet lastSet = null;
       
        NodeList setNodes = docElement.getElementsByTagName("tileset");
        for (int i=0;i<setNodes.getLength();i++) {
          Element current = (Element) setNodes.item(i);
         
          tileSet = new TileSet(this, current, !headless);
          tileSet.index = i;
         
          if (lastSet != null) {
            lastSet.setLimit(tileSet.firstGID-1);
          }
          lastSet = tileSet;
         
          tileSets.add(tileSet);
        }
      }
     
      NodeList layerNodes = docElement.getElementsByTagName("layer");
      for (int i=0;i<layerNodes.getLength();i++) {
        Element current = (Element) layerNodes.item(i);
        Layer layer = new Layer(this, current);
        layer.index = i;
       
        layers.add(layer);
      }
     
      // acquire object-groups
      NodeList objectGroupNodes = docElement.getElementsByTagName("objectgroup");
          
      for (int i=0;i<objectGroupNodes.getLength();i++) {
        Element current = (Element) objectGroupNodes.item(i);
        ObjectGroup objectGroup = new ObjectGroup(current);
        objectGroup.index = i;
             
        objectGroups.add(objectGroup);
      }
    } catch (Exception e) {
      Log.error(e);
      throw new SlickException("Failed to parse tilemap", e);
    }
  }
View Full Code Here

        Element docElement = doc.getDocumentElement();
        element = docElement; //(Element) docElement.getElementsByTagName("tileset").item(0);
        name = element.getAttribute("name");
      } 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

          toServer.writeInt(movesVersion);
          p2Moves = (Queue<String>) objIn.readObject();
        }
        System.out.println("OTHER PLAYER SENT ME " + p2Moves.size() + " MOVES");
      } catch(IOException e){
        throw new SlickException(e.getMessage());
      } catch (ClassNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (InterruptedException e) {
        // TODO Auto-generated catch block
View Full Code Here

            if (guardado) {
                try {
                    pg.setTiempo(pg.getTiempo() + incremento + paso);
                } catch (Exception ex) {
                    ex.printStackTrace();
                    throw new SlickException(ex.getLocalizedMessage());
                }
            } else {
                try {
                    partido.iterar();
                } catch (Exception ex) {
                    ex.printStackTrace();
                    throw new SlickException(ex.getLocalizedMessage());
                }
            }

            boolean oldSound = sonidos;
            if (guardado && incremento == 0) {
View Full Code Here

    this.container = container;
   
    try {
      fire = ParticleIO.loadConfiguredSystem("testdata/system.xml");
    } catch (IOException e) {
      throw new SlickException("Failed to load particle systems", e);
    }
   
    copy = new Image(400,300);
    String[] formats = ImageOut.getSupportedFormats();
    message = "Formats supported: ";
View Full Code Here

    fbo = GLContext.getCapabilities().GL_EXT_framebuffer_object;
    pbuffer = (Pbuffer.getCapabilities() & Pbuffer.PBUFFER_SUPPORTED) != 0;
    pbufferRT = (Pbuffer.getCapabilities() & Pbuffer.RENDER_TEXTURE_SUPPORTED) != 0;
   
    if (!fbo && !pbuffer && !pbufferRT) {
      throw new SlickException("Your OpenGL card does not support offscreen buffers and hence can't handle the dynamic images required for this application.");
    }
   
    Log.info("Offscreen Buffers FBO="+fbo+" PBUFFER="+pbuffer+" PBUFFERRT="+pbufferRT);
  }
View Full Code Here

      } else {
        return new PBufferUniqueGraphics(image);
      }
    }
   
    throw new SlickException("Failed to create offscreen buffer even though the card reports it's possible");
  }
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.