Show Posts
|
|
Pages: [1] 2
|
|
1
|
Java Game APIs & Engines / JOGL Development / Re: JOGL Applet Security
|
on: 2005-11-14 11:21:32
|
hey lilian nice work, i get an errormessage thought 1
| Error: The native libraries arent't properly signed |
my system setup is: Mac OS X 10.4.3 Safari Browser Java Version 1.4.2_09 and i do have the jogl version 1.1 installed in my ~/User/Library/Extensions/Java folder.
|
|
|
|
|
2
|
Java Game APIs & Engines / JOGL Development / Re: JOGL Applet Security
|
on: 2005-11-03 17:59:44
|
1. You must have a fully signed applet. 2. The applet, on first run, needs to create a directory in some well-known but interference-proof location. I would recommend ${user.home}/appletname/native. 3. The DLLs are copied into there from their source jars 4. The Java-side code needs to be able to call System.loadLibrary(System.getProperty("user.home")+"/"+appletname+"/"+native+"/jogl.dll") or something. Therefore JOGL (and LWJGL) would need a few subtle adjustments to allow them to load from custom paths.
it s not completely true what you re saying, cas. the applet itself doesn t need to be signed. check out this applet we threw together. http://www.wortwechsel.biz/kindergarten/gestalt/the thing is, you need the files installed as extensions in your VM to run this unsigned applet. to achieve that we wrote an installer, which btw needs to be a signed applet, that installs all necessary files in your VM. we plan to release the installer as a more general solution, for all kinds of extensions. the basic idea is to ask the java enabled browser about the location of the VM it uses and then copy the stuff there. on OS X this works pretty nice because the extension policy is very clear. on windows it usually works. the good thing is you one only has to install the extension once. cheers d3
|
|
|
|
|
3
|
Java Game APIs & Engines / JOGL Development / Re: JOGL installer for applet
|
on: 2005-10-11 20:09:06
|
On OS X you should consider simply keeping the JOGL jars and native libs in the Application Bundle. Assuming you use an application bundle for OS X, which would be the most OS X - like way to distribute your application to Mac users.
since we are talking about applets here, the application bundle structure is no real option. i think it s a good idea to install the libraries on the client machine, as you only need to do that once and not everytime you load an applet. i always found the JSyn installer a pretty neat eyample -- http://www.softsynth.com/jsyn/plugins/If you keep the library files inside the app bundle then there is no possibility of different versions of the library causing problems for different applications.
i m really not sure about that. what is the search order for the default library paths? i didn t find any pointers on the apple website. as i said, i had problems with that in the past and it can definitely lead to confusion on a machine that is actually used by more than one user.
|
|
|
|
|
4
|
Java Game APIs & Engines / JOGL Development / Re: JOGL installer for applet
|
on: 2005-10-11 11:46:46
|
there are 3 default directories for java extensions on OS X 1 2 3
| ~/Library/Java/Extensions/ # you should probably use this directory as it is for a specific user /Library/Java/Extensions/ # this is the systemwide extension directory /System/Library/Java/Extensions/ # this is for apple stuff only |
i experienced some problems in the past when there where the same extensions installed in different directories.
|
|
|
|
|
5
|
Java Game APIs & Engines / JOGL Development / shadowmaps with framebuffer objects
|
on: 2005-07-13 00:30:06
|
this is a tiny bit of topic since it s a plain opengl question. i just had a chance to look at framebuffer objects and it s very beautiful and straight forward and everything: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| int[] myFrameBufferConainter = new int[1]; gl.glGenFramebuffersEXT(1, myFrameBufferConainter); int _myFrameBufferID = myFrameBufferConainter[0];
int[] myDepthRenderBufferConainter = new int[1]; gl.glGenRenderbuffersEXT(1, myDepthRenderBufferConainter); int _myDepthRenderBufferID = myDepthRenderBufferConainter[0]; int[] myTextureConainter = new int[1]; gl.glGenTextures(1, myTextureConainter); int _myTextureID = myTextureConainter[0];
gl.glBindTexture(GL.GL_TEXTURE_2D, _myTextureID);
gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, theWidth, theHeight, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, (byte[]) null);
gl.glFramebufferTexture2DEXT(GL.GL_FRAMEBUFFER_EXT, GL.GL_COLOR_ATTACHMENT0_EXT, GL.GL_TEXTURE_2D, _myTextureID, 0);
gl.glBindRenderbufferEXT(GL.GL_RENDERBUFFER_EXT, _myDepthRenderBufferID); gl.glRenderbufferStorageEXT(GL.GL_RENDERBUFFER_EXT, GL.GL_DEPTH_COMPONENT24, theWidth, theHeight); gl.glFramebufferRenderbufferEXT(GL.GL_FRAMEBUFFER_EXT, GL.GL_DEPTH_ATTACHMENT_EXT, GL.GL_RENDERBUFFER_EXT, _myDepthRenderBufferID); |
i was now moving on to implement a shadowmap with framebuffer objects but ran into the problem that i couldn t figure out how to set up the framebuffer, the texture and the renderbuffer. my question is now, has anyone successfully used framebuffer objects to create a shadowmap texure?
|
|
|
|
|
6
|
Java Game APIs & Engines / JOGL Development / removing arbitrary GLEventListener
|
on: 2005-06-30 13:17:32
|
is there a way to remove a GLEventListener if the reference is unknown? from looking at the jogl source code i can tell that there is no way to do so. 1 2 3 4 5 6 7 8 9 10 11
| public synchronized void addGLEventListener(GLEventListener listener) { List newListeners = (List) ((ArrayList) listeners).clone(); newListeners.add(listener); listeners = newListeners; } public synchronized void removeGLEventListener(GLEventListener listener) { List newListeners = (List) ((ArrayList) listeners).clone(); newListeners.remove(listener); listeners = newListeners; } |
i just ran into a situation where i had a reference to a GLCanvas but not to the added GLEventListener. wouldn t it be cool to be able to poll those listeners? i know that i could always add this myself and recompile 
|
|
|
|
|
8
|
Java Game APIs & Engines / JOGL Development / Re: So you like Textures eh? Texturing Demo in JOG
|
on: 2005-02-15 20:57:58
|
i just threw together a 'proof-of-concept' i was thinking about for some time now. after having a lot of trouble with the, as of now, crappy QTJ API i finally figured out a way to use the native QT API through the JNI. as mentionened above the code is more of a 'proof-of-concept' and since i have not much experience with C/CPP i didn t manage to come up with a windows version ( maybe someone can help  ). it s just osx. the basic concept is to get rid off the, especially under osx, annoying copying of data from native to java to native to opengl and rather leave all the heavy data pushing in native world where it belongs. i was really suprised to find out that when suppling a valid opengl context from jogl, you can call 'native' opengl functions via JNI from native code. i m not sure if this is valid, whatever that means, but i tested it under osx on several occasion and it seems to be robust. with that knowledge i wrote ( and snipped of course ) a little wrapper around the native QT API that would simply allocate some memory, let quicktime write into this memory and copy it to opengl, all on the native side. the java/jogl part would just controll the whole process. which is creating, playing, looping movies etc. it still seems a bit like blackmagic to me and maybe is. i would be happy to get some feedback and even better some improvement on this approach. -> QTGLJNI
|
|
|
|
|
9
|
Java Game APIs & Engines / JOGL Development / Re: DV Video textures
|
on: 2005-02-10 11:53:25
|
just now i m writing on some JNI stuff which integrates QuicktTime and OpenGL on the native side. the basic idea is to do everything in Jogl (opening window, draw primitives, handletextures etc) and just shove the pixels from native QuickTime to 'native' OpenGL. the jogl side would look something like this: 1 2 3 4 5 6 7
| gl.glBindTexture(GL.GL_TEXTURE_2D, myGLTextureID[i]); _myJNIWrapper.updateTexture(myTextureID[i]); gl.glPushMatrix(); gl.glBegin(GL.GL_QUADS); gl.glEnd(); gl.glPopMatrix(); |
as you can see you don t even need to pass the OpenGL texture ID as long as you bind the texture before you go native. the interesting thing for me to see was, that as long as you call the native methods inside a valid jogl frame, that is from inside the display(GLDrawable) method, you can use the 'native' opengl and jogl interchangeably. this research is really interesting since OTJava sucks as much as JMF sucks. i will post the outcomes as soon as i have a working windows version, the osx side is already done. PS the native setup is NOT mindblowingly faster than the QTJava version but much more stable and reliable.
|
|
|
|
|
11
|
Java Game APIs & Engines / Java Sound & OpenAL / Re: MacOSX just makes noise
|
on: 2004-09-15 08:50:38
|
with some soundplayer, for example quicktime, you can get information about the sound s 'endian-ness'. if you use 8bit sound  you don t have any endian issues. still i would also be interested in solving this problem. the 'wav' format, as far as i know, always 'little endian' thus wouldn t play correctly on 'big endian' machines. i m not enough into 'OpenAL' but is there any easy way to load for example 'AIFF' files which is a 'big endian' format with something similar to 'alutLoadWAVFile'? is the a tutorial for that?
|
|
|
|
|
12
|
Java Game APIs & Engines / JOGL Development / Re: JOGL 1.1 b05 released
|
on: 2004-08-06 09:19:43
|
|
why do i get this when using release 1.1b05?
------------------------------------------------------- JOGL VERSION: 1.1.0-b04 INIT GL IS: net.java.games.jogl.impl.macosx.MacOSXGLImpl CANVAS GL IS: net.java.games.jogl.impl.macosx.MacOSXGLImpl CANVAS GLU IS: net.java.games.jogl.impl.GLUImpl GL_VENDOR: ATI Technologies Inc. GL_RENDERER: ATI Radeon 9000 OpenGL Engine GL_VERSION: 1.3 ATI-1.3.18 -------------------------------------------------------
is this an error in getVersion() or is it really just b04 on mac os x?
|
|
|
|
|
14
|
Java Game APIs & Engines / JOGL Development / Re: Picking In 3D
|
on: 2004-04-28 07:14:46
|
|
you should have a look at glSelectBuffer which provides a mechanism for picking any object drawn on the screen.
there is also a NEHE tutorial, lesson #32 dealing with this topic. although i m not sure if it has been ported to jogl.
we used selection buffer in 2D and that worked very well. 3D should work fine as well. why should it :)
|
|
|
|
|
15
|
Java Game APIs & Engines / JOGL Development / Re: Text in JOGL
|
on: 2004-04-21 08:39:38
|
i just put together a class which can generate an image from a TrueTypeFont. to get the image to Jogl as a texture shouldn t be that hard. no need to mention that the class is not complete and has several flaws :) hope this helps anyway! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
| import java.io.*;
import java.awt.*; import java.awt.font.*; import java.awt.image.*;
public class DynamicFont {
private Font basefont;
private Font font;
private FontRenderContext context;
private float fontsize;
private static final boolean DEBUG = true;
public DynamicFont(InputStream is) { basefont = loadBaseFont(is); context = getContext(); fontsize = 48f; setSize(fontsize); }
private Font getFontBySize(float s) { return basefont.deriveFont(s); }
public void setSize(float size) { fontsize = size; font = getFontBySize(size); }
private Font loadBaseFont(InputStream is) { Font font = null; try { font = Font.createFont(Font.TRUETYPE_FONT, is); } catch (IOException ex) { System.err.println("### ERROR @DynamicFont IOException"); } catch (FontFormatException ex) { System.err.println("### ERROR @DynamicFont FontFormatException"); } return font; }
private FontRenderContext getContext() { BufferedImage b = new BufferedImage(1, 1, BufferedImage.TYPE_3BYTE_BGR); Graphics2D g = b.createGraphics(); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); FontRenderContext frc = g.getFontRenderContext(); return frc; }
private void checkString(String text) { int illegalCharacter = font.canDisplayUpTo(text); if (illegalCharacter > -1) { System.err.println("### INFO cann t display character #" + illegalCharacter); } }
public BufferedImage getImage(String text) { if (DEBUG) { checkString(text); } int width = (int) font.getStringBounds(text, context).getWidth(); int height = (int) font.getMaxCharBounds(context).getHeight(); int y = (int) font.getStringBounds(text, context).getY(); BufferedImage bitmap = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); Graphics2D g = bitmap.createGraphics(); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setFont(font); g.drawString(text, 0, -y); return bitmap; } } |
|
|
|
|
|
20
|
Java Game APIs & Engines / JOGL Development / [OT] using manually generated mipmaps
|
on: 2004-01-15 15:24:24
|
hello i am trying to manually generated mipmaps to work. with no success. the idea is basically the same as it can be found in the 'red book'. when i set GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST_MIPMAP_NEAREST); to GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); i can at least see the first of the mipmaps. probably because mipmapping is turned of then. i was wandering if anyone has ever successfully done this kind of mipmapping and could help me out with a code snip or correct my mistake. cheers d3 TextureReader.Texture[] texture = new TextureReader.Texture[6]; try { for (int i=0; i<texture.length; i++){ texture = TextureReader.readTexture("demos/data/images/"+i+".png"); } } catch (IOException e) { e.printStackTrace(); throw new RuntimeException(e); }
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST_MIPMAP_NEAREST);
for (int i=0; i<texture.length; i++){ gl.glTexImage2D(GL.GL_TEXTURE_2D, i, GL.GL_RGB, texture.getWidth(), texture.getHeight(), 0, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, texture.getPixels()); }http://
|
|
|
|
|
21
|
Java Game APIs & Engines / JOGL Development / Re: Problems with nVidia FX5900
|
on: 2004-01-10 11:44:08
|
|
oh yes of course. here it is. BTW is there a way of resolving the '... 6 more' at the end?
net.java.games.jogl.GLException: java.lang.ClassNotFoundException: net.java.games.jogl.impl.windows.WindowsGLContextFactory
at net.java.games.jogl.impl.GLContextFactory.getFactory(GLContextFactory.java:76)
at net.java.games.jogl.GLCanvas.<init>(GLCanvas.java:72)
at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableFactory.java:117)
at net.java.games.jogl.GLDrawableFactory.createGLCanvas(GLDrawableFactory.java:80)
at renderer.Window.init(Window.java:97)
at application.Controller.init(Controller.java:52)
at application.Main.main(Main.java:19)
Caused by: java.lang.ClassNotFoundException: net.java.games.jogl.impl.windows.WindowsGLContextFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at net.java.games.jogl.impl.GLContextFactory.getFactory(GLContextFactory.java:62)
... 6 more
|
|
|
|
|
22
|
Java Game APIs & Engines / JOGL Development / Problems with nVidia FX5900
|
on: 2004-01-09 20:15:38
|
|
hello i tried to run a jogl app on a windows machine with a nVidia FX5900 graphic card an error which happend somewhere in the native regions. the same code runs well on my OS X machine and on older nVidia cards like an nVidia Quadro.
i was wandering if anyone could confirm such behavior. or even explain or even better fix it. fix it fix it.
|
|
|
|
|
23
|
Java Game APIs & Engines / JOGL Development / Re: Animated Texture with QT
|
on: 2003-12-04 09:26:52
|
PRETTY! i got my animated textures with QT working. it s speed is acceptable on MAC and on WIN even more. PRO you can use a lot of different movie formats, all that quicktime supports. with the right codec you can even use alpha-channels. CON you need quicktime installed. it s not certain what happens with the API in the future. but what is then? if anyone is interested i can supply some code. it s still in a spaghetti-state so i hesitate to post it here 
|
|
|
|
|
24
|
Java Game APIs & Engines / JOGL Development / Re: Animated Texture with QT
|
on: 2003-11-28 12:24:15
|
oh yes it does. just some quick math: 128x128 px with RGBA is uncompressed 64kb 64kb x 30frames x 60 seconds is about 115200kb for just one minute and a little animated thumbnail.  actually i got it almost working. at least i got continous byte arrays coming out of my 'movie reader' which i could bind as a texture... i have no idea about performance yet
|
|
|
|
|
25
|
Java Game APIs & Engines / JOGL Development / Animated Texture with QT
|
on: 2003-11-27 11:17:03
|
hello i am trying to implement animated textures. has anyone experiences with that? right now i am thinking about using the Quicktime API, since it solves a lot of codec issues. is java fast enough for realtime decompression etc. anyone? 
|
|
|
|
|
27
|
Java Game APIs & Engines / JOGL Development / setFullScreenWindow() on OS X
|
on: 2003-10-02 09:50:57
|
i try to go to fullscreen mode with the setFullScreenWindow() but unfortunately i just get a white screen. as so often the same code works on a windows platform. has anyone expierenced the same problem? or better has anyone any solutions  ? ( BTW i am runnig a OS X 10.2 System )
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|