Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Adding two Canvas3d's to a View doesn't work  (Read 1563 times)
0 Members and 1 Guest are viewing this topic.
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Posted 2004-12-04 16:36:47 »

Hi

I wan't to have two or more Canvases attached to a View, but always, when I execute it an error occures:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
        RenderPeer rp = new RenderPeerImpl();
        CanvasPeer cp = rp.makeCanvas(null,440, 480, 32, false);
        Canvas3D canvas = new Canvas3D();
        canvas.set3DPeer(cp);
        view.addCanvas3D(canvas);
       
        //RenderPeer rp2 = new RenderPeerImpl();
       CanvasPeer cp2 = rp.makeCanvas(null,440, 480, 32, false);
        Canvas3D canvas2 = new Canvas3D();
        canvas2.set3DPeer(cp2);
        view.addCanvas3D(canvas2);
       
        view.getTransform().lookAt(
        new Vector3f(0,0,2.41f), //location of eye
       new Vector3f(0,0,0),     //center of view
       new Vector3f(0.0f,0.6f,0.0f));    //vector pointing up
       view.startView();
        while(true) {
            view.renderOnce();
        }


#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000, pid=3632, tid=2204
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0-b64 mixed mode, sharing)
# Problematic frame:
# C  0x00000000
#
# An error report file with more information is saved as hs_err_pid3632.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Exception in thread "main" net.java.games.jogl.GLException: Attempt to call setRenderingThread on more than one drawable in this thread
       at net.java.games.jogl.impl.GLContext.setRenderingThread(GLContext.java:323)
       at net.java.games.jogl.GLCanvas.setRenderingThread(GLCanvas.java:140)
       at com.xith3d.render.jogl.CanvasPeerImpl.render(CanvasPeerImpl.java:1148)
       at com.xith3d.scenegraph.View.renderOnce(View.java:605)
       at com.xith3d.scenegraph.View.renderOnce(View.java:538)




am I doing something wrong??

thanks

Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline ewills

Junior Member




Java skeletal animation systems rock!


« Reply #1 - Posted 2004-12-04 20:38:30 »

I have had a similar problem when trying to add multiple ViewS to a VirtualUniverse.  The virtual machine crashes on my nvidia-based systems, but not with my ATI-based ssystems.  It seems like this is a JOGL issue.  Hopefully it will get fixed at some point.  Has anyone else had similar problems?
Offline Yuri Vl. Gushchin

Senior Member




Speak Java!


« Reply #2 - Posted 2004-12-05 12:09:17 »

Hi,

I was able to run several canvases on different screens and with two different rendering threads. This seems to be a reason - something is happening with makeCurrent() calls.

Do you have a test case? -> IssueZilla

Yuri

Yuri Vl. Gushchin
JProof Group
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline LaLiLuLeLo

Senior Newbie




Foooocus!


« Reply #3 - Posted 2004-12-06 13:17:39 »

i've been mulling over this issue for a while now. In my case, only one canvas renders correctly and the other is distorted.
Please can you release your source for displaying multiple canvases?
Thanks
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #4 - Posted 2004-12-06 13:34:33 »

Hi

Quote

i've been mulling over this issue for a while now. In my case, only one canvas renders correctly and the other is distorted.  


when I've got two different Views, both canvases display fine for me.

Quote

Please can you release your source for displaying multiple canvases?


Just change the second time I use view to view2 and add it to your virtualUniverse.

Ohh... and you only need to call view.renderOnce() only for view, not for view2. Strange isn't it ?

Quote

I have had a similar problem when trying to add multiple ViewS to a VirtualUniverse.  The virtual machine crashes on my nvidia-based systems, but not with my ATI-based ssystems

I use ATI

:: JOODE :: Xith3d :: OdeJava ::
Offline LaLiLuLeLo

Senior Newbie




Foooocus!


« Reply #5 - Posted 2004-12-06 14:10:07 »

hello arne ... thanks for the tips, I tried it out but only one view renders and the other doesn't and sometimes, the other renders and the first doesn't. Have you run into this? This is the code

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  
               RenderPeer rp = new RenderPeerImpl(); 
               CanvasPeer cp = rp.makeCanvas(null,440, 480, 32, false);
               Canvas3D canvas = new Canvas3D();
               canvas.set3DPeer(cp);
               view.addCanvas3D(canvas);
                
               //RenderPeer rp2 = new RenderPeerImpl();
              CanvasPeer cp2 = rp.makeCanvas(null,640, 480, 32, false);
               Canvas3D canvas2 = new Canvas3D();
               canvas2.set3DPeer(cp2);
               view2.addCanvas3D(canvas2);
                
               view.getTransform().lookAt(      new Vector3f(0, 20, 1.0f), //Loc Camera
                             new Vector3f(0, 0, 0), //COV
                             new Vector3f(0, 1, 0)); //Up Vector
              view2.getTransform().lookAt(      new Vector3f(0, 50, 1.0f), //Loc Camera
                             new Vector3f(0, 0, 0), //COV
                             new Vector3f(0, 1, 0)); //Up Vector
             
              
               view.startView();
               view2.startView();
              
                              
               while(true) {
              view.renderOnce();
              
               }
                


Edit:
If I ask it to render both views, I sometimes get the distortion I was speaking of earlier...
Edit #2:
It renders both views correctly sometimes   :-/
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #6 - Posted 2004-12-06 14:56:11 »

Hi LaLiLuLeLo

It works fine at my computer. I had never any distortions.
Maybe it's something like ewills was speaking of. What kind of system do you use?

Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline LaLiLuLeLo

Senior Newbie




Foooocus!


« Reply #7 - Posted 2004-12-06 15:59:17 »

I use Windows XP, ATI Radeon 9800 Pro
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #8 - Posted 2004-12-06 17:15:14 »

mmh.. I too have XP, but ATI Radeon 9000 Series.

So there's still the case with different graphic-cards, but i think it should be minimal.

At the moment I really have no idea :-/

Hopefully somebody else has an idea

Arne

Edit: Maybe you should update xith (it could be a bug that is fixed by now)

:: JOODE :: Xith3d :: OdeJava ::
Offline khangharoth

Junior Member




There is more to life than JAVA...But Java Rocks


« Reply #9 - Posted 2006-01-07 12:32:23 »

I am trying to have multiple Canvas....but getting this exception

Exception in thread "AWT-EventQueue-0" net.java.games.jogl.GLException: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: error code -1073283059
   at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:464)
   at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:230)
   at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:136)
   at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:129)
   at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:246)
   at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.invokeGL(WindowsOnscreenGLContext.java:76)
   at net.java.games.jogl.GLCanvas$2.run(GLCanvas.java:130)
   at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Error Making WGLC Current: 0
Error Making WGLC Current: -1073278755
Error Making WGLC Current: -1073278755
Exception in thread "main" net.java.games.jogl.GLException: java.lang.reflect.InvocationTargetException
   at net.java.games.jogl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:233)
   at net.java.games.jogl.GLCanvas.display(GLCanvas.java:77)
   at com.xith3d.render.jogl.CanvasPeerImpl.render(CanvasPeerImpl.java:1256)
   at com.xith3d.scenegraph.View.renderOnce(View.java:604)
   at com.xith3d.scenegraph.View.renderOnce(View.java:537)
   at com.lorts.rebar.visualization.XithScreen.loop(XithScreen.java:183)
   at com.lorts.rebar.ui.frame.MainScreenFrame.main(MainScreenFrame.java:68)
Caused by: java.lang.reflect.InvocationTargetException
   at java.awt.EventQueue.invokeAndWait(Unknown Source)
   at net.java.games.jogl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:228)
   ... 6 more
Caused by: net.java.games.jogl.GLException: Unable to enumerate pixel formats of window using wglGetPixelFormatAttribivARB: error code -1073283059
   at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:464)
   at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.create(WindowsOnscreenGLContext.java:230)
   at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:136)
   at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:129)
   at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:246)
   at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.invokeGL(WindowsOnscreenGLContext.java:76)
   at net.java.games.jogl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:266)
   at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
Error Making WGLC Current: -1073278755


my code is very similar to the Arne post  ...
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
                RenderPeer renderPeer = new RenderPeerImpl();   
      canvasPeer = renderPeer.makeCanvas(this,this.width, this.height, 16,false);
      canvas = new Canvas3D();      
      this.canvasPeer.getRenderOptions().setOption(Option.ERROR_CHECK, true);
      canvas.set3DPeer(canvasPeer);
     
        RenderPeer rp2 = new RenderPeerImpl();
          CanvasPeer cp2 = rp2.makeCanvas(null,440, 480, 16, false);
          Canvas3D canvas2 = new Canvas3D();
          canvas2.set3DPeer(cp2);
          view2.addCanvas3D(canvas2);


my requirement is have one canvas in a Parent (Panel) and another one does not have a parent...

not able to figure out what exactly i am doing wrong.

Also if i need to have multiple canvas ..do i have to render them in seperate threads...

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (40 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!