Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (525)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (594)
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  
  Fullscreen mode on Linux  (Read 2507 times)
0 Members and 1 Guest are viewing this topic.
Offline Malohkan

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Posted 2004-08-26 20:16:16 »

I have my game running in fullscreen mode fine on OS X and Windows, but I'm having trouble on Linux.

on Windows, I call GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayModes() to get the available options for display modes, and I pick the one I want from the list by chosing an arbitrary resolution and color depth via a GUI I've made.  So I can pick 1024x768 and 8 bit color if I want, or 800x600 with 32 bit color, or whatever is available.

On my tests on two comps running Fedora using
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayModes() only returned to me the current DisplayMode, and with the color depth as BIT_DEPTH_MULTI.
I KNOW that it supports plenty because the monitor was one of those 32" ones with the display up to 1600x1200.  However it only gave me that one.  That's like... so useless.  Even if it supports multiple bit depths, how can I specify to it what I want to use?

I want to get all the available screen setup options I can get.... but the method I mentioned above isn't giving them to me.  What can I do?  By the way this was on 1.4.2_03

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #1 - Posted 2004-08-27 00:40:35 »

The fullscreen mode (and changing the display modes) is not supported on linux/solaris yet (as of 1.5). It will be supported in the next release, see rfe
 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4661156

(it should be updated in a couple of days with some new info)

Unfortunately for now you can only use the emulated fullscreen mode: borderless frame resized to fill the whole screen (that's what you'll get if you call GD.setFullscreenWindow() on linux / solaris)..

Alternatively, run your game in windowed mode on platforms which do not support fullscreen/display mode change.

Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #2 - Posted 2004-08-27 00:45:40 »

You might want to check if enabling hw acceleration (I'm assuming you mean the hw compositing and accelerated translucen images) would help your app- just run it as an application with the flags enabled (see the page above on how to make sure webstart picks up your property - set _JAVA_OPTIONS env. variable)..

To see what loops are being used, enable logging: -Dsun.java2d.trace=help (see the page for more details).
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Malohkan

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Reply #3 - Posted 2004-08-27 01:21:12 »

Quote
that's what you'll get if you call GD.setFullscreenWindow()

That's what I'm currently doing.
Quote
see the page above on how to make sure webstart picks up your property

What page above?  I've been wanting to know how, but according to other posts on the forums, it can't be done because the Webstart loader initializes AWT so you can't do it and that's why a bug report has been submitted for it.

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #4 - Posted 2004-08-27 01:48:19 »

Duh! I've replied to too many threads today, forgot where I saw the link:
 http://java.sun.com/j2se/1.5.0/docs/guide/2d/flags.html
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #5 - Posted 2004-08-27 16:22:01 »

Quote
The fullscreen mode (and changing the display modes) is not supported on linux/solaris yet (as of 1.5). It will be supported in the next release, see rfe
 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4661156

(it should be updated in a couple of days with some new info)


(the update appears to have happened already - there's lots of paras about the VidMode extension and how it will be used.)

It's great news that at last something is being done (how much bad press has this generated for Sun? Everytime the marketeers touted fullscreen mode, more and more developers discovered it was windows-only). HOWEVER ... two scary thoughts:

1. By "next release" do you seriously mean 1.6, i.e. not until 2007? What's the point even bothering if it's going to be that long? Those of us developing java games on linux will either have switched OS or simply stopped using j2d entirely (in favour of *anything*, whether that's LWJGL or anything else) because "it's so crap it can't even do fullscreen mode" (I'm guessing that will be the most frequently-phrased way of putting it, fairness aside!). I understand the need to prioritize development, and that *every RFE* is wanted ASAP by *someone*, but this makes java look really bad in gaming circles.

Developer: "Yeah, you should move over to java, it's WORA, saves you all those porting costs for your games"

Publisher: "Great. So, let's see your demo running on linux and OS X to prove it"

D: "Um, actually, no. It can't cope with an OS that's been around for longer than the language has. Um. But it really IS better than C++ at x-platform development, I promise!"

P: "BS. Come back when you're ready to write your game in C++".

2. The XFree86 authors and/or nvidia (and presumably ATI too?) are pushing everyone on linux towards Xinerama, (whether you want to go that way or not - I didn't, but now I have to for my multi-monitor support) and the bug report says that Xinerama won't be supported. If it's a case of "without Xinerama, we can have this in a gold JVM by Q2 2005" then OK. But if it's going to be two years or more anyway, then how can we kick Xinerama out?

What was the first thing I was going to do when fullscreen mode appeared on linux? Write a multi-headed game, able to work on almost every nvidia or ati or matrox card sold in the last 4 years, as an excellent demonstration of the superior java API's that make it trivial to use the latest greatest features for games.

Again, I appreciate that the number of people with more than one monitor is a minority. However, I suspect it's actually higher than received wisdom suggests - it's just that most people have no incentive to connect up the second monitor (from the PC they bought 3 years before their current one, which is now gathering dust because it's running windows 98 or ME and is too slow). It's up to devleopers to give them the incentive, but it's up to Sun to enable the developers to do this.

malloc will be first against the wall when the revolution comes...
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #6 - Posted 2004-08-27 16:51:15 »

As wonderful as this is, I think it is important to prioritize.. Linux is not a popular gaming platform.  It's as simple as that.  Heck try to go the store to get a game for a PC in general these days and you are directed to the back corner.  If it is a game for a non-Windows OS then don't even bother going in the door.  If a game isn't on a console it gets little attention, with the exception of the big names, like Doom3, HalfLife 2,etc...

Can we honestly justify Sun spending much effort on fullscreen support for Linux when it is just us programmers that will ever run it?

Specially after reading all the different ways that the Linux folks have painted themselves into a corner by using X-windows which can't decide how to do it right in the first place... VidMode, Xinerama ?? and the next 10 conflicting APIs that the Linux haxors will spit out next month.

It will take till 2007 before it is clear what API is going to actually be supported well on Linux in the first place.  From my observations I conclude that graphics in general on a Linux box is a bag of tricks... let it settle down and by then Linux might have stable support that makes it worth it.

*This response is not an attempt to bash Linux.  I'm just trying to be practical*

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #7 - Posted 2004-08-27 19:01:49 »

Quote

Can we honestly justify Sun spending much effort on fullscreen support for Linux when it is just us programmers that will ever run it?


I don't know, but ... Sun is somewhat in the position of being a market-maker here. By making this pre-existing feature actually *work* they enable x million programmers to write attractive games on linux without switching to OGL or similar, which could give enough of a kick to a virtuous circle to help commercial linux game sales take off.

But I think the bigger concern is the extent to which the windows / linux disparity makes a very obvious and visual mockery of the WORA claims. If you ignore fullscreen mode, then (bugs aside) java 1.4 has finally laid to rest the demons of the "write once, write workarounds everywhere" accusations. But the disparity continues to be a PR problem.

Quote

*This response is not an attempt to bash Linux.  I'm just trying to be practical*


Sure. Likewise, I don't *know* how important this ought to be to Sun, but I had thought it would be important enough to be added in 1.5. So I'm just questioning whether it will be 1.5 or not, and if not whether that really is wise...

It really depends what the alternatives are. For instance, an incrementally installing JVM is 10 times more important to get games developers taking java seriously, and a console JVM is 10 times more important than that. But, if both those things were to go ahead anyway (or not) independently of this one, then it becomes worth looking at this, particularly in light of the embarassing flagrant breach of WORA.

malloc will be first against the wall when the revolution comes...
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #8 - Posted 2004-08-29 22:54:43 »

Quote
...particularly in light of the embarassing flagrant breach of WORA.


I guess I just don't see it as that.  Just because the Fullscreen APIs actually have a built-in work around so that the code will still run on Linux.  Better support is always good.  But in this case they at least did something to keep the code running.

Offline Malohkan

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Reply #9 - Posted 2004-08-29 23:27:06 »

Quote

...the Fullscreen APIs actually have a built-in work around so that the code will still run on Linux.

What is this workaround?  How can I use it?  I still face the same problem where it in fact does NOT work on Linux, so please let me know how I can use it.

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #10 - Posted 2004-08-29 23:48:16 »

I was referring to the fact that it is emulated with a window the size of the display placed above the other windows.  At least that's what I've read here and elsewhere.  I don't often run linux.

Offline Malohkan

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Reply #11 - Posted 2004-08-30 01:43:59 »

My tests on Windows and Mac run fine.  My tests (on 3 different Linux machines) result in the program displaying a full screen of gray, then locking up.  You can switch back and forth between programs, but any time you go back I get nothing but a frozen program.  I haven't run it yet with the console up.  That'll be what I do tomorrow when I have more time on one.  This was just for me leaning over peoples' shoulders saying, "hey can I try something?" and putting in my URL Smiley  But yeah, whatever shows up in the console, Java most certainly does not have a nice way of covering the problem for me.  It only crashes.

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #12 - Posted 2004-08-30 08:32:17 »

It *should* work in linux with the fullscreen window thing, but there are many downsides. Basically, an app that thinks it is fullscreen will often do things like capture (steal) mouse and keyboard events - yet you are still in a window, and this sometimes means you cannot escape from the window back to your OS. You can see your start bar (yes, the window is a "real" window, so it does NOT overprint the start bar; fortunately, this is not DirectDraw, so we don't get the flickering, but all those games DO have a big bright startbar at the top you can't get rid of unless you change your OS settings to auto-hide it, which ahs problems of it's own), but you can't move the mouse to it, and sometimes can't alt-tab either IIRC.

So, all in all, it's a cheap tacky hack that sounds OK, normally works, but looks terrible on a lot of machines, and several games I've played have naively acted as if they were fullscreen and just made life a mess for all concerned.

So...it's really rather crummy at the moment. Not that I think you could do any better without *actually* going fullscreen...

malloc will be first against the wall when the revolution comes...
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #13 - Posted 2004-08-31 21:57:57 »

Quote
It *should* work in linux with the fullscreen window thing, but there are many downsides. Basically, an app that thinks it is fullscreen will often do things like capture (steal) mouse and keyboard events - yet you are still in a window, and this sometimes means you cannot escape from the window back to your OS.


Why not?  Surely you would use the same operation that you would have used to exit full-screen mode and return to the "OS".

Quote
You can see your start bar (yes, the window is a "real" window, so it does NOT overprint the start bar;...

Irritating, sure, but not a show stopper.

Quote
and several games I've played have naively acted as if they were fullscreen and just made life a mess for all concerned.

What sort of mess ?  They SHOULD be acting as if they were full screen.  But that shouldn't cause problems.  Is it the way the input devices interact with the window manager?

Quote
Not that I think you could do any better without *actually* going fullscreen...

Well there you go then.  If that is true, I don't blame Sun at all.. it is the Linux developers that have to un-botch the fullscreen situation with Linux/X-Windows.  I recall that the Java guys were here two years ago asking for good solutions to the problem, but there were all sorts of issues - like needing admin/root access or other incompatibilities.  X-Windows was never designed for this sort of thing and it shows like a big zit that's ready to pop.

Offline Malohkan

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Reply #14 - Posted 2004-09-01 12:43:58 »

Is there a way to ask the OS the size and position of the start menu bar thing?  Or the equivalent ones in different OS's?  If I can't do FullScreen for real, and I let people use the hacky version on Linux, I'd like to resize my screen to not extend past that bar so that you can see the rest of the screen.  Is there something to help me with that?

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #15 - Posted 2004-09-02 02:35:09 »

Quote
Is there a way to ask the OS the size and position of the start menu bar thing?  Or the equivalent ones in different OS's?


Yes. check the javadocs

http://java.sun.com/j2se/1.5.0/docs/api/java/awt/GraphicsEnvironment.html#getMaximumWindowBounds()

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #16 - Posted 2004-09-04 16:51:04 »

Quote
I'd like to resize my screen to not extend past that bar so that you can see the rest of the screen.


That's what it does automagically - leaves the start bar showing - at least on IceWM. Now, what happened to that RFE for a forum dedicated to x-platform issues ;P?

malloc will be first against the wall when the revolution comes...
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #17 - Posted 2004-09-04 16:59:04 »

Quote


Why not?  Surely you would use the same operation that you would have used to exit full-screen mode and return to the "OS".


Sorry, I meant stuff like:

- you can see the start bar + button, but you cannot click on it, and pressing "start" key on kb has no effect
- you can't alt-tab out of the windowed game; in fullscreen, capturing alt-tab is not too surprising - in a windowed game, it's disturbing to see your other apps on the start bar but be unable to reach them!
- games that crash in pseudo-fullscreen sometimes seem to be crashing because it wasn't true fullscreen (unconfirmed - I just have vague memories of finding crashes that authors later claimed to be related to the not-true-fullscreen status; this was probably largely a video driver problem, if true?).
- games that crash in pseudo-fullscreen (for whatever reason) often  leave the screen a grey or black rectangle with the start bar showing but input still captured, so you can see the start bar but cannot get to it to kill the application - and the only way out is to be a linux expert and know you can ctrl-alt-f2, login on a separate text terminal (assuming your distro configures more than one of these by default, otherwise you are simply f***ed at this point...), ps -A to find the JVM, then manually kill it from the terminal, then ctrl-f7 to jump to the special pseudo terminal that is where X is running, and get back to your desktop.

NB: I know that in theory fullscreen mode is literally just a fullscreen window with a tiny bit of magic to tell the OS that this particular fullscreen window requires the non-painting of the OS stuff, unlike regular fullscreen windows (more "full desktop" than "fullscreen"). It just *seems* sometimes that there is a bit more of a difference than that.

malloc will be first against the wall when the revolution comes...
Offline Malohkan

Senior Devvie




while (true) System.out.println("WOO!!!!");


« Reply #18 - Posted 2004-09-04 17:56:05 »

Quote


That's what it does automagically - leaves the start bar showing - at least on IceWM.


Heh, I wish everything else worked like IceWM then.  I don't know what that is, but so far I haven't had anything but a gray screen with no escape but to reboot or jump to another terminal to kill the process.

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline pardival

Junior Newbie




Java games rock!


« Reply #19 - Posted 2004-09-27 22:04:22 »

I consider Java as a really good alternative and very attractive as a gaming platform.
As i could see on the last Game Developer Conference, developers are taking seriously to develop using java technology.
Just consider current OpenGL (JOGL, lwjgl, ...) and OpenAL libraries, search some development projects and you'll find arcades, 3d, MMRPG. i.e. Quake ports to Java that run smoothly using acceleration features.
Just because Java is only the language, the technology beneath is the hardware through those libraries, same as C++.
What else ? Those games I mention easily implement multiplayer features, they work on all platforms, they can use upgrading tools such a Java Web Start, and so on.
Additionally, Java is becoming an standard on mobile gaming devices for similar reasons.
I think you're wrong if you consider games will still be done on C++ two years from now, and considering gaming industry as some of the MOST important (at least for the money involved), GAME DEVELOPMENT on JAVA SHOULD TAKE PRIORITY.
Something else: don't think on gaming only for a Windows desktop user. Games run on embedded devices such as consoles, entertainment machines, ...
Well, I have seen Sega runs Windows on Daytona USA, but I think PS2 uses Linux on some of their development process, and with the proper support Linux can run on those devices and become a real option through Java.

So let's Sun support the API and the specs and do the FULLSCREEN feature definitely working on Linux.
Offline pardival

Junior Newbie




Java games rock!


« Reply #20 - Posted 2004-09-27 22:05:43 »

Hey ...let's vote Sun Java bug 4661156 and move to the top 25 pending bugs !!
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 78
Projects: 15


★★★★★


« Reply #21 - Posted 2005-05-23 18:37:16 »

woohoo, just recieved an email that this has finally been fixed, in the latest mustang build!

yippeee, sun took there time, but at least its there!
Offline campbell

Junior Devvie




Java games rock!


« Reply #22 - Posted 2005-05-23 20:34:00 »

Quote
woohoo, just recieved an email that this has finally been fixed, in the latest mustang build!

yippeee, sun took there time, but at least its there!


Just to clarify, this isn't yet available in a Mustang snapshot.  However, it is currently being tested and if all goes well, it will be available in b39 (in a couple weeks).

Chris
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.

toopeicgaming1999 (71 views)
2014-11-26 15:22:04

toopeicgaming1999 (60 views)
2014-11-26 15:20:36

toopeicgaming1999 (14 views)
2014-11-26 15:20:08

SHC (27 views)
2014-11-25 12:00:59

SHC (25 views)
2014-11-25 11:53:45

Norakomi (31 views)
2014-11-25 11:26:43

Gibbo3771 (25 views)
2014-11-24 19:59:16

trollwarrior1 (38 views)
2014-11-22 12:13:56

xFryIx (77 views)
2014-11-13 12:34:49

digdugdiggy (55 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!