Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (799)
Games in Android Showcase (237)
games submitted by our members
Games in WIP (865)
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  
  draw game assets from buffer vs. directly drawImage  (Read 8350 times)
0 Members and 1 Guest are viewing this topic.
Offline Tschib

Junior Newbie

« Posted 2014-03-23 11:08:16 »

hello folks,

now obviously I am sorry if this topic was covered in lengths already, but my search did not yield results on this topic.

I read in a discussion that after accessing a bufferedImage's pixel raster, java irreversibly treats it in a different manner, slowing down any operation as it is supposedly checking for its consistency (or something like that, i read this a while ago(sorry! persecutioncomplex)).

now if this happens to be true, would you say that there is any considerable advantage in not rendering game assets from sprite sheets but directly from their respective files by e.g. splitting spritesheets in single image files?

thanks for your time!
Offline trollwarrior1
« Reply #1 - Posted 2014-03-23 11:11:49 »

I'm sorry to say this, but you will probably have to do some tests yourself. There aren't many people on this forum who bother making efficient games with java2d.
Offline Tschib

Junior Newbie

« Reply #2 - Posted 2014-03-23 11:18:24 »

thanks for the quick reply!
I must admit I was afraid I might run into a common sense issue if i used drawImage for static assets.
so I guess i will not bother checking on performance Cheesy
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ctomni231

JGO Wizard

Medals: 99
Projects: 1
Exp: 7 years

Not a glitch. Just have a lil' pixelexia...

« Reply #3 - Posted 2014-03-23 11:54:07 »

From what I've done, there is no difference between rendering a entire spritesheet or separate images. Java optimizes the speed based on how much times the screen is updated. The more changes and draw calls, the slower it becomes. Since you can obtain a single sprite in the same amount of draw calls as a spritesheet, the performance enhancement is negligible.

Pages: [1]
  ignore  |  Print  

Riven (187 views)
2019-09-04 15:33:17

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

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

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

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

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

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

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

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

nelsongames (4293 views)
2018-04-24 18:15:36
Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

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