• Advertisement
Sign in to follow this  

[DX9] Deferred Message Processing

This topic is 2632 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I like to fiddle around a lot with multi-threading my 'engine', however, I've been running into a few problems, mainly due to this article on MSDN. but I really don't want to merge my message pump and rendering loop, but at the same time, I really want to avoid problems and the D3D multithreaded flag... However thanks to work, I no longer have any time to test anything, so instead, its time for pseudo-code :)

So, how well would a setup like this work in place of the standard message pump:

while(not shutdown)
QueueThreadTask(new InputJob(Msg)) //queue the message in the thread pool, do it at the highest level possible
//the render thread has its own computations to do

if(not CheckCoop()) //yay now its being called from the message thread

DoRendering() //this is too, but its not being delayed by input processing

or does D3D require that the messages go through the WNDPROC before I queue them? what at the downfalls of something like this? or is there a better way? With this kinda of model, can I also queue off resource creation(V/I buffers, textures, shaders etc)?

Something I'm curious about is if I need a WNDPROC even if I don't dispatch messages to it via DispatchMessage.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement