Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 24 Oct 2005
Offline Last Active Jul 20 2016 02:48 AM

Posts I've Made

In Topic: Memory management of resources

16 April 2014 - 06:08 AM

@haegarr I think your concept of a resource pool is too much for my needs. It seems to me that the resource pool purpose is to reduce the dynamic allocations using new / delete but for now that isn't an issue. And besides, even when using the resource pool I'll still have to manage the memory manually but instead of calling delete on the pointer, I will need to tell the resource pool that the memory is not used anymore.


I'm considering going with an intrusive reference counting approach. It seems to me to have the most convenient usage with not too much overhead...

In Topic: Memory management of resources

16 April 2014 - 12:48 AM

Thank you guys for the responses


@imoogiBG - If I understand you correctly, you are basically using intrusive reference counting inside your resource classes?


@haegarr: I agree with the sole responsibility principle but I still can't see how you would solve the problem I described. Given a resource that wasn't loaded using the resource loader but was manually created how would you go about and manage its memory? or are you saying that every memory allocation would go through the resource pool?

In Topic: [Lua] Seeking advice for multiple OS Threads, handling lua_State

08 February 2014 - 01:28 AM

Can't you initialize your Lua states before hand and store them in an array, one for each thread?

Also you might want to look here, some of the libraries allow concurrent execution of Lua code

In Topic: Generating the coordinates of a plane

21 December 2013 - 01:54 AM

I would suggest to parametrize the plane using two orthogonal vectors that lie inside. Then every point on the plane would have the form:

P0 + a*V0 + b*V1 where P0 is the origin V0,V1 are the orthogonal vectors and a,b are scalars (this is basically an affine 2d space defined in 3d space)


Hope this helps

In Topic: How to create a level editor

01 June 2013 - 03:56 AM

Are you seeking to create a tilemap based level editor or polygonal one? (Also I assume you are aiming at a 2d game)

Both cases usually have different representation of the game world. With a tilemap, a 2D matrix specifying which tile to use at each (X,Y) is the most logical.

A polygonal map representation, at it's most naive form, will store an array of polygons. The representation of the game world greatly affects how you would implement

the level editing area in your editor