Changing Display Mode

Started by cyberkilla, January 11, 2007, 07:02:04 PM

Previous topic - Next topic

cyberkilla

Egon, I was wondering, how did you change the display mode on your game project? I cant remember its name:)

You see, I am using the standard GraphicsDevice/setDisplayMode method.
But it doesnt work reliably in Linux because of strange problems related to the enumeration of available modes.

HOWEVER, your game CAN change the display mode in both linux and windows for me:O.

Is there any chance you can tell me how you did it?

Thanks again :wink:
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

EgonOlsen


cyberkilla

Thanks Egon!:)

I didn't realise the source was hanging around :wink:.

I didnt even realise there was a webpage for it. Im clearly a bit dumber
than I thought I was.
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

EgonOlsen

No problem. The source is only "half-public", because i don't link to it from the website itself. Just from this and one other forum. It isn't the latest version either. I think it's one and a half version behind but for the display initialization, it doesn't matter.

cyberkilla

Thanks again Egon:), and....

I get this strange error message...

QuoteCan't find desired videomode (200 x 200 x 24) - searching for alternatives
[ Fri Jan 12 02:37:48 GMT 2007 ] - ERROR: Can't find any suitable videomode!
[ Fri Jan 12 02:37:48 GMT 2007 ] - ERROR: Can't set videomode - try different settings!

I am using the following...


buffer = new FrameBuffer(200,200,FrameBuffer.SAMPLINGMODE_NORMAL);

//Config.glSetDesiredVideoMode(FrameBuffer.getVideoModes(IRenderer.RENDERER_OPENGL)[0],true);

buffer.enableRenderer(IRenderer.RENDERER_OPENGL,IRenderer.MODE_OPENGL);
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);


I am not even attempting to enter full screen mode in this instance!:)

The game does load after this, but only a black box is shown where the players model should be. So, it isn't working, basically:).

I would like to be able to enter 640x480x24 full screen mode too, if possible.

This message only appears when I use MODE_OPENGL.

The options I plan to support will be:
Software Rendering & Hardware Rendering(Windowed or Fullscreen).

To be fair, it is 2:45am. No doubt I am overlooking the blatantly obvious;).


EDIT:
Is is even possible to use the hardware accelerated mode like this?....


bufferType = buffer.getType();
if(bufferType==FrameBuffer.BUFFEREDIMAGE)
    image = (BufferedImage)buffer.getOutputBuffer();


I basically render the scene, then draw the backbuffer where I want it.
Naturally, I have traps to do it the long way, when there is no bufferedimage, but this is not so important.

I am starting to get the impression hardware mode doesnt work quite the same way.
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

EgonOlsen

No, it doesn't work this way. For example, the Videomode has to match one of the available modes, i.e. it can't have a 200*200 resolution, because no graphics card offers this. It also has to open a native OpenGL window to render into, it can't render into an abstract "framebuffer" like the software renderer does.
When using it anyway, you would have to call getOutputBuffer() every time you are accessing the image because otherwise, it won't be updated. But even when it is, it'll be quite slow, because reading the image out of the card's memory IS slow. It'll most likely be slower then software rendering because current hardware isn't optimized for such things.
In your case, i suggest to stay with software rendering and consider to use Java6 (if possible) instead to get more speed because it helps to increase software pixel processing up to 50% in some cases.

cyberkilla

Understood:).

Well, your software rendering is very fast. I hope my game will be usable without acceleration.

I know, I will try to get a few more players on the screen at the same time:).

Until I test it, I have no reason to worry;).
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

eye1

Hello

I would like to know which graphic card would suite best for programs runing on jpct (OpenGL).

I had in mind this one

http://ati.amd.com/products/fireglv3400/index.html

Is this a good choice?

I would like to get good performance on high resolution with lot of polygons rendered.

Should i invest in graphic card or more on other parts of hardware?

EgonOlsen

It's a bit overkill to buy a FireGL (or Quadro) card just for OpenGL. They are nothing more than "normal" graphics cards with certified drivers/profiles for various, "serious" 3D applications like CAD etc. If this is not needed in your case, i would get a normal card for end users from retail, like a Radeon X1950pro or a GeForce 7950.
Usually, the drivers for NVidia cards are still a little superior to the ones for ATI/AMD (yes, i'm allowed to say this...i have 2 ATIs and 2 NVidias working here).

jPCT itself is cpu and graphics card dependant. It relies a little more on the cpu than some other engines due to the way it works. So if it's a better idea to upgrade the cpu or the graphics card is a question of what you have now....so...what do you have now?

eye1

I'm going to buy a PC on which will be only running application which I developed in jpct. (Live Warehouse Visualisation) Display will be on LCD television screen with HDTV 1080p resolution. And I would like to know on which parts of hardware should i invest the most, so taht I could render as detailed graphics as possible.

EgonOlsen

Get a decent CPU (Core2 Duo rocks for Java applications...much more than a n Athlon64 or a Pentium 4 does). A C2D 6600 or 6700 will be fine. For the graphics, go for a GeForce 7900 GS/GT or a ATI Radeon X1950 Pro/XT. 256mb of VRAM should be enough because your application (judging from the screenshot) doesn't seem to be very texture intense.
If you are using the OpenGL renderer (not the AWTGLRenderer, which is multithreaded anyway), you may try to use the multi-threaded renderer when using such a dual core setup to see if it helps to increase performance (Config.useMultipleThreads=true before enabling the renderer).
And if it's possible, use Java6. It's much faster in some aspects than Java5 is.