Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
53 user(s) are online (49 user(s) are browsing Forum)

Members: 0
Guests: 53

more...


Browsing this Thread:   1 Anonymous Users




« 1 (2)


Re: coding strategy for big gfx memory usage
#2
Home away from home
Home away from home


See User information
At least on OS4 the handling of video memory is not so good, so if something uses too much video memory then the whole system can slow down. (AROS *may* be even worse, but it is typically used with systems that have tons of video memory. I'm not sure what happens on MorphOS.)

This is why my cGfx module allows you to mark bitmaps as "not drawable" using the setIsDrawable() method. A non-drawable bitmap is not stored in video memory, and so does not waste memory.... but you cannot draw it either (it must be set as drawable first, which will cause a very very small delay while the bitmap is copied to video memory).

Does that sound like a lot of boring work? That is why my cGfxSprite module automatically makes bitmaps non-drawable when their sprites are not visible on screen! But because this could cause a noticable delay when many sprite bitmaps are copied into video memory at the same time, I do allow you to disable this behaviour using setAutoIsDrawable().

PictureAlbum would work very slowly on the Sam440 (64MB of Video RAM) without this feature of cGfxSprites.


So if you want the easy life then use cGfxSprites. You have less control of how your bitmaps are drawn, but it saves you lots of hassle.

PLEASE NOTE that cGfxSprites cannot manage bitmaps that are not used by sprites. So you need to make sure that such bitmaps are marked as "non-drawable" as soon as they are loaded. You COULD use setIsDrawable(), but it would be more efficient to never load the bitmap into video memory in the first place. That is why the loadPicture() method has the "notDrawable=FALSE:BOOL" parameter (when set TRUE the returned bitmap is not drawable).

Posted on: 2013/3/17 15:36

Edited by PortablE on 2013/3/24 22:59:45
ChrisH
--
Author of the PortablE programming language.
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


coding strategy for big gfx memory usage
#1
Just can't stay away
Just can't stay away


See User information
On initial stage coding of my new game I detect big gfx memory usage - now it 92 Mb. In future I expect over 128 Mb... So I want ask how coding my game. I have 2 options:
1) Load and initialise all graphics, even if not will be used (this is board game - for every possible board changes I must load gfx, but in single play will be used 10% of board...)
This have advantage: not delay between moves - I not must search what gfx I need load; easy code, and disadvantage: big gfx memory usage, waste of resources
2) after every move load and initialise only this gfx that can be used. Advantage: much less memory usage, even at game final stage. Disadvantage: hard code - I must check what i need between every player move - It increase coding time and decrease coding motivation. Between player moves game "do" little" delay for additional board check..

Or maybe I no need worry about memory usage - gfx driver take care of it and not should be big delay in performance even on low gfx memory board...

Posted on: 2013/3/17 14:17
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 




« 1 (2)



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project