Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (778)
Games in Android Showcase (231)
games submitted by our members
Games in WIP (856)
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  
  Vertical Retrace  (Read 5370 times)
0 Members and 1 Guest are viewing this topic.
Offline Max Pesce

Junior Devvie




Nil tam arduum quod non ingenio vincas


« Posted 2003-07-29 05:09:43 »

Hi

Anyone nows a way to detect screen vertical retrace
in Java?

My games flicker a lot in windowed modes...

Offline Orangy Tang

JGO Kernel


Medals: 57
Projects: 11


Monkey for a head


« Reply #1 - Posted 2003-07-29 05:55:37 »

Start by looking into BufferStratergy, that will do what you want. Theres a million and one threads on it lying around here somewhere...

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

Junior Devvie




Nil tam arduum quod non ingenio vincas


« Reply #2 - Posted 2003-07-29 12:24:54 »


My previous post was not so clear...

There's a way to synchronize the graphics refresh
of an APPLET or a windowed app with the screen
vertical retrace?

I'm using BufferyStrategy ONLY for fullscreen mode,
not for applets or windowed apps.

I cannot find other threads on the subject, so please
excuse my dumb question...


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #3 - Posted 2003-07-30 02:18:54 »

Are you using double-buffering in windowed mode, or are you rendering directly to the screen?

also, you can use BufferStrategy in windowed mode as well as in fullscreen mode, so you won't have to change the code. Youmight want to be careful with resizing the window, though.
Offline Max Pesce

Junior Devvie




Nil tam arduum quod non ingenio vincas


« Reply #4 - Posted 2003-07-30 05:44:11 »

I'm using a double-buffered system, with a VolatileImage as back buffer.

I can use a BufferStrategy also for windowed mode, and this <should> prevent (as you say?) graphics flicker.

My library is able to generate games for windowed mode, fullscreen mode and online mode (applets).

But I'm very interested in online games, so what can I do with APPLETS?

There isn't a way to check Vertical retrace without using BufferStrategy?
And maybe without using native code?

Maybe I already know the answer: NO Smiley


I used the term "flicker" to mean a strange visual effect that happens especially with graphic scrollings.
It is very difficult to notice it with a static screen game.



Offline Abuse

JGO Ninja


Medals: 70


falling into the abyss of reality


« Reply #5 - Posted 2003-07-30 05:53:09 »

Applets can use BufferStrategy as well,

You just have to add a Canvas, then use that for your createBufferStrategy/getBufferStrategy calls.

Infact, it makes sense to use a Canvas in all cases, regardless of whether its an application or Applet.

As to catching the VBlank when in windowed mode, I'm pretty sure its not possible.
I think I heard somewhere that it wasn't possible even with native code under windows? (any1 who can confirm/deny that rumor, pls correct me)
Offline Max Pesce

Junior Devvie




Nil tam arduum quod non ingenio vincas


« Reply #6 - Posted 2003-07-30 07:01:35 »


So as you say there's NO WAY to reduce flickering
in APPLETS?

What I'll gain using buffer strategy for applets?

I hope Sun will fix this problem (and maybe the timer)
in the next release!

Many thanks

Offline Abuse

JGO Ninja


Medals: 70


falling into the abyss of reality


« Reply #7 - Posted 2003-07-30 10:42:29 »

well if you use BufferStrategy, you gain the *potencial* of it being vsynced.

It isn't at the moment, but may be in the future/on other platforms.

That does raise 1 issue. What happens if you don't want to wait for the vblank signal :p

Most native games have an option to toggle vsync on or off. With the current BufferStrategy API, there is no facility to control whether you get vsync or not.
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #8 - Posted 2003-07-30 12:50:02 »

Are you getting "flickering" or just "tearing"??

Tearing being a horizontal "tear" in the image when the vertical scan crosses over during your image blit so that the top part of the screen is refreshed with the old image and the bottom part is drawn with the new image.)

Flickering being flashes of images in an intermediate state (like a cleared background colour).

You should only be getting tearing without syncing to the vertical retrace.  If you are getting flickering it could be that your painting needs to be double buffered.

Offline Max Pesce

Junior Devvie




Nil tam arduum quod non ingenio vincas


« Reply #9 - Posted 2003-07-31 06:10:54 »


Yes...

I'm only getting a tear effect.

So for now, no way to eliminate it...

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #10 - Posted 2003-08-01 03:37:14 »

it sounds like your copies from the backbuffer to the screen are not accelerated for some reason.
Run your app with primitives tracing turned on and see if that's the problem:
java -Dsun.java2d.trace=log YourClass
(you can search the forum for this flag to get more info)

Run
java -Dsun.java2d.trace=help YourClass
to get help.
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #11 - Posted 2003-08-01 13:29:03 »

Quote
[...]
As to catching the VBlank when in windowed mode, I'm pretty sure its not possible.
I think I heard somewhere that it wasn't possible even with native code under windows? (any1 who can confirm/deny that rumor, pls correct me)


I *thought* it's impossible... but I've seen some emulators, wich are able to catch the vsync signal in windowed mode.

Well... I still don't know how to do that ... esp in java - but I guess it's not possible there.

弾幕 ☆ @mahonnaiseblog
Offline GergisKhan

Junior Devvie




&quot;C8 H10 N4 O2&quot;


« Reply #12 - Posted 2003-08-01 14:39:02 »

I was always under the impression that in windowed (Windows? hmmm) mode, the operating system has final control and authority over the vblank signal, as most of the redraw is "hidden" from the applicaton/game developer.  I do not have a background using DirectX, so I don't know if this rule is valid if you use DirectX in windowed mode (is this even possible?)  Therefore, I'm inclined to say that unless part of the Java platform's native DLLs change to intercept this signal in windowed mode, it's not going to be available to us.  Furthermore, I'm not even sure it can be intercepted in windowed mode.  Can any DirectX experienced user add some illumination?

gK

"Go.  Teach them not to mess with us."
          -- Cao Cao, Dynasty Warriors 3
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #13 - Posted 2003-08-01 23:27:33 »

Quote
I was always under the impression that in windowed (Windows? hmmm) mode, the operating system has final control and authority over the vblank signal, as most of the redraw is "hidden" from the applicaton/game developer.

I don't have DirectX experience, but I have plenty of video experience.  The vertical retrace is not controled directly by the OS.  Once you choose the display refresh rate (typically 60Hz and higher) that is the cycle the video card will be on.  The video display hardware will lock to it and keep it steady.  It doesn't change.

The video drivers should provide access to a hardware interrupt that happens at the top of the rescan.  I assume that this is accessible through DirectX so you can schedule things to happen at that point.  It may be that you have to have full control of the display for that to happen - i.e. be in full screen mode.  But that would be really stupid (so it is likely how Microsoft implemented it Smiley )   Actually i know that MS is aware that syncing blits to the vertical retrace is important.. If you are watching video in a window for instance you don't want a tear through the middle.  I suspect there is a way, but I don't know the minimum version of DirectX that allows it.

Offline Max Pesce

Junior Devvie




Nil tam arduum quod non ingenio vincas


« Reply #14 - Posted 2003-08-02 06:47:58 »

I've a lot of experience with DirectX <=7 and also with them was not possible to catch VSync in windowed mode.

Many years ago in DOS, using few simple assembly instructions you could sync with the refresh signal.

I'm not sure that now is possibbile to catch the signal in a simple and "legal" (I mean without strange OS accesses) way.

Pages: [1]
  ignore  |  Print  
 
 

 
hadezbladez (377 views)
2018-11-16 13:46:03

hadezbladez (198 views)
2018-11-16 13:41:33

hadezbladez (380 views)
2018-11-16 13:35:35

hadezbladez (93 views)
2018-11-16 13:32:03

EgonOlsen (2195 views)
2018-06-10 19:43:48

EgonOlsen (2245 views)
2018-06-10 19:43:44

EgonOlsen (1387 views)
2018-06-10 19:43:20

DesertCoockie (2025 views)
2018-05-13 18:23:11

nelsongames (1691 views)
2018-04-24 18:15:36

nelsongames (2337 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
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!