Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (775)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (856)
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  
  VolatileImage usage  (Read 3234 times)
0 Members and 1 Guest are viewing this topic.
Offline alcha

Junior Newbie

Java games rock!

« Posted 2003-09-30 09:45:56 »


I've got a little video game and
i was facing some speed issues in high
resolutions so i thought: "why not?let's
find out what this volatileImage stuff is all about"

The situation is the following:
BufferedImages drawing in  
Buffer (BufferedImage) and then the buffer is being
drawn to the Graphics of the Canvas using
Graphics2D's drawImage.

I knew nothing about VolatileImage so i started changing
everything i saw from BufferedImage to VolatileImage using
routines for validate() cases and contentsLost() (std procedure...)
The Result? Disastrous...(fps down 3-4 frames)

OK i have understood the redundancy of using VolatileImages
for the initial images but what about the final Buffer?
I mean it's the image(array of bytes)that should stay in the VRAM...

So,I did it again with only the final buffer being Volatile
but the results were the same.

Tell me:
Do i have a really BIG misconseption about what a
VolatileImage is and how to use it?
Does the above structure has any potential of becoming
any faster without any big changes (e.g BufferStrategy)?

I don't want so much a solution to my problem
comparably to how badly i want to find out
if i got straight VolatileImage.
Offline swpalmer

JGO Coder

Exp: 12 years

Where's the Kaboom?

« Reply #1 - Posted 2003-09-30 10:40:12 »

It's hard to day where the problem would be from what you have posted so far.  Can you post the relevant code?

Offline alcha

Junior Newbie

Java games rock!

« Reply #2 - Posted 2003-09-30 11:08:04 »

So you say there IS a problem...

I mean from my description i shouldn't
face a decreasing fps but an increasing one?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline immudium

Junior Devvie

Gorram it!

« Reply #3 - Posted 2003-09-30 13:06:38 »

I don't think he's saying anything about a problem with VolatileImages.  In my experience, VolatileImage is alot trickier to implement properly than it would seem at first glance.  Things have to be done in the right order and a FPS increase is not guaranteed or automatic especially if you don't do things in the order VolatileImage expects.

Abuse posted a little demo called balls.jar a couple months back.  I don't know if that code is still available, but you can find an excellent thread on the subject here:;action=display;num=1057468145;start=3#3
Offline Abuse

JGO Ninja

Medals: 70

falling into the abyss of reality

« Reply #4 - Posted 2003-09-30 15:05:43 »

yeah its still around.

There is also a version with Ball<->Ball collision (though its not very efficient - just a little play I had)
Offline immudium

Junior Devvie

Gorram it!

« Reply #5 - Posted 2003-10-01 02:00:50 »

Cool demo, I've been wanting to start playing around with collision detection.  As with the original balls demo, Balls2 seems to be a great example for pointing me in the right direction.  I can't wait to see what "Balls 3: Revenge of the Balls" will show us Tongue.  Thanks for posting it!
Offline Abuse

JGO Ninja

Medals: 70

falling into the abyss of reality

« Reply #6 - Posted 2003-10-01 07:36:50 »

prolly have a go at 'proper' collision detection Shocked

(at the moment it isn't a true simulation of motion, just an approximation - only 1 ball is moved at a time - this can lead to balls overlaping in certain circumstances)

The solution will entail all kind of nastyness though :-/
Pages: [1]
  ignore  |  Print  

hadezbladez (17 views)
2018-11-16 13:46:03

hadezbladez (22 views)
2018-11-16 13:41:33

hadezbladez (7 views)
2018-11-16 13:35:35

hadezbladez (7 views)
2018-11-16 13:32:03

EgonOlsen (1881 views)
2018-06-10 19:43:48

EgonOlsen (1904 views)
2018-06-10 19:43:44

EgonOlsen (1261 views)
2018-06-10 19:43:20

DesertCoockie (1707 views)
2018-05-13 18:23:11

nelsongames (1392 views)
2018-04-24 18:15:36

nelsongames (2007 views)
2018-04-24 18:14:32
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46 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‑
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!