Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
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  
  makeCurrent problem  (Read 1851 times)
0 Members and 1 Guest are viewing this topic.
Offline DavidYazel

Junior Member




Java games rock!


« Posted 2003-07-27 23:48:13 »

Question 1:

Is it legal to call canvas.display()  (where canvas is a GLDrawable) from any thread and at any time if all my GL calls are done inside the display(GLDrawable) callback?  In other words if JOGL is in the middle of repainting for some reason outside my control, like handling an OS requested repaint, does it properly block the request to display until it can?

Question 2:

Every time I move a window over my frame which contains the GLDrawable I get the following:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
net.java.games.jogl.GLException: Error making context current
        at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(Windows
GLContext.java:125)
        at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent
(WindowsOnscreenGLContext.java:110)
        at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:162)
        at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:196)
        at net.java.games.jogl.GLCanvas.display(GLCanvas.java:91)
        at net.java.games.jogl.GLCanvas.paint(GLCanvas.java:102)
        at sun.awt.RepaintArea.paint(RepaintArea.java:177)
        at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:260)
        at java.awt.Component.dispatchEventImpl(Component.java:3678)
        at java.awt.Component.dispatchEvent(Component.java:3477)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)


There seems to be nothing I can do to stop it.

Question 3:

If I draw a frame and then the window needs to be redrawn due to a OS level repaint why does the window go white in the occluded areas and never refreshed?

This is true even if I am sitting in a loop in my main thread doing a canvas.display() over and over.


David Yazel
Xith3D Project Founder
http://xith3d.dev.java.net

It may look complicated, but in the end it is just a bunch of triangles
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #1 - Posted 2003-07-28 02:01:42 »

Quote
Question 1:

Is it legal to call canvas.display()  (where canvas is a GLDrawable) from any thread and at any time if all my GL calls are done inside the display(GLDrawable) callback?  In other words if JOGL is in the middle of repainting for some reason outside my control, like handling an OS requested repaint, does it properly block the request to display until it can?


Yes, the proper synchronization is done internally to handle this. Note that currently the implementation can't handle calling the display() method of a drawable while you're inside the display() method of another (or the same one). Unfortunately this restriction isn't documented but fixing it is high on the list of things to do.

Quote

Question 2:

Every time I move a window over my frame which contains the GLDrawable I get the following:

(snip)


I haven't seen a problem like this. Look at any of the jogl-demos demonstrations; they don't seem to exhibit this problem. If you can boil it down to a small test case and it looks like valid code then please file a bug.

Quote

Question 3:

If I draw a frame and then the window needs to be redrawn due to a OS level repaint why does the window go white in the occluded areas and never refreshed?

This is true even if I am sitting in a loop in my main thread doing a canvas.display() over and over.



Haven't seen this problem. Many of the demos use either the Animator or setRenderingThread() / setNoAutoRedrawMode() directly to get around multithreaded repainting issues, but unless you're doing something complicated with pbuffers (which some of the demos, like HWShadowmapsSimple and ProceduralTexturePhysics do) then having a repaint request come in every now and then shouldn't matter.
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #2 - Posted 2003-07-28 20:14:40 »

I have seen this happen on WindowsXP, particularly when the screen is occluded by other Java components such as Swing controls (see Wurm Client).

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #3 - Posted 2003-07-28 23:37:25 »

Maybe you should disable Swing's use of DirectX so OpenGL can play nice with the graphics card.

Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #4 - Posted 2003-07-28 23:51:47 »

I will resist the urge to get on my soap box and ask 'who in the heck though it was a good idea to put a platform specific API into a multiplatform system.'

I any event I will take a look at which options are necessary to turn off DirectX rendering in Swing.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #5 - Posted 2003-07-29 03:19:53 »

Specify -Dsun.java2d.noddraw=true on the command line.
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #6 - Posted 2003-07-29 14:12:33 »

BTW, I discussed this a bit with some guys from the Java2D team (Chet) and they mentioned that the OpenGL acceleration for Java2D that is meant primarily for Linux will likely happen on Windows as well.. then having OpenGL as the main path to accelerated rendering will make it play nice with JOGL etc..  It is also encouraging because this may mean that OpenGL bindings will become part of the core.

They will keep DirectX acceleration simply because of the quality issues with OpenGL support in many graphics drivers. DX is often better supported.

I think this is targeted for 1.5.

Archimedes
Guest
« Reply #7 - Posted 2003-07-29 15:52:00 »

Quote

(..) then having OpenGL as the main path to accelerated rendering will make it play nice with JOGL etc..  It is also encouraging because this may mean that OpenGL bindings will become part of the core. (..)

You made my day! :-)
Very good "probably" news. :-)
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.

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

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

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

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

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

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

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
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!