Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
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  
  Page Flipping and Tearing  (Read 1439 times)
0 Members and 1 Guest are viewing this topic.
Offline swallace

Junior Newbie





« Posted 2007-04-11 22:23:40 »

HI,

 I'm using Java 6 to do some simple physics simulation.  The application is running inside as frame (not fullscreen exclusive) and I'm getting what appears to be tearing.  However, the graphics configuration tells me that the offscreen buffer to which I'm drawing is using page flipping (specifically the buffer strategy is java.awt.Component$FlipSubRegionBufferStrategy...).  In theory, the page flipping should be synced to vertical retrace, and I shouldn't get any tearing, but that doesn't seem to be the case.  Any thoughts on the matter would be appreciated.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 803
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2007-04-11 22:36:49 »

Pageflipping is not linked in any way to vsync.

You can flip a pointer to the framebuffer at any interval.


I don't know how to get vsync in Java2D, but I suppose others do.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Jeff

JGO Coder




Got any cats?


« Reply #2 - Posted 2007-04-11 23:09:32 »

Page flipping in full screen is vsynched if your cards DirectDraw driver supports it and you've got enough graphics card memory to hold the pages.

It is impossible to vsynch  "page flipping" of windows in the Win32 architecture (unlike the Amiga where you could program things to happen on a given scan-line.)

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #3 - Posted 2007-04-11 23:29:34 »

IIRC you *may* get vsync and page flipping if you use BufferStrategy in fullscreen exclusive mode, but even then you can't force it. If you're running windowed you're out of luck.

OpenGL stuff can vsync in windowed though, so perhaps try enabling the OpenGL pipeline and see if you get lucky.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Abuse

JGO Knight


Medals: 12


falling into the abyss of reality


« Reply #4 - Posted 2007-04-12 00:40:53 »

I seem to remember someone had a bit of (native) code that would give you the capability to listen for the vsync signal, even in windowed mode...

Can't remember where I saw it now... somewhere on this forum.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline CommanderKeith
« Reply #5 - Posted 2007-04-12 03:15:18 »

Hi,

There's some info about this here:  http://www.java-gaming.org/forums/index.php?topic=14696.0

Kevin Glass has some native code to do page flipping which he gives in that link. 

OrangyTang is right about page flipping, and also you must have 2 buffers or more with your BufferStrategy.

By the way, the BufferCapabilities are broken and still haven't been fixed as far as I know so don't rely on them to find out if you're image is accelerated.  Dmitri Trembovetski of the Java2D team pointed this out in the Java2D forum here at JGO a little while ago  Smiley.  I could dig up the link if you want.

Keith

Offline Jeff

JGO Coder




Got any cats?


« Reply #6 - Posted 2007-04-13 00:33:33 »


By the way, the BufferCapabilities are broken and still haven't been fixed as far as I know so don't rely on them to find out if you're image is accelerated. 

well, don't quote me, and Dmitri definitely knows more about this then I do BUT

In a number of cases like this ist not really the Java code thats broken-- its the crappy video card maker supplied DirectDraw drivers.  They lie to the Java API and the API has no way of knowing its a lie.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
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.

Pippogeek (40 views)
2014-09-24 16:13:29

Pippogeek (31 views)
2014-09-24 16:12:22

Pippogeek (21 views)
2014-09-24 16:12:06

Grunnt (47 views)
2014-09-23 14:38:19

radar3301 (29 views)
2014-09-21 23:33:17

BurntPizza (65 views)
2014-09-21 02:42:18

BurntPizza (37 views)
2014-09-21 01:30:30

moogie (44 views)
2014-09-21 00:26:15

UprightPath (53 views)
2014-09-20 20:14:06

BurntPizza (55 views)
2014-09-19 03:14:18
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!