Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / Re: A few questions about Screenshot class usages on: 2006-05-11 09:40:51
Does this code display a textured quad on a GLCanvas?

I haven't got any experience of doing offscreen renderering of textured quads.

However there should be someone on these forums who can help you, or at least point you in the right direction.
2  Java Game APIs & Engines / JOGL Development / Re: A few questions about Screenshot class usages on: 2006-05-09 09:11:56
If the image is alright when your using GLCanvas it should work fine for pbuffer.

I am not sure what your doing exactly, but there are two ways of doing it that I think should work:

The way I have posted before where you add your glEventListener to the pbuffer, then call display, make sure the Screenshot.writeToFile() function is inside your GLEventListener.display().

The other option is to create your pbuffer with the right capabilities, make the context of the pbuffer current ( pbuffer.getContext().makeCurrent() ) for the thread your working on then call your glEventListener.init( pbuffer ), followed by glEventListener.display( pbuffer ), since this is not using the GLEventListener rendering loop, you can have the Screenshot.writeToFile() outside of the display() and in the same part of the code as the pbuffer creation. You will have to release the context ( pbuffer.getDrawable().release() ) after you have done the writeToFile() though.

If neither of these ways work, I would suggest you post some code, such as your glEventListener and also the code that creates the pbuffer etc. Then someone with more knowledge might be able to point you in the right direction.

I hope this helps.

Mike
3  Java Game APIs & Engines / JOGL Development / Re: Two GL Canvases screen capture issues. on: 2006-04-13 10:47:40
I do have an alternative that uses pbuffers, which works fine, but I was just trying this in case someone using the application does not have pbuffer support.

But if you think using the same GLEventListener should address the problem I will give it ago.

Thanks
Mike
4  Java Game APIs & Engines / JOGL Development / Two GL Canvases screen capture issues. on: 2006-04-12 11:01:48
Hi

I have been doing Screencapture using the TileRenderer classes, and have ran into a problem, if I create a GLCanvas (which has a GLEventListener attached to it)  with geometry being displayed in it, an image of this is attached as image1.jpg.

Then create a second GLCanvas (without a GLEventListener), in the top left corner of the screen overlapping the other canvas in which I use the TileRenderering class to do render the same geometry as in the first in order to get a higher resolution, also the canvases do not share contexts. An image of this is attached as image2.jpg.

The problem is that the glReadPixels call seems to be reading what is beneath the top canvas where the gl calls are being made, it is even renderering the swing gui components (that are beneath the canvas) of the application surrounding the first canvas. Example of the output is attached as image3.jpg.

The specification the machine this happens on is running linux (Red Hat Enterprise) using a jre 1.4.2_06, and the graphics card is a nVidia Quadro2 MXR/AGP/SSE2, supporting OpenGL 1.5.5  with the latest drivers: NVIDIA 81.78. I have run the same application on WindowsXP and there is no problems. The version of JOGL I am using is JSR-231 Beta 3.

Any help or suggestions in sorting this out would be great.

Thanks
Mike
5  Java Game APIs & Engines / JOGL Development / JOGL and Exceed3D on: 2006-04-03 10:18:10
Hi

I was wondering if anyone had any experience of running OpenGL applications over Exceed?

My problem is that I am trying to run a jogl application over a network using Exceed, the application runs fine over Exceed, including picking my problem arises when I try and do screen capture. Exceed seems to not support pbuffers properly, although it does not return false on canCreatePBuffer() call it does fail when the program attempts to create a pbuffer..
To get round this problem the program now makes a small window and does the tile rendering in there, the rendering works fine in this window,  the program uses the jogl "TileRenderer" classes but when I come to look at what the image that has been created it seems that the glReadPixels() call has failed.

I am assuming that this is because of Exceed, the glReadPixels() function is reading a different context to the one I am expecting. I was wondering if anyone could shed any more light on the problem and ideally suggest some settings that I could try in Exceed to allow the program to run properly?

Any help would be gratefully received.

Thanks
Mike
6  Java Game APIs & Engines / JOGL Development / Re: Need help with GLCapabilities when using pbuffer on: 2006-01-26 09:36:06
Dunno if this is any help but, I had problem with pbuffers, and the only capability i could get mine to work with my card were:

GLCapabilities cap = new GLCapabilities();
cap.setDoubleBuffered(false);

Doubt this is a problem but I also set the size of the pbuffer greater than the maximum the card allows it throws a glexception of:

pbuffer creation error: wglCreatePbufferARB() failed: tried 1 pixel formats, last error was: (Unknown error code 3519775730072748063)
7  Java Game APIs & Engines / JOGL Development / Re: A few questions about Screenshot class usages on: 2006-01-12 15:20:14
Hi

If you create a GLPBuffer somewhere in your program at the point you want to take the screenshot using the GLDrawableFactory, then add the same GLEventListener as you would for your GLCanvas and then call your offscreen to call display() then it should work. Also you would put the Screenshot code in your display() method,

Code something like this should work, where glEventListener is your own GLEventListener:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
offScreen = true;
offScreenCanvas = GLDrawableFactory.getFactory().createGLPbuffer(cap, new DefaultGLCapabilitiesChooser(), width, height, null);
offScreenCanvas.addGLEventListener( glEventListener );

outputFile = new File( dumpname );
// this causes all the events to fire
// Also screen capture is done inside the Display loop.
offScreenCanvas.display();

// tidy up the event listener - upto you to do this
offScreenCanvas.removeGLEventListener(this);
offScreenCanvas.destroy();


Something like this in your display method for glEventListener:

1  
2  
3  
4  
5  
6  
7  
8  
if ( offScreen ) {
  try {
       Screenshot.writeToFile( outputFile, screenDim.width, screenDim.height );
  }
  catch( IOException ioe ) {
       System.err.println( "Error Creating File: " + ioe.getMessage() );
  }
}


Hope this is some help

Mike
8  Java Game APIs & Engines / JOGL Development / PBuffer max size on: 2006-01-12 12:41:24
Hi

I am using a pbuffer to create a screenshot and have found that if I try to use the size of a pbuffer with a height or width bigger than 1024 I get the following exception:

Exception occurred during event dispatching:
javax.media.opengl.GLException: pbuffer creation error: wglCreatePbufferARB() failed: tried 1 pixel formats, last error was: (Unknown error code 0)
   at com.sun.opengl.impl.windows.WindowsPbufferGLDrawable.createPbuffer(WindowsPbufferGLDrawable.java:369)
   at com.sun.opengl.impl.windows.WindowsPbufferGLDrawable.<init>(WindowsPbufferGLDrawable.java:77)
   at com.sun.opengl.impl.windows.WindowsGLDrawableFactory$2.run(WindowsGLDrawableFactory.java:145)
   at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.maybeDoSingleThreadedWorkaround(WindowsGLDrawableFactory.java:212)
   at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.createGLPbuffer(WindowsGLDrawableFactory.java:162)

The code that creates the pbuffer looks like:

1  
2  
3  
GLCapabilities cap = new GLCapabilities();
cap.setDoubleBuffered(false);
offScreenCanvas = GLDrawableFactory.getFactory().createGLPbuffer(cap, width, height, null);


I am wondering if there is a way in querying opengl through jogl that will return what the max height/width that the pbuffer allows?

Any help would be much appreciated

Thanks
Mike
9  Java Game APIs & Engines / JOGL Development / Re: Question about classpath arguments causing conflicts on: 2005-12-23 15:55:29
The graphics card is an onboard Intel graphics card with the latest drivers (i think) but since its a pretty naff I am not surprised it doesn't work.

Thanks very much for clarifying the problem
Mike
10  Java Game APIs & Engines / JOGL Development / Question about classpath arguments causing conflicts on: 2005-12-22 10:30:58
Hi

I have been experimenting with JOGL and classpath arguments after i noticed that JOGL was using Generic Microsoft Drivers on my system.

I have noticed the classpath argument causing the effect is -Xmx, if i set the allocated heap to anything more than 750m, i.e. at 755m  the drivers used  by JOGL default to the Generic Microsoft Drivers with only support for OpenGL 1.1.0.

 I know that I shoudn't really set it too high unless its on a machine with a lot of memory (am using 512m)  but was wondering whether this is an issue with JOGL? or  just that by me setting the maximum heap size high relative to my pc's memory  it is causing conflicts on my system?

Any information to shed light on this would be greatfully recieved

Thanks
Mike
11  Java Game APIs & Engines / JOGL Development / Re: PBuffer Creation on: 2005-11-22 09:42:37
Thanks very much for the help and explanation.

Thanks
Mike
12  Java Game APIs & Engines / JOGL Development / PBuffer Creation on: 2005-11-18 10:19:06
Hi,

I have been having some problems when i try to create a PBuffer in the following code snippet, it is throwing an exception on the last line:

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  
  public synchronized void dumpImage(final int val, final int width, final int height, final String dumpname)
  {
    if (!GLDrawableFactory.getFactory().canCreateGLPbuffer()) {
      System.err.println("Error: canvas does not support off-screen drawables.");
      return;
    }

    boolean oldOffScreen = offScreen;

    offScreen = true;

    Dimension oldSize = new Dimension(screenDim);
    java.awt.Point oldScreenCorner = new java.awt.Point(screenCorner);

    screenDim.height = height;
    screenDim.width = width;

    screenCorner.x = 0;
    screenCorner.y = 0;

    GLCapabilities cap = new GLCapabilities();

    setCapabilities(cap, false, true);

    // Creates an offscreen canvas with an empty context that gets created later.
   final GLPbuffer offScreenCanvas = GLDrawableFactory.getFactory().createGLPbuffer(cap, width, height, null);


Where setCapabilitiies() is:

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  
  private final void setCapabilities(GLCapabilities cap, final boolean stereo, final boolean offScreen) {
    cap.setDepthBits(24);
    // 24 bit colour:
   cap.setRedBits(8);
    cap.setBlueBits(8);
    cap.setGreenBits(8);
    cap.setAlphaBits(8);

    cap.setAccumRedBits(16);
    cap.setAccumGreenBits(16);
    cap.setAccumBlueBits(16);
    cap.setAccumAlphaBits(16);

    // we only need one stencil bit. But we'll see how many we get...
   cap.setStencilBits(8);

    if (offScreen) // Off screen renderring
     cap.setDoubleBuffered(false);
    else {
      cap.setDoubleBuffered(true);
      // Uncomment this for stereo visual
     if(stereo)
        cap.setStereo(true);
    }
  }


I get the following exception:

Exception occurred during event dispatching:
javax.media.opengl.GLException: pbuffer creation error: Couldn't find a suitable pixel format
   at com.sun.opengl.impl.windows.WindowsPbufferGLDrawable.createPbuffer(WindowsPbufferGLDrawable.java:285)
   at com.sun.opengl.impl.windows.WindowsPbufferGLDrawable.<init>(WindowsPbufferGLDrawable.java:77)
   at com.sun.opengl.impl.windows.WindowsGLDrawableFactory$2.run(WindowsGLDrawableFactory.java:145)
   at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.maybeDoSingleThreadedWorkaround(WindowsGLDrawableFactory.java:212)
   at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.createGLPbuffer(WindowsGLDrawableFactory.java:162)
   at com.baesystems.cfdsystems.draw.JOGL_GLwnd.dumpImage(JOGL_GLwnd.java:278)
   at com.baesystems.cfdsystems.draw.GLwnd.setDump(GLwnd.java:2257)

I have no experience of pbuffers and am not sure why it is throwing this exception.

The pc i am running this on is a Windows XP machine with the following graphics settings:

Graphics Card Vendor: Intel
Graphics Card Version: Intel 915G
OpenGL Version: 1.4.0 - Build 4.14.10.4396

Any help or suggestions would be greatfully recieved.

Thanks
Mike
13  Java Game APIs & Engines / Tools Discussion / Re: JBuilder IDE used to show red error mesages while editing my code on: 2005-10-06 16:25:19
It sounds like you turned it off Smiley

To check go to Tools->Preferences

Then to the Editor section, in the part Error Indication make sure all 3 tick boxes are selected, that should highlight errors.
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (18 views)
2014-07-29 18:09:19

Riven (13 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (31 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (41 views)
2014-07-23 21:16:32

Riven (28 views)
2014-07-23 21:07:15

Riven (29 views)
2014-07-23 20:56:16

ctomni231 (60 views)
2014-07-18 06:55:21
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!