About Store Forum Documentation Contact



Post Reply 
3 Small questions
Author Message
Corrado Offline
Member

Post: #1
3 Small questions
Hello Grzeg,

i have some small questions :

1) In runtime : can i know the list of all the loaded textures ? (With names and infos)

2) In runtime : can i know the memory occupation into the video card ?

3) Excuse my ignorance : how obtain from a Matrix the 3 angles values? (in Rad or Deg)


Tks and Bye,
Corrado
05-02-2009 11:43 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
Re: 3 Small questions
Hello,

1) All the textures loaded are stored in the 'Images' which is a cache object. and it has a 'memx' member which actually stores the textures. However it is a private member and cannot be accessed. Could you let me know what for do you need such functionality?

2) Currently there is no such option. Usually DirectX handles management of the resources so if they aren't used it swaps the data to the virtual memory. So generally you shouldn't worry about this case.

3) A Matrix is built from 4 vectors:
3 for directions and 1 for position (not angles)
Please let me know what angles do you mean exactly.
05-03-2009 03:59 PM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #3
Re: 3 Small questions
...

1) In fact i have in my game a lot of objects and textures.
I load/free in run-time the objects and in some circumstances i wish to load/free also the textures so i need infos about the textures.

2) Some times : if i have a lot of objects and textures the fps go down, i think this is because the video card memory is full : i free some
data and no problem but i prefer to have a runtime report about the video memory occupation.

3) Some times i need the angles value (axis x,y,z values in degree) of some entities and so if i can obtain from matrix these values will be better,
otherwise i have to store these values in advance and occupy memory.

Corrado
05-03-2009 05:17 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
Re: 3 Small questions
Hi,

1,2) DirectX Automatically manages the textures (swaps between VideoRam and SystemRam depending if the texture is needed) so there should be no problem on that.
You can check here for more info about how the DirectX handles the resources <!-- m --><a class="postlink" href="http://msdn.microsoft.com/en-us/library/bb172341%28VS.85%29.aspx">http://msdn.microsoft.com/en-us/library ... 85%29.aspx</a><!-- m -->
However I've added D.availableMem() method (available in the next engine version) which will return the available memory on the video card

3) I'll try to make a function "Vec Matrix3::angles()" which will return the x-y-z axis angles, from which you'll be able to reconstruct the matrix using the formula:
Matrix3 m;
Vec angles=m.angles();
m.setRotateZ(m.z).rotateXY(m.x,m.y);
05-03-2009 05:59 PM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #5
Re: 3 Small questions
ok

i wait for D.availableMem() and Vec Matrix3::angles()

many thanks,
Corrado
05-03-2009 09:27 PM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #6
Re: 3 Small questions
Hello,

i forgot...

1) can you add also a D.availableSysMem() for the system memory ?

and

2) do public the infos about the loaded textures ?

Thanks,
Corrado
05-04-2009 09:39 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
Re: 3 Small questions
They'll both be available in the next engine release (please check then version history for the info)
05-06-2009 10:58 AM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #8
Re: 3 Small questions
Many Tks

Corrado
05-06-2009 08:47 PM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #9
Re: 3 Small questions
Many Thanks about the new Matrix Angles, memStats and availableMem.

1) Just one question :

how i can use all the free memory : phys, paged, virtual ?
I use malloc() and the free memory is around 1.2 Gb (with 4Gb Ram installed)
The values of stats are around : phys=2.8Gb paged=4.8Gb virtual=2.0Gb

2) What about the Textures Infos ?

Tks
Corrado
05-07-2009 01:07 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #10
Re: 3 Small questions
Hello,

1) It is automatically managed by the Operating System.
It's encouraged to use Alloc or new (instead of malloc)

Quote:free memory is around 1.2 Gb (with 4Gb Ram installed)
-System already eats up resources
-You need to have 64-bit OS or one of the latest 32-bit with some options set (it's OS specific)

2) This applies to Cache::lock,unlock mentioned in the version history
05-07-2009 08:46 AM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #11
Re: 3 Small questions
Hello,

1) More than 2Gb (on Windows XP) : I found on internet to insert this : /3GB on the file c:/boot.ini : i tried and it works.

2) Textures : im sorry, excuse my ignorance, but please explain me how use cache for the textures infos (two lines of code).

Tks
Corrado
05-08-2009 01:56 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #12
Re: 3 Small questions
Hello,

All the textures are automatically loaded in the "Cache<Image> Images;" from "graphics\image.h"

Now you can use the methods that I've added, "Cache::lock,unlock" to access the data memory container in the cache

Code:
Memx<Cache<Image>::Elm> &data=Images.lock(); // lock container

// perform custom operations on 'data'

Images.unlock(); // unlock container
05-08-2009 10:30 AM
Find all posts by this user Quote this message in a reply
Corrado Offline
Member

Post: #13
Re: 3 Small questions
Many Tks,

Corrado
05-12-2009 07:28 PM
Find all posts by this user Quote this message in a reply
Post Reply