Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (564)
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  
  Java & Linux Chromebook: problem running my application in fullscreen  (Read 1098 times)
0 Members and 1 Guest are viewing this topic.
Offline mike_bike_kite

Senior Member


Medals: 1
Projects: 2



« Posted 2014-08-13 17:19:58 »

I have my Java game I wanted to put on my chromebook. It works at 640 x 480 resolution and then adjusts the screen mode using device.getDisplayModes(). This works fine on most monitors but for some reason fails on my chromebook. The above method tells me it does have that resolution.

Any idea what I have to do?
Mike

Arcade swarm
Board Chess - Checkers - Othello
Offline gouessej
« Reply #1 - Posted 2014-08-13 19:50:34 »

Hi

The exclusive fullscreen mode of AWT has been broken under GNU Linux for several years. Most of the time, depending on the window manager, I still get the task bar above the fullscreen window.

How does it fail? Please can you give us more details?

Offline basil_
« Reply #2 - Posted 2014-08-13 19:52:04 »

oh, you are using Graphics2D ?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mike_bike_kite

Senior Member


Medals: 1
Projects: 2



« Reply #3 - Posted 2014-08-13 20:04:32 »

The exclusive fullscreen mode of AWT has been broken under GNU Linux for several years. Most of the time, depending on the window manager, I still get the task bar above the fullscreen window.

How does it fail? Please can you give us more details?
It wouldn't bother me too much having a small task bar - it's obviously not perfect but it's better than the little 640 x 480 window I'm getting at the moment. I should of said what's currently happening shouldn't I Roll Eyes

oh, you are using Graphics2D ?
I'm just using
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
for( DisplayMode dm : device.getDisplayModes() ) {
           
            if (   dm.getWidth() >= ScreenWidth
               && dm.getHeight() >= ScreenHeight
               && dm.getBitDepth() >= 16
               && dm.getRefreshRate() >= 60 ) {

               try {
                  if ( device.isFullScreenSupported() ) {
                     device.setFullScreenWindow(f);
                     if ( device.isDisplayChangeSupported() ) {
                        device.setDisplayMode( dm );
                        break;
                     }
                  }
               } catch ( Exception e ) {
                  device.setDisplayMode(OldDisplayMode);
                  device.setFullScreenWindow(null);
               }
            }
         }

 

to get the full screen which works on most windows screens but then I usually also call the jar with the following which tends to make it work for nearly all the windows screens I've tried (even my own 24" wide screen). It doesn't seem to have any effect on Linux.
1  
java -jar -Dsun.java2d.noddraw=true AlienSwarm.jar

I use double buffering and paint, drawImage etc to build the screens.

Arcade swarm
Board Chess - Checkers - Othello
Offline gouessej
« Reply #4 - Posted 2014-08-14 11:50:40 »

Take care of the multi bit depth:
http://docs.oracle.com/javase/7/docs/api/java/awt/DisplayMode.html#BIT_DEPTH_MULTI

Offline SHC
« Reply #5 - Posted 2014-08-14 11:58:42 »

Try printing those modes. On some linux machines, bit depths are set to -1

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 800
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #6 - Posted 2014-08-14 19:11:32 »

1  
if(dm.getBitDepth() == desktopDisplayMode.getBitDepth())

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline gouessej
« Reply #7 - Posted 2014-08-14 21:00:46 »

Try printing those modes. On some linux machines, bit depths are set to -1
1  
2  
3  
4  
5  
6  
/**
     * Value of the bit depth if multiple bit depths are supported in this
     * display mode.
     * @see #getBitDepth
     */

    public final static int BIT_DEPTH_MULTI = -1;


Riven's suggestion is nice and you should do the same for the refresh rate instead of picking 60. Some desktop managers badly support the modification of the refresh rate, they leave your desktop with tons of straight lines, I thought it was a bug of a Java library but I was wrong. I still reproduce it with KDE.

Pages: [1]
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

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

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

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

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

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

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

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (108 views)
2014-09-10 06:39:09
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!