On Tuesday, 26 April 2016 at 09:07:59 UTC, Begah wrote:
I am trying to create an asset manager for my textures. I had
the idea ( it may be a wrong idea ) to create a hashmap of my
textures with a string as the key. When the program request a
texture, it firts check if it is in the hashmap and t
On Tuesday, 26 April 2016 at 09:07:59 UTC, Begah wrote:
I am trying to create an asset manager for my textures. I had
the idea ( it may be a wrong idea ) to create a hashmap of my
textures with a string as the key. When the program request a
texture, it firts check if it is in the hashmap and t
Am Tue, 26 Apr 2016 13:35:37 +
schrieb Begah :
> When the screen switches to another screen ie from menu to the
> game,
> I want that the "button.png" texture is automaticly destroyed by
> the gc.
My ideological point of view is that you must not use
non-deterministic garbage collection for
Thus, i need a way to tell the gc to ignore the reference ( or
something similar ) in that hashmap.
So, having pointer that doesn't hold a reference isn't that hard
(store it in memory region that is unreachable to gc), but don't
you need a way to tell if that pointer ins't dangling, beyond
i
On 26.04.2016 15:35, Begah wrote:
Nothing will reload.
An example :
I load a texture "button.png" in a class and draw it to the screen,
When the screen switches to another screen ie from menu to the game,
I want that the "button.png" texture is automaticly destroyed by the gc.
But this will neve
On Tuesday, 26 April 2016 at 13:01:26 UTC, ciechowoj wrote:
On Tuesday, 26 April 2016 at 09:07:59 UTC, Begah wrote:
How could i tell the garbage collector to ignore the reference
in the hashmap and to free it if there isn't any other
reference that in my hashmap?
You could always zero the ref
On Tuesday, 26 April 2016 at 09:07:59 UTC, Begah wrote:
How could i tell the garbage collector to ignore the reference
in the hashmap and to free it if there isn't any other
reference that in my hashmap?
You could always zero the reference in the hashmap, as it won't
be valid after reload any
On Tuesday, 26 April 2016 at 09:07:59 UTC, Begah wrote:
I am trying to create an asset manager for my textures. I had
the idea ( it may be a wrong idea ) to create a hashmap of my
textures with a string as the key. When the program request a
texture, it firts check if it is in the hashmap and t
I am trying to create an asset manager for my textures. I had the
idea ( it may be a wrong idea ) to create a hashmap of my
textures with a string as the key. When the program request a
texture, it firts check if it is in the hashmap and then returns
if it is :
Texture[string] textures;
Text