Full screen question

can i use awt tools in full screen mode?
like button, panel, etc
or how to make button in full screen?
can i register the button to action listener?

and how to put panel in east (borderlayout.east)?

newbie in fullscreen :stuck_out_tongue:

If you are using full screen exclusive mode to draw onto a buffer or something like that, it takes over the entore JFrame (or frame), so even if you did somehow add stuff to it your graphics would write over it.

one of the disadvantages when going for the fullscreen exclusive mode is that you can’t use the traditional swing and awt interfaces… you need to write your own.

oops ::slight_smile:

you can use awt/swing components fine in fullscreen :stuck_out_tongue:

i was assuming he wanted to also use some kind of bufferstrategy thing. can that be done?

[quote]i was assuming he wanted to also use some kind of bufferstrategy thing. can that be done?
[/quote]
ah, your right then :smiley: (well - kinda…)

awt/swing stuff uses passive rendering, BufferStrategy is strictly an active rendering system.

However, you could still use awt/swing components by manually calling their paint/paintComponent methods in your own render loop. (though im not 2 sure you’d want to do that - awt/Swing rendering code isn’t the tightest of code >:()

???Sorry, I am also a newbie on doing java game programming.

How to do you all print the swing components on the JFrame in the Full screen mode? using what classes or methods
???

thanx all i have turn my game into fullscreen exclusive ;D
and it works very nicely ;D

yup Juddman i want to use BufferStrategy but then i don’t know what’s wrong with my computer,
i try to use BufferStrategy like in sharedcode sections but it only works in windowed mode.
in fullscreen the game only appear in umm maybe 2 seconds and then back to windows >:( maybe my hardware not support BufferStrategy :’(
so i still use passive rendering.

okay thank you

BufferStrategy not working in fullscreen mode?
Sounds very odd ???
Just to make sure it isn’t your code…
Have you tried this little sample app?

http://www.pkl.net/~rsc/Balls.jar

its got loads of features :-

  • Windowed or Fullscreen modes
  • togglable rendering modes, (BufferStrategy or Normal active rendering)
  • different image types (VolatileImage, automatic Image, BITMASKed automatic Image)
  • AlphaCompositing (to demonstrate Software operations on VolatileImages are very slow)

hehe, what a shameless sales pitch :smiley:

but anyway - you’ll be able 2 see if BufferStrategy realy does work or not :smiley:

[quote][…]

  • AlphaCompositing (to demonstrate Software operations on VolatileImages are very slow)
    […]
    [/quote]
    yea it’s really very slow… btw is there a way to make such stuff faster?

using sys ram instead of vram should be faster in this case right?

sry for ot ._.

woahh :o balls.jar works very good abuse!! except the balls still shown it’s background (no transparent :-*)

umm so what’s wrong with my code then?? ???
it works fine in windowed mode, but not in fullscreen ???
maybe i must take a look closer at your code :wink:

oh yeah by the way is balls.jar programmed quit after several loop?
cos it suddenly quit after 1-2 minutes.
i didn’t press Escape and other keys

thanx for the code :wink:

[quote][…]except the balls still shown it’s background (no transparent :-*)[…]
[/quote]

[quote]different image types (VolatileImage, automatic Image, BITMASKed automatic Image)
[/quote]
bitmask=transparent :slight_smile:

[quote]woahh :o balls.jar works very good abuse!! except the balls still shown it’s background (no transparent :-*)
[/quote]
as oNyx said, accelerated bitmask transparency is only possible with automatic images.
If you change the image type to ‘Bitmasked automatic Image’, the balls background should disappear.

post your code

or you could do that instead :smiley:
(i think I included the src in the jar file)

now thats abit worrying :S

There are 3 things that can cause it to stop.

  1. pressing Escape - this should instantly quit the program.

  2. Changing to ‘VolatileImage’ while in ‘normal’ rendering mode.
    If you do this, it will stop rendering the balls until you change the ‘image type’ back to ‘automatic image’ or you change the ‘rendering mode’ back to ‘BufferStrategy’.

  3. Changing the number of back buffers several times at runtime can cause a JVM crash. (or worse :S)
    Its only there as a little test, if you use it - expect it to crash :stuck_out_tongue: (I put a ‘Triple Buffer’ option in the startup dialog for regular use)

no probs, hope it helps.

yup, simply change from using BufferStrategy to using ‘Normal’ (i.e. create the backBuffer yourself in sys ram)
and keep the image your drawing in sys ram as well.

Balls.jar has that as well :smiley:

try comparing :-

AlphaCompositing + BufferStrategy + VolatileImage

with

AlphaCompositing + Normal + automatic Image.

the 2nd is atleast 10 times faster :smiley:

This is a rather serious problem as well, and is likely to cause performance problems with Java2D for many versions to come.

If you use BufferStrategy (i.e. have your frame buffer in vram) you risk using a pixel operation that is not hardware accelerated. (and absolutely kill performance)

At the moment, only 2 operations have potencial to be accelerated (blit & bitmask)

When the number of hardware accelerated operations increase (as they must if Java2D is ever going to get anywhere)
A facility to enquire exactly what operations are accelerated will need adding. (i.e. getDeviceCaps() capability)

nope i didn’t press any key abuse
i try it several times but still quit suddenly
and now it quit after 20 seconds (the fastest one)

i suppose my video card not support buffer strategy :’(
but i don’t understand, why it works in windowed mode? but not in full screen??? ???
but the fullscreen exclusive work fine when not using buffer strategy!! >:( very odd…

okay thanx anyway

what gfx card?

Sounds to me like buggy drivers - have you upgraded them recently?
if not, do so :smiley:

umm i don’t know, it’s generic one :-[
in fact my gfx card not support OpenGL
is bufferstrategy need OpenGL?

i suppose i have no luck with bufferstrategy :-/
thanx for anything

it doesn’t need ogl support, however, im pretty sure it needs dx5+.

if your programming, you realy should know what hardware you have in your pc ::slight_smile:

sorry i don’t know anything bout hardware :stuck_out_tongue:
i use dx8.1, win xp, P-IV processor
i don’t want to use bufferstrategy for now
i test many samples that use bufferstrategy and have the same problem. >:(

okay thanx

by the way, what’s the benefit of using bufferstrategy?

the only thing BufferStrategy does, that isn’t do-able through the use of other classes, is page flipping.

however, thats quite a big ‘only’ :slight_smile:

as it improves fps, and eliminates tearing.

yeah i have no luck then :-/

i don’t know what’s wrong with my computer
i try lwjgl and bump!! it have same problems like using bufferstrategy!! >:(
it only runs well in windowed mode :frowning:

is it a bug or maybe i have replace my video cards ???

umm can i use lwjgl for making 2D games?
it said lwjgl is more stable and use CPU intensively