Search Results

Search found 6 results on 1 pages for 'motig'.

Page 1/1 | 1 

  • Multi Threading - How to split the tasks

    - by Motig
    if I have a game engine with the basic 'game engine' components, what is the best way to 'split' the tasks with a multi-threaded approach? Assuming I have the standard components of: Rendering Physics Scripts Networking And a quad-core, I see two ways of multi-threading: Option A ('Vertical'): Using this approach I can allow one core for each component of the engine; e.g. one core for the Rendering task, one for the Physics, etc. Advantages: I do not need to worry about thread-safety within each component I can take advantage of special optimizations provided for single-threaded access (e.g. DirectX offers a flag that can be set to tell it that you will only use single-threading) Option B ('Horizontal'): Using this approach, each task may be split up into 1 <= n <= numCores threads, and executed simultaneously, one after the other. Advantages: Allows for work-sharing, i.e. each thread can take over work still remaining as the others are still processing I can take advantage of libraries that are designed for multi-threading (i.e. ... DirectX) I think, in retrospect, I would pick Option B, but I wanted to hear you guys' thoughts on the matter.

    Read the article

  • XNA Spritebatch sorting by texture vs depth

    - by Motig
    I am refining my 2D game engine, and I want to look in to sorting sprite batches by texture (because I'm quite often using the same textures repeatedly). However, I also want to retain a few 'layers' of depth (i.e. ground < buildings < units < GUI etc). My question is, which of the following is the best approach (in terms of performance)? Create multiple SpriteBatches and Begin() and End() them in order; or... Create a single SpriteBatch and call Begin() and End() multiple times, once for each layer (in order)?

    Read the article

  • Cross-thread Winforms control editing

    - by Motig
    Hey, how can I edit the text in a windows form element if the code that is editing the text 'belongs' to a seperate thread from the one that contains the windows form? I get the exception: Cross-thread operation not valid: Control 'textBox1' accessed from a thread other than the thread it was created on. Thank you.

    Read the article

  • C# Custom EventArgs with no constructor?

    - by Motig
    I have a problem; I'm using an external library where one particular event has its own custom eventargs; with no constructor. If I want to throw my own event using these eventargs, how can I? I'll give more detail if asked, but I'm not sure what exactly I should be giving. :)

    Read the article

1