Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 26 May 2011
Offline Last Active Apr 30 2013 08:38 AM

Posts I've Made

In Topic: using a line to pick objects

26 December 2012 - 07:39 AM

Just to be sure, is trapezoid considered a plane? And D3DXPlaneFromPoints which create plane from 3 vectors can be used to create trapezoid?

In Topic: Memory leak when doing multiple thread

21 September 2012 - 05:49 AM

check if the directx functions you are using are thread-safe without any code, it's hard to help you as you should know, in threading, all threads can access the same (shared) memory without mutex locks, you can't be certain that the same memory isnt accessed or overwritten by threads at the same time one bad example is: if you allocate memory at the same time on both threads, both pointers could end up with the same value! (memory offset) threads don't necessarily start in the order you started them in they don't execute at the same speed just google threads! theres LOTS you need to know about them before you can start using them in a game!! start using threads in a small test project and find out what you can and can't do!

I know how bad it is to go multi-threading, but I don't know how else I will load stuff behind the loading screen.

Have you tried non-blocking or asynchronous I/O?

I've created a mutex lock, still doesn't fix the leaks. I've tried WM_TIMER which I understand it's one of asyn io processes, doesn't fix the leak either. So I don't think it's multi-threading resource issue.
Here's the some sort of algorithm. Hope this will help.

Retrieve info
if player is initialized.
	 separate the player and equipments from resource pool.
Flush the resource pool. This includes Skybox primitives and texture, object's model and animation, terrain, and lights' shadow maps.
Open the file
if(file == null)
	 Messagebox ("cannot open file")
Load new resources by reading info from the file.
if player is initialized
	 add the player and equipments back to resource pool
	 initialize player and add it to the resource pool
delete file.
hide loading screen.
release mutex
close mutex

In Topic: [c++] having shadow map larger than display window

30 August 2012 - 07:43 AM

do you also swap the depth buffer with one with the same size as the shadowmap?

so that's the problem. Should I create another texture for this swapping?

In Topic: [c++] having shadow map larger than display window

30 August 2012 - 07:06 AM

I swap default render target to shadow map's surface before rendering the map, then swap back when finished, if that's what you mean.

you ask why does screen have 4:3 ratio? Isn't it still standard resolution ratio nowaday? I mean I will, at least, try to make this game go public, so shouldn't it at least have 4:3 ratio?

In Topic: [c++] having shadow map larger than display window

30 August 2012 - 05:26 AM

Can you expand on this - something with the effect framework generates an error?

HRESULT result = effect->ValidateTechnique(ShadowTechnique);
  {// will generate error -2005530591 D3DERR_CONFLICTINGRENDERSTATE
   MessageBox(cq->handler(), "Failed validating Shadow Mapping technique", "ERROR", MB_OK);