Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionException in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1028) at org.lwjgl.Sys$1.run(Sys.java:73) at java.security.AccessController.doPrivileged(Native Method) at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) at org.lwjgl.Sys.loadLibrary(Sys.java:82) at org.lwjgl.Sys.<clinit>(Sys.java:99) at org.lwjgl.opengl.Display.<clinit>(Display.java:130) at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:37) at java.security.AccessController.doPrivileged(Native Method) at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:34) at sans_titre3.Cadre1.jButton1_actionPerformed(Cadre1.java:60) at sans_titre3.Cadre1_jButton1_actionAdapter.actionPerformed(Cadre1.java:80) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
public void jButton1_actionPerformed(ActionEvent e) { Horloge fen = new Horloge(); fen.setVisible(true); try {//TinylineRenderToTexture g=new TinylineRenderToTexture(); AppGameContainer container = new AppGameContainer(new TinylineRenderToTexture(), 800, 600, false); container.start(); } catch (Exception ee) { ee.printStackTrace(); } }
package sans_titre3; import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; import java.util.zip.GZIPInputStream; import org.lwjgl.opengl.GL11; import org.newdawn.slick.AppGameContainer; import org.newdawn.slick.BasicGame; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.SlickException; import org.newdawn.slick.opengl.Texture; import org.newdawn.slick.util.ResourceLoader; import com.tinyline.svg.AnimationCallback; import com.tinyline.svg.ImageLoader; import com.tinyline.svg.SVG; import com.tinyline.svg.SVGAttr; import com.tinyline.svg.SVGDocument; import com.tinyline.svg.SVGFontElem; import com.tinyline.svg.SVGImageElem; import com.tinyline.svg.SVGImageProducer; import com.tinyline.svg.SVGParser; import com.tinyline.svg.SVGRaster; import com.tinyline.tiny2d.TinyBitmap; import com.tinyline.tiny2d.TinyPixbuf; import com.tinyline.tiny2d.TinyRect; import com.tinyline.tiny2d.TinyString; /** * Titre : * * Description : * * Copyright : Copyright (c) 2010 * * Société : * * @author non attribuable * @version 1.0 */ public class TinylineRenderToTexture extends BasicGame implements SVGImageProducer, ImageLoader { /** The texture generated from the SVG */ private int texture; /** The pixel buffer filled by TinyLine */ private TinyPixbuf pixBuffer; /** The raster rendered to by TinyLine */ private SVGRaster raster; /** The buffer holding the generated texture */ private ByteBuffer textureBuffer; /** The SVG document being rendered */ private SVGDocument doc; /** The position in the time line of animation */ private int time = 0; /** The width of the texture generated */ private int width = 256; /** The height of the texture generated */ private int height = 256; /** * SVG test */ public TinylineRenderToTexture() { super("TinylineRenderToTexture"); } /** * Creates an integer pixBuffer to hold specified ints - strictly a utility * method * * @param size * how many int to contain * @return created IntBuffer */ protected IntBuffer createIntBuffer(int size) { ByteBuffer temp = ByteBuffer.allocateDirect(4 * size); temp.order(ByteOrder.nativeOrder()); return temp.asIntBuffer(); } /** * Create a new texture ID * * @return A new texture ID */ private int createTextureID() { IntBuffer tmp = createIntBuffer(1); GL11.glGenTextures(tmp); return tmp.get(0); } /** * Create the texture that will be updated from SVG * * @param width The width of the texture * @param height The height of the texture * @return The generated texture ID */ private int createTexture(int width, int height) { int target = GL11.GL_TEXTURE_2D; int textureID = createTextureID(); GL11.glBindTexture(target, textureID); byte[] data = new byte[4 * width * height]; textureBuffer = ByteBuffer.allocateDirect(data.length); textureBuffer.order(ByteOrder.nativeOrder()); textureBuffer.put(data, 0, data.length); textureBuffer.flip(); GL11.glTexParameteri(target, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); GL11.glTexParameteri(target, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); GL11.glTexImage2D(target, 0, GL11.GL_RGBA, width, height, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, textureBuffer); return textureID; } /** * Loads an SVGT document from the given URL. * * @param ref The SVGT document URL or path. * @return An SVGT document. */ public SVGDocument loadSVG(String ref) { try { InputStream is = ResourceLoader.getResourceAsStream(ref); if (ref.endsWith("svg")) { is = new GZIPInputStream(is); } final SVGDocument doc = raster.createSVGDocument(); TinyPixbuf pixbuf = raster.getPixelBuffer(); SVGAttr attrParser = new SVGAttr(pixbuf.width, pixbuf.height); SVGParser parser = new SVGParser(attrParser); parser.load(doc, is); doc.nActiveAnimations = 0; doc.animTargets.count = 0; doc.addAnimations(doc.root); doc.acb = new AnimationCallback() { public void postSMILEvent(int eventType, TinyString event) { System.out.println(eventType + ":" + event); doc.resolveEventBased(event); } }; return doc; } catch (Exception ex) { ex.printStackTrace(); return null; } } /** * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { texture = createTexture(width, height); TinyPixbuf buffer = new TinyPixbuf(width, height); raster = new SVGRaster(buffer); raster.setSVGImageProducer(this); SVGImageElem.setImageLoader(this); SVGDocument fontDoc = loadSVG("org/newdawn/slick/data/helvetica_svg"); SVGFontElem font = SVGDocument.getFont(fontDoc, SVG.VAL_DEFAULT_FONTFAMILY); SVGDocument.defaultFont = font; doc = loadSVG("E:/projet/sans_titre3/ontology.svg"); raster.setAntialiased(true); raster.setSVGDocument(doc); // raster.setCamera(); // raster.update(); // raster.sendPixels(); } /** * @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer, * int) */ public void update(GameContainer container, int delta) throws SlickException { time += delta; TinyRect dirty = doc.animate(time / 4); raster.setDevClip(dirty); raster.update(); raster.sendPixels(); Thread.yield(); } /** * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer, * org.newdawn.slick.Graphics) */ public void render(GameContainer container, Graphics g) throws SlickException { GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2f(0, 0); GL11.glVertex2f(10, 50); GL11.glTexCoord2f(0, 1); GL11.glVertex2f(10, 562); GL11.glTexCoord2f(1, 1); GL11.glVertex2f(522, 562); GL11.glTexCoord2f(1, 0); GL11.glVertex2f(522, 50); GL11.glTexCoord2f(0, 0); GL11.glVertex2f(530, 50); GL11.glTexCoord2f(0, 1); GL11.glVertex2f(530, 306); GL11.glTexCoord2f(1, 1); GL11.glVertex2f(786, 306); GL11.glTexCoord2f(1, 0); GL11.glVertex2f(786, 50); GL11.glEnd(); Texture.unbind(); } /** * Entry point to the test * * @param argv The arguments to the test (normally none) */ /** * @see com.tinyline.svg.SVGImageProducer#hasConsumer() */ public boolean hasConsumer() { return true; } /** * @see com.tinyline.svg.SVGImageProducer#imageComplete() */ public void imageComplete() { TinyRect dirty = raster.getDevClip(); int width = dirty.xmax - dirty.xmin; int height = dirty.ymax - dirty.ymin; GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); int[] data = raster.getPixelBuffer().pixels32; textureBuffer.clear(); for (int y=dirty.ymin;y<dirty.ymax;y++) { for (int x=dirty.xmin;x<dirty.xmax;x++) { int i = x + (y*this.width); int red = ((data[i] & 0xFF0000) >> 16) & 0xFF; int green = ((data[i] & 0xFF00) >> 8) & 0xFF; int blue = (data[i] & 0xFF); int alpha = ((data[i] & 0xFF000000) >> 24) & 0xFF; textureBuffer.put((byte) red); textureBuffer.put((byte) green); textureBuffer.put((byte) blue); textureBuffer.put((byte) alpha); } } textureBuffer.flip(); GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, dirty.xmin, dirty.ymin, width, height, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, textureBuffer); Texture.unbind(); } /** * @see com.tinyline.svg.SVGImageProducer#sendPixels() */ public void sendPixels() { } /** * @see com.tinyline.svg.ImageLoader#createTinyBitmap(com.tinyline.tiny2d.TinyString) */ public TinyBitmap createTinyBitmap(TinyString arg0) { return null; } /** * @see com.tinyline.svg.ImageLoader#createTinyBitmap(byte[], int, int) */ public TinyBitmap createTinyBitmap(byte[] arg0, int arg1, int arg2) { return null; } }
xception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: org.lwjgl.DefaultSysImplementation.getPointerSize()I at org.lwjgl.DefaultSysImplementation.getPointerSize(Native Method) at org.lwjgl.Sys.<clinit>(Sys.java:100) at org.lwjgl.opengl.Display.<clinit>(Display.java:130) at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:37) at java.security.AccessController.doPrivileged(Native Method) at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:34) at sans_titre3.Cadre1.jButton1_actionPerformed(Cadre1.java:60) at sans_titre3.Cadre1_jButton1_actionAdapter.actionPerformed(Cadre1.java:80) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.Component.processMouseEvent(Component.java:6263) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6028) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Sun Dec 12 21:33:32 CET 2010 INFO:Slick Build #170 Sun Dec 12 21:33:32 CET 2010 INFO:LWJGL Version: 2.6 Sun Dec 12 21:33:32 CET 2010 INFO:OriginalDisplayMode: 1024 x 768 x 32 @60Hz Sun Dec 12 21:33:32 CET 2010 INFO:TargetDisplayMode: 800 x 600 x 0 @0Hz Sun Dec 12 21:33:33 CET 2010 INFO:Starting display 800x600 Loading: net.java.games.input.DirectAndRawInputEnvironmentPlugin Sun Dec 12 21:33:33 CET 2010 INFO:Found 0 controllers