Show Posts
|
|
Pages: [1]
|
|
1
|
Java Game APIs & Engines / JOGL Development / Re: Profile GL_DEFAULT is not available on null, but: []
|
on: 2011-12-14 11:07:07
|
Ok, I've tried 1
| GLProfile glp = GLProfile.getMaxFixedFunc(); |
but the problem is still there: More info about the user's configuration: OS = "Leopard" Version : Mac OS X 10.5.8 (9L31a) Kernel Version : Darwin 9.8.0 same user has been sucesfully using my program on a "snow leopard" system where is the "official" jogl forum? I tought it was this one... thanks, Loic
|
|
|
|
|
3
|
Java Game APIs & Engines / JOGL Development / Profile GL_DEFAULT is not available on null, but: []
|
on: 2011-12-13 07:34:47
|
Dear all, one of my user is experiencing the following error: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
| at javax.media.opengl.GLProfile.get(GLProfile.java:643) at javax.media.opengl.GLProfile.getDefault(GLProfile.java:466) at javax.media.opengl.GLProfile.getDefault(GLProfile.java:474) at jfrog.Displayer.<init>(Displayer.java:117) at jfrog.Displayer.main(Displayer.java:166) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.javaws.Launcher.executeApplication(Launcher.java:1914) at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1847) at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1609) at com.sun.javaws.Launcher.run(Launcher.java:138) at java.lang.Thread.run(Thread.java:680) |
Displayer line 117, is the first one of that block, it doesn't seems to be very complex... 1 2 3 4 5 6 7
| GLProfile glp = GLProfile.getDefault(); GLCapabilities caps = new GLCapabilities(glp); caps.setDoubleBuffered(true); System.out.printf("%s\n", caps.toString()); GLCanvas canvas = new GLCanvas(caps); |
the user is running on a mac, but I don't have more details... anyone has any experience about this? Thanks in advance for sharing the tricks, Loic
|
|
|
|
|
4
|
Java Game APIs & Engines / JOGL Development / Re: FBO and overlay
|
on: 2011-12-06 08:10:11
|
I solved my problem... I made a MyOverlay Class that is just a copy paste of the standard overlay, except that it stores it's own dimension instead of forcing to use the Drawable dimension... One simply need to give the right dimension to the overlay after a reshape. 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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
| public class MyOverlay{ private GLDrawable drawable; private TextureRenderer renderer; private boolean contentsLost; private int width; private int height;
public MyOverlay(GLDrawable drawable) { this.drawable = drawable; this.width = drawable.getWidth(); this.height = drawable.getHeight(); }
public Graphics2D createGraphics() { validateRenderer(); return renderer.createGraphics(); }
public boolean contentsLost() { return contentsLost; }
public void markDirty(int x, int y, int width, int height) { renderer.markDirty(x, y, width, height); }
public void drawAll() throws GLException { beginRendering(); draw(0, 0, this.width, this.height); endRendering(); }
public void beginRendering() throws GLException { renderer.beginOrthoRendering(this.width, this.height); }
public void endRendering() throws GLException { renderer.endOrthoRendering(); }
public void draw(int x, int y, int width, int height) throws GLException { draw(x, y, x, y, width, height); }
public void draw(int screenx, int screeny, int overlayx, int overlayy, int width, int height) throws GLException { renderer.drawOrthoRect(screenx, screeny, overlayx, overlayy, width, height); } public void setSize(int width, int height){ this.width = width; this.height = height; }
private void validateRenderer() { if (renderer == null) { renderer = new TextureRenderer(this.width, this.height, true); contentsLost = true; } else if (renderer.getWidth() != this.width || renderer.getHeight() != this.height) { renderer.setSize(this.width, this.height); contentsLost = true; } else { contentsLost = false; } } } |
|
|
|
|
|
5
|
Java Game APIs & Engines / JOGL Development / Re: FBO and overlay
|
on: 2011-12-05 18:02:08
|
|
1) is it going to solve my problem? I don' think so... right? 2) as I said, I need to take high resolution screenshot typical size is 5000x5000 pixels, while my program is running with a different resolution rest of the time 3) as far as I understand it, the screenshot utility class is doing nothing but reading the pixel buffer (exactly as I do) and saving it's content (exactly as I do). So the question is rather... what do I gain if using the screenshot class? Loic,
|
|
|
|
|
6
|
Java Game APIs & Engines / JOGL Development / FBO and overlay
|
on: 2011-12-04 19:41:24
|
|
Dear all,
In my code, I need to take very high resolution (more than 2000x2000 pixels) screenshot of the rendered scene, Note that in the display function rendering my scene, I also have some overlay stuff.
My code looks like this:
------------------------------------------------- //FBO INIT AND BINDING
reshape(canvas, 0, 0, width, height); display(canvas); overlay.markDirty(0, 0, width, height); reshape(canvas, 0, 0, canvas.getWidth(), canvas.getHeight()); overlay.markDirty(0, 0, canvas.getWidth(), canvas.getHeight());
// READ FBO PIXELS AND SAVE TO FILE -------------------------------------------------
the reshape function does nothing except redefining the glViewport and gluPerspectives
My problem is, that the overlay drawing doesn't seem to have been updated... I still have the overlay from the previous drawing loop (low resolution). Despite the fact that I have a call to overlay.drawAll() at the very end of my display loop and that I make my objects dirty
I suspect the problems comes from the fact that "overlay.drawAll()" is likely not drawing the overlay when the funciton call but maybe slightly later... is it correct? is there a solution to my problem? or should I rewrite my code to avoid the usage of the overlay
thanks in advance, Loic
|
|
|
|
|
10
|
Java Game APIs & Engines / JOGL Development / TextureIO.newTexture with remote (http) files
|
on: 2011-11-13 08:57:48
|
Hi all, I am trying to create a new tecture from a remove file on the net with the following code snippet, 1 2 3 4 5 6 7 8 9 10
| try { System.out.println("Getting the URL\n"); URL url = new URL("http://people.na.infn.it/~carrillo/rpc/frog/crop/637566997.png"); System.out.println("Getting the Texture\n"); texture = TextureIO.newTexture(url, false, "png"); } catch (IOException exc) { exc.printStackTrace(); System.exit(1); } |
but its basically stuck for ever at the newTexture line... Same code with local file works like a charm... And the URL is fine and I am getting the image instataniously in my web browser, so... What did I miss? Thanks, Loic
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|