Package org.newdawn.slick

Examples of org.newdawn.slick.SlickException


   */
  private static Font createFont (String ttfFileRef) throws SlickException {
    try {
      return Font.createFont(Font.TRUETYPE_FONT, ResourceLoader.getResourceAsStream(ttfFileRef)); // possible can be loaded from jar...
    } catch (FontFormatException ex) {
      throw new SlickException("Invalid font: " + ttfFileRef, ex);
    } catch (IOException ex) {
      throw new SlickException("Error reading font: " + ttfFileRef, ex);
    }
  }
View Full Code Here


            Input input = getContainer().getInput();
            TWLInputForwarder inputForwarder = new TWLInputForwarder(gui, input);
            input.addPrimaryListener(inputForwarder);
        } catch (Throwable e) {
            throw new SlickException("Could not initialize TWL GUI", e);
        } finally {
            GL11.glPopAttrib();
        }
    }
View Full Code Here

    // Wenn noch Ressourcen zum Laden vorhanden sind, diese Laden
    if (nextResource != null) {
      try {
        nextResource.load();
      } catch (IOException e) {
        throw new SlickException("Failed to load: "+nextResource.getDescription(), e);
      }
      nextResource = null;
    }
   
    if (LoadingList.get().getRemainingResources() > 0) {
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 FBO 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

    }
    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.