Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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  
  Copying image to VolatileImage or BufferedImage  (Read 3334 times)
0 Members and 1 Guest are viewing this topic.
Offline DarkwingGT

Senior Newbie




Java games rock!


« Posted 2003-04-02 02:22:25 »

I noticed some posts on get better results using hardware accelerated Volatile or BufferedImages.  That part I understand and I know how to create the images.  However what I don't quite understand is how to load the image file (gif, jpg, bmp, whatever) into said image.  Am I thinking wrong?  Do these "images" not hold raster data somehow?  And if not who thought up these names?

Sorry, I couldn't find anything on these boards or the Java site.  Any help would be appreciated, thanks.
Offline DarkwingGT

Senior Newbie




Java games rock!


« Reply #1 - Posted 2003-04-02 03:32:38 »

Ok, after doing a little searching on this forum I think I figured it out.  You have to create the B or V image, then get the graphics to it, draw the image source onto it and then you can use that, no?  Can anyone confirm this?

Although I did a search for VolatileImage and it didn't produce the answer so I don't feel to bad.
Offline DarkwingGT

Senior Newbie




Java games rock!


« Reply #2 - Posted 2003-04-02 03:41:43 »

Honestly, I'm not trying to bump my own thread Smiley

It's strange, I tried the method I think Abuse described in another thread, but the moment I use the "accelerated" images described in the HW Transparency in 1.4.1_02 thread it slows my graphics to a grind compared to the smooth rendering without HW acceleration.  Weird.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Abuse

JGO Ninja


Medals: 64


falling into the abyss of reality


« Reply #3 - Posted 2003-04-02 14:28:36 »

yup, you've sussed it.

1) load your image
2) create the bufferedimage/volatileimage
3) draw the loaded image onto the volatile/buffered image.

as to the second issue,
it depends what you are actually doing with the image, as to whether it will be faster having it loaded in vram rather than system memory.

if you are performing a drawing operation that isnt hardware accelerated for instance, it will be far slower if the image is in vram!
Offline javatypo

Junior Devvie





« Reply #4 - Posted 2003-04-11 19:10:41 »

Quote
yup, you've sussed it.

1) load your image
2) create the bufferedimage/volatileimage
3) draw the loaded image onto the volatile/buffered image.

as to the second issue,
it depends what you are actually doing with the image, as to whether it will be faster having it loaded in vram rather than system memory.

if you are performing a drawing operation that isnt hardware accelerated for instance, it will be far slower if the image is in vram!



4. draw V or B image to the screen, using a gfx object from something like a frame.
Offline Jeff

JGO Coder




Got any cats?


« Reply #5 - Posted 2003-04-21 17:44:29 »

iIs your frame double buffered? If so youa re doing this:

Java Heap                                                 Video Memory
Initial Image              ------------->             Volatile Image
Frame Buffer              <------------              Volatile Image
Frame Buffer             -------------->            Onscreen Memory

Volatile images are most often used in conjunction with Full Screen and Buffer Strategy in which case (if you have enough
VRAM)  the volatile image wil get written straight to the onscreen
memory (or rather screen memory which will be onscreen once you call show() on the buffer strategy.)

If you dont want to take very tight control of the drawing and do it all youself then my advice is to use what we used to call "Automatic Images" and are now called "Managed Images."

JK

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline Jeff

JGO Coder




Got any cats?


« Reply #6 - Posted 2003-04-21 17:45:20 »

P.S.  I assume you reant doing something silly like redrawing the
initial image to the Volatile image every frame, are you?  That woudl defeat the purpose and indeed just make it slower.


Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Pages: [1]
  ignore  |  Print  
 
 

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

nelsongames (17 views)
2018-04-24 18:14:32

ivj94 (608 views)
2018-03-24 14:47:39

ivj94 (53 views)
2018-03-24 14:46:31

ivj94 (401 views)
2018-03-24 14:43:53

Solater (66 views)
2018-03-17 05:04:08

nelsongames (111 views)
2018-03-05 17:56:34

Gornova (176 views)
2018-03-02 22:15:33

buddyBro (747 views)
2018-02-28 16:59:18

buddyBro (94 views)
2018-02-28 16:45:17
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!