Which thread calls startImmediate()? Java 3D 1.1.2 can only handle
GraphicsContext3D calls from Canvas3D callback methods. So, if the
readRaster() call is being made from somewhere else, then this is most
likely the problem. If you need to signal a readRaster() from another
thread, the workaround is to set a flag, and then check the flag and do
the readRaster() from a Canvas3D callback.
This limitation will be fixed in Java 3D 1.2.
Doug Twilleager
Java 3D Team
> X-Sender: [EMAIL PROTECTED]
> MIME-Version: 1.0
> Subject: [JAVA3D] GraphicsContext3D.readRaster() problem - PLEASE HELP!!
> To: [EMAIL PROTECTED]
>
> I'd really appreciate some help with a problem I'm having with the
> readRaster method in GraphicsContext3D.
>
> I have a class which extends Canvas3D with a method to get a background
> image for immediate mode rendering. When I use readRaster(), I get an
> exception:
>
> "Unhandled exception in javaw.exe (OPENGL32.DLL) 0x0000005: Access violation"
>
> The code leading up to readRaster in the method is pretty much identical to
> Doug Gehringer's MixedImmediate examples, which run without any problems at
> all:
>
>
> class MarkingCanvas3D extends Canvas3D
> {
> ImageComponent2D backgroundImageComponent;
> Raster backgroundRaster;
> Dimension canvasSize;
> ...
> ...
>
> public void startImmediate()
> {
> stopRenderer();
>
> canvasSize = getSize();
>
> if( (backgroundImageComponent==null) || (backgroundRaster==null) ||
> (canvasSize.width != backgroundImageComponent.getWidth()) ||
> (canvasSize.height != backgroundImageComponent.getHeight()) ) {
> backgroundImageComponent = new
> ImageComponent2D(ImageComponent.FORMAT_RGB, canvasSize.width,
> canvasSize.height);
>
> backgroundRaster = new Raster( rasterPoint, Raster.RASTER_COLOR, 0, 0,
> canvasSize.width, canvasSize.height, backgroundImageComponent, null);
> }
> //read the current background image into the raster
> getGraphicsContext3D().readRaster(backgroundRaster);
> ...
> ...
> }
> }
>
> I can't figure out what's going wrong. Can anyone help?
>
> Thanks,
>
> Richard
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".