Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Performance Tuning / Re: Accelerating images through BufferStrategy on: 2012-01-10 01:31:24
Today I tried to change the options of virtual machine to force acceleration on graphics card. After a while that give me an answer - support for DirectX/OpenGL is default enabled. When I turned off Direct3D acceleration, render time gone higher, so that solves my case Smiley Java2d is trying to use platform depended acceleration and if that fail, there is switch to software rendering. That's it - clean and simple Smiley
2  Game Development / Performance Tuning / Re: Accelerating images through BufferStrategy on: 2012-01-09 00:18:44
Thanks a lot for your time and effort Smiley

For now rendering all 2D tile map in resolution 640x480 takes about 3 ms, so I think it's quite good result and maybe it's true that I seek for too much performance boost in places where it cannot be granted Tongue Cpu usage for entire game takes 5-10% with 30fps on c2d processor, so there is much more to improvement  Wink

For example "Killer Game Programming in Java" calls it Full-Screen Exclusive Mode (FSEM) and it's done by invoking setDisplayMode(), but for what i can see there is no performance boost between it and window mode what's really strange for me.
3  Game Development / Performance Tuning / Re: Accelerating images through BufferStrategy on: 2012-01-08 23:40:16
Key listener is added to JFrame because there were problems with focus on JPanel, but for now it doesn't matter.

Now I even removed BufferStrategy at all and nothing changed. I read somewhere that all Swing components are default double buffered so it makes sense. In fullscreen mode there is access to many exclusive graphics card functions, so I thought that something is going to help to render faster.
4  Game Development / Performance Tuning / Re: Accelerating images through BufferStrategy on: 2012-01-08 23:21:09
All keyboard event are binded to JFrame instance and all mouse event to JPanel.

It's seems really odd that there is no difference in drawing time between window mode and fullscreen mode at all.
5  Game Development / Performance Tuning / Re: Accelerating images through BufferStrategy on: 2012-01-08 23:04:58
Thanks for your quick reply.

I create a BufferStrategy from JFrame which object is my main window. Before that, I create JPanel where events and drawings are made and put it into frame. I tried to change JPanel into Canvas and create BufferStrategy from there, but drawing time didn't change and all events on JPanel stop working. I measure drawing time by using System.nanoTime() before and after main drawing function.
6  Game Development / Performance Tuning / Re: Accelerating images through BufferStrategy on: 2012-01-08 19:55:54
I also have a question about image acceleration and overall java2d performance.

I draw graphics by active rendering. It's nearly same everywhere - create JFrame with JPanel, set display mode, create buffer strategy and draw graphics. It's the way how the fullscreen application is made. When creating in window there is no need to change display mode and work with buffer strategy. When everything is done with screen display I normally create BufferedImages via GraphicsConfiguration.createCompatibleImage() to display.

Now is the thing that's really strange for me. I run application in window mode with frame rate counter. I do the same with fullscreen display mode and there is no change in frame rate. I always think that fullscreen mode has a really big advantage in processing images. I also add, that same thing is true for two other pc's around me. In each case frame rate still nearly the same.

So my question is, is it something wrong with code and me or is that the way that java handles graphics? If needed I can also paste some application's code with the way how the things are done. I highly appreciate any suggestions about this case.
Pages: [1]
 

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 (23 views)
2014-08-22 19:31:30

atombrot (34 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (28 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56

Norakomi (42 views)
2014-08-06 19:49:38
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!