Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (542)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (604)
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  
  Some Java2D/FullScreen questions  (Read 3778 times)
0 Members and 1 Guest are viewing this topic.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Posted 2003-01-13 06:37:34 »

Hi there,

Maybe I should've posted this at clewless newbies but this seemed maybe a bit more on topic.
Anyway, after having played a bit with Java2D in full screen a number of questions did come up:

1. Is Java2D in 1.4.1_01 a lot slower than in 1.4.0? I ask because my game (at http://www.mycgiserver.com/~movegaga/) runs super smooth on my slow laptop (p2/266 2mb non-3d graphics, JRE 1.4.0, FPS never gets below 60FPS) but slow on my home desktop (P2/450, 64Mb GF4, falling below 30FPS when there's a lot on screen). I had all accelleration flags for ddraw and d3d on. I also tested on other 1.4.0 machines where it runs ok.  :-/

2.  Is setting a graphics mode in a specific refresh rate non functional, or am I doing something wrong? It always locks up the computer I'm testing on and when I query the graphics capabilities, I'm only getting back '0' for refresh rates (so that's what I'm forced to use) on whatever computer so I don't have control over what the refresh rate and thus the max framerate I wan't to get.  Cry

3. Is java2D extremely slow on linux? I don't use linux myself but when I see what fps numbers linux folks get, it seems rediculously slow.

4. Okay, this question is not about java2d, but considering the above, I'm thinking about using LWJGL instead. Can it be distributed along with the game through webstart, hopefully even while maintaining support for multiple platforms?

Thanks,
Erik

Offline Stuart Still

Senior Newbie





« Reply #1 - Posted 2003-01-13 09:08:58 »

Here goes:

Using Java2D with an ATI card under 1.4.0 there were major problems, and I believe for version 1.4.1_01 they disabled some of the performance settings to make it slower but function across the board.

On linux I believe it is probably slower, it can't make as good use of hardware acceleration (yet).

LWJGL cannot be ditributed using Web Start.  It runs using the Java Native Interface (JNI) to speak to C/C++ code.  That means it is unsigned and unless you can get Sun to sign it for you, Web Start won't be an option.  As far as multiple platforms go, LWJGL is available for linux (and maybe solaris) but it is a separate download because they all use JNI and therefore require OS specific code.

Don't take my word as gospel, but that information is hopefuly accurate Smiley

Stu
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #2 - Posted 2003-01-13 10:06:28 »

I haven tested this - but shouldn't any signed jar package run?

if so: sign your jar file, ask for write permission, place the dlls/sos and lwjgl should run...?

will have to test this...

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

« JGO Spiffy Duke »


Medals: 439
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2003-01-13 11:42:52 »

As I understand it, Java Web Start does allow distribution of native code provided .jars are signed appropriately.

Otherwise Java3D wouldn't work in webstart now, would it?

Cas Smiley

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #4 - Posted 2003-01-13 16:28:40 »

Thanks for the answers  Smiley

I have to sign the current jars of the game as it is, so I guess signing the lwjgl jars won't be a problem. But, I guess I'll make a distribution for 1 platform and loose the linux folks?
Ah well, the worst that can happen is that I have to make 2 seperate distributions. And with java2d performance on linux, I probably lost them already  Wink

I hope java2d will be fast again in newer versions because I think the performance drop in 1.4.1 is a big bummer...  Sad

Last but not least, has someone successfully set fullscreen mode in a specific refresh rate, and if so, how? Huh

Thanks again,
Erik

Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #5 - Posted 2003-01-14 01:26:48 »

No need to lose the Linux folks.. Web Start takes care of all that.  You can have conditional downloads based on the user's platform.. all specified with the JNLP file.

e.g.
...
     <resources>
           <j2se version="1.4+"/>
           <jar href="MyGame.jar"/>
     </resources>
     <resources os="Windows XP">
           <jar href="windows_specific.jar"/>
     </resources>
...

Offline zparticle

Senior Devvie




Thick As A Brick


« Reply #6 - Posted 2003-01-14 01:47:55 »

DisplayMode dm = new DisplayMode(640,480,32,DisplayMode.REFRESH_RATE_UNKNOWN);

for the default refresh rate and

DisplayMode dm = new DisplayMode(640,480,32,75);

for 75 (is it hertz?)

Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #7 - Posted 2003-01-14 04:11:50 »

ericd, 1.4.1_01 introduced the use of d3d for some operations (like rendering diagonal lines to an accelerated offscreen buffer). Unfortunately, in some cases (like rendering of clipped lines) it's actually slower than not using d3d at all.

So I'd suggest trying -Dsun.java2d.d3d=false on your GF4-equipped system.

In addition to this, there is a big problem with the drivers on ATI radeon boards, which in some cases cause the system to bluescreen, or hang. We have fixed this in 1.4.1_02 (along with lots of other fullscreen fixes, and clipped d3d lines performance improvements). 1.4.1_02 will be out in Q1'03.
I've also heard that ATI fixed their drivers issue in one of the latest drivers releases.

On Lunux we do have some acceleration (depending on the vendor's drivers), as we use Pixmaps for accelerating offscreen images. Some drivers may put them into the vram, which speeds up things considerably. Also, we use double-buffer extension to do buffer flipping (that is, if you use BufferStrategy). But again, your XServer and the vider drivers need to support it.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #8 - Posted 2003-01-14 10:51:56 »

Quote
DisplayMode dm = new DisplayMode(640,480,32,DisplayMode.REFRESH_RATE_UNKNOWN);

for the default refresh rate and

DisplayMode dm = new DisplayMode(640,480,32,75);

for 75 (is it hertz?)

Yes, but does that actually work on your system? On the systems I tested, only DisplayMode.REFRESH_RATE_UNKNOWN works.
Also when I query the available display modes, this is the only refresh rate that is returned...

Quote
No need to lose the Linux folks.. Web Start takes care of all that.

Wow, Web Start is getting cooler every minute  Cool

trembovetski : Thanks for your reply. That's really a lot of good news! I'll try d3d=false, but I don't use lines, only (scaled) images.

Erik


Offline zparticle

Senior Devvie




Thick As A Brick


« Reply #9 - Posted 2003-01-14 12:29:33 »

Yeah, I have no problem setting specific refresh rates. When I get the available display modes each one has a specific refresh rate with it.


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

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #10 - Posted 2003-01-14 15:44:08 »

Quote
So I'd suggest trying -Dsun.java2d.d3d=false on your GF4-equipped system.

No difference I'm afraid...  Sad
It seems like -Dsun.java2d.ddscale=true doesn't have any effect anymore as of 1.4.1...  Huh

Quote
Yeah, I have no problem setting specific refresh rates.

Hmmm... then it must be something local on the machines I tested on.  :-/


Offline Abuse

JGO Knight


Medals: 15


falling into the abyss of reality


« Reply #11 - Posted 2003-01-14 15:49:52 »

Quote
Yeah, I have no problem setting specific refresh rates. When I get the available display modes each one has a specific refresh rate with it.



what platform is that on?

i've tried 10 windows machines, and every single 1 returns a 0 (aka unknown)

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline zparticle

Senior Devvie




Thick As A Brick


« Reply #12 - Posted 2003-01-14 16:29:14 »

I'm using Win2K on two machines. One with a GeForce4 Ti4600 and the other with a RIVA TNT2. They both work just fine. The code below might help, but it sounds like you are doing it correctly. Note that both machines above are desktop not laptop computers.

EDIT: And I'm using 1.4.0, and the Geforce machine hase two displays running on two different video cards and both displays report refresh rates. Although I have yet to be able to start a full screen game on the second display.


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
This chunck is in the FullScreenJFrame class that the chunck below references.
/**
     * Get the list of available display modes for a graphics device
     */

    public static DisplayMode[] getDisplayModes(GraphicsDevice device) {
        DisplayMode[] list = device.getDisplayModes();
        return list;
    }

    /**
     * Get the list of available graphics devices
     */

    public static GraphicsDevice[] getDeviceList() {
        GraphicsDevice[] list = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
        return list;
    }

    gdl = FullScreenJFrame.getDeviceList();

    public void populateModes(int device) {
        DisplayMode[] tlist = FullScreenJFrame.getDisplayModes(gdl[device]);
        int validCount = 0;
        Vector v = new Vector();
        for(int mode=0;mode<tlist.length;mode++)
        {
            if(tlist[mode].getBitDepth()<minBitDepth ||
               tlist[mode].getWidth()<minWidth ||
               tlist[mode].getHeight()<minHeight)
                continue;
            validCount++;
        }
        dml = new DisplayMode[validCount];
        int nextIndex=0;
        for(int mode=0;mode<tlist.length;mode++)
        {
            if(tlist[mode].getBitDepth()<minBitDepth ||
               tlist[mode].getWidth()<minWidth ||
               tlist[mode].getHeight()<minHeight)
                continue;
            dml[nextIndex] = tlist[mode];
            v.addElement("["+nextIndex+"] Bit Depth:"+dml[nextIndex].getBitDepth()+
                " Width:"+dml[nextIndex].getWidth()+" Height:"+dml[nextIndex].getHeight()+
                " RefreshRate:"+dml[nextIndex].getRefreshRate());
            nextIndex++;
        }

        modeList.setListData(v);
        modeList.setSelectedIndex(0);
    }

Offline Kommi

Junior Devvie




All opinions will be lined up and shot!


« Reply #13 - Posted 2003-01-14 19:52:21 »

How exactly did you write that game? Did you use Java3d or did you do it from scratch?

Kommi
Offline Abuse

JGO Knight


Medals: 15


falling into the abyss of reality


« Reply #14 - Posted 2003-01-14 22:11:10 »

hmm - maybe its a Win98 thing,
perhaps its time i tried win2k again - though the sporadic crashes that DX games suffered kinda put me off.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline zparticle

Senior Devvie




Thick As A Brick


« Reply #15 - Posted 2003-01-15 01:09:11 »

Just for "fun" try

http://www.scottshaver2000.com/files/life.jnlp

and see if it gives you a list with different refresh rates.

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #16 - Posted 2003-01-15 06:00:27 »

Quote
How exactly did you write that game? Did you use Java3d or did you do it from scratch?


I didn't use Java3D. The 3D thing in the game is very simple anyway.

Quote
see if it gives you a list with different refresh rates


On my PC at work (win2k, JRE 1.4.0) it works. I'll have to see if it also works on my home PC (win98, JRE 1.4.1), where I do most of my game development on and where I don't get refresh rates. The other one where I don't get refresh rates on is my laptop (win98, JRE 1.4.0) but that maybe makes sense somehow (TFT screen and all)...

Greetings,
Erik

Offline Abuse

JGO Knight


Medals: 15


falling into the abyss of reality


« Reply #17 - Posted 2003-01-15 21:33:37 »

Quote
Just for "fun" try

http://www.scottshaver2000.com/files/life.jnlp

and see if it gives you a list with different refresh rates.


nope, just alot of zeros


Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline zparticle

Senior Devvie




Thick As A Brick


« Reply #18 - Posted 2003-01-16 01:44:45 »

Weird.

Offline Captain-Goatse

Junior Devvie




I suck at teh 2D. XBOX IS BIG LOL!111


« Reply #19 - Posted 2003-01-16 14:59:01 »

It is driver based, I'm certain. My friend has excatly the same setup as I, but he has different version of the detonator, so out comes the different refresh rate.
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.

CopyableCougar4 (14 views)
2014-12-28 02:10:29

BurntPizza (17 views)
2014-12-27 22:38:51

Mr.CodeIt (13 views)
2014-12-27 04:03:04

TheDudeFromCI (17 views)
2014-12-27 02:14:49

Mr.CodeIt (25 views)
2014-12-23 03:34:11

rwatson462 (56 views)
2014-12-15 09:26:44

Mr.CodeIt (46 views)
2014-12-14 19:50:38

BurntPizza (92 views)
2014-12-09 22:41:13

BurntPizza (113 views)
2014-12-08 04:46:31

JscottyBieshaar (86 views)
2014-12-05 12:39:02
How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

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