• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

499 Neutral

About alexisgreene

  • Rank
  1. 48 Hour Challenge Result

    Armor stat represents the percentage of damage that is mitigated. When I added that mechanic to the game, I had the intent of adding different armor and weapon items that could be equipped by the player and by the space pirates. I ran out of time before I could add that so I just added +5 upgrades that could be found as you travel instead.       I compiled this without thinking of turning the Windows XP compatibility option on in Visual Studio 2012. I have been using Windows 7 for a few years and tend to forget that a lot of people haven't jumped on that bandwagon. You must have the runtime components installed in order to run any program compiled with Visual Studio 2012 (http://www.microsoft.com/en-us/download/details.aspx?id=30679). I compiled an XP compatible version for you. I will have to dust off my old XP laptop in order to test it out, but here is a link anyway. Maybe you can confirm it works before I have to do that.   [attachment=16189:Galaxy Quest.zip]
  2. 48 Hour Challenge Result

    I managed to collect about 80+ pieces and had a ton of hp and upgrades. I thought I was going to win but that asteroid took me out as well! Thanks for trying it out! I checked out Flotilla just now. Seems to be somewhat like 3D chess and I like that a lot. I will definitely keep checking the progress made on Flotilla 2 now. Thanks for the link.
  3. I have been doing a major rewrite of the game engine I have been working on for two years. It is tedious and most of the time it is just plain boring. I decided to create a small side project just to make things interesting for a bit. I remembered hearing about a 48 hour game coding challenge and decided to try it out for myself. Although I gave myself 48 hours, I only put in about 6 hours of actual work.   It is a simple text based game called Galaxy Quest. There is room for a ton of improvement, but I decided to stop coding at the end of the time limit. I thought I would share the end result with those of you who may be interested.   The moral of this story: When things begin to seem mundane, do something simple and silly to make it fun again!   [attachment=16182:Galaxy Quest.zip]   Edit: Although I have come close, I have not beat this game yet. If you are interested in trying, a good hint is to avoid fighting until you have a few upgrades.
  4. Personally, I believe there is a widespread misconception that everything must be wrapped in a class when programming in C++. I try to stick to the keep it simple philosophy which is to simply keep things as simple as possible, but not any simpler. Singletons are a completely over-engineered version of a global variable. I avoid the use of singletons by creating a file-scope variable that is accessed via a method. It is a clean and simple solution. As for your dilemma, I recommend this approach in order for you to get a reference to the manager (although I prefer to pass references as parameters to the methods that need them whenever possible).
  5. Viewing in memory textures in VS 2012

    Thanks for the tip unbird!
  6. VS2012 & Git Problem

    I sucked it up and just learned how to use Git from the console. Everything works fine that way. Thanks for the advice.
  7. Viewing in memory textures in VS 2012

    You can view all resources from within the graphics debugger. It seems that textures are accessed by an ID number (i.e. obj:21) and I am not aware of a way to actually watch or name a texture. You can click on Object Table view and scan for the texture that has the right format, height, and width, or, if you create or bind it a specific point, you can locate the the link to the texture in the Event List. Once you find the texture, just click on the ID number (i.e. obj:21) and the texture will open up as a *.dds image.  
  8. VS2012 & Git Problem

    The link works for me. The error I am getting is "Value was either too large or too small for an Int32." I find this strange because all I have done is right click on the branch and click the switch option.   I do not use Git from the console because I do not know any commands for it; I have never used Git before. Also, being able to commit, branch, and merge from within Visual Studio is sufficient for me. That may sound foolish for those who do use Git from the console, but, for me, using the console is only an option when I am working on Linux.
  9. I have been wanting to start using Git version control for a while and now that Visual Studio 2012 supports it natively, I decided to give it a shot. Everything seemed to work pretty good until I tried to create a new branch to try a few ideas out. The branch itself is created just fine, but when I try to switch over to that branch from within Visual Studio, I get an error message:     I have tried for a few days to find the solution to this on my own but have come up with nothing. I am hoping one of you can help me. Thanks in advance.
  10. Multithreading and ID3D11DeviceContext::Map

    Out of curiosity, I decided to see where the CPU was spending the most time at.     The user interface thread:     The main rendering thread:     In my opinion, it seems that letting a separate thread incur the expense of the Map/memcpy calls on a deferred context and then letting the main thread spend relatively no time executing the resulting command list is a pretty nice solution. The alternative would be to lock the immediate context in order to perform the Map/memcpy/Unmap. Doing that would, in a sense, force both the user interface thread and the main thread to pay the price.   Did the AMD developer give any reasons for discouraging the use of deferred contexts?
  11. Multithreading and ID3D11DeviceContext::Map

    Thanks for the confirmation. I got so focused on posting what I found out that I forgot to mention that it works now. All that is left for me to do is clean up the code but before I do, I was wondering if there is a way to reuse that temporary buffer? Or is it automatically being reused by the API? It just seems terribly inefficient to have to allocate and release a buffer every frame just to update a texture.
  12. Multithreading and ID3D11DeviceContext::Map

    I have somewhat figured out... Its appears that when you call Map() on a deferred context, memory is allocated by the API and a pointer to that memory is what is returned (immediately) in the D3D11_MAPPED_SUBRESOURCE struct. All writes are actually written to this temporary memory. The Map() and Unmap() calls are recorded to the command list. Executing the command list results in the actual resource data being updated with the data written to the temporary memory. Releasing the command list will free this temporary memory. Command list interfaces are free threaded, just like the device interface. (This means I don't have to sync the command list for creation on the interface thread and execution on the rendering thread.) This may not be 100% correct but I am positive I am close to accurate. I have not figured out if the temporary memory is allocated on the GPU, but it's location is pretty far off from all other pointer locations I am using in that section of code (i.e. 0x0b5----- returned from deferred context Map() call vs. 0x16b----- that appears everywhere else, including what the immediate context Map() call returns). I look forward to your feedback.
  13. Multithreading and ID3D11DeviceContext::Map

    I managed to rewrite the code faster than I anticipated. Using the deferred context did, in fact, take care of the threading problem. However, the user interface texture does not update. I believe that the Map() and Unmap() calls made on the deferred context must be executed by the immediate context via a command list. If this is the case, I am utterly confused and here is why...   DeferredContext->Map(); // Get a pointer to sub resource data memcpy(); // copy some new data to that location DeferredContext->Unmap(); DeferredContext->FinishCommandList(); // Map(), and Unmap() get saved to this but NOT the memcpy call ... ... ... ImmediateContext->ExecuteCommandList(); // What happens to the memcpy call to modify the data that Map() gives access to???   At the same time, I know that calling Map() does return a usable pointer immediately. If it did not, I would get an access violation from immediately trying to update the texture data.   There is very little information in the D3D docs about how Map() and Unmap() work with deferred contexts. Any help in the right direction would be greatly appreciated.
  14. Over the last two months I have been converting my engine from 64-bit single threaded to 32-bit multithreaded. The decision for multithreading is for various performance reasons. The decision for 32-bit is because I use Chromium Embedded Framework to power HTML (and CSS, Flash, Java, etc...) based user interfaces. I had originally wrapped CEF in a separate 32-bit process and used shared memory so that it could communicate with my 64-bit engine. I believe that this was the cause of false positives from my anti-virus software so I decided that going 32-bit to use CEF directly was a justifiable option.   CEF creates multiple threads internally. One of these threads calls an OnPaint() function when it is necessary to update the user interface image data. Inside OnPaint(), I call m_pImmediateContext->Map() with D3D11_MAP_WRITE_DISCARD in order to update the user interface texture. This, obviously, is giving me problems...   D3D11: CORRUPTION: ID3D11DeviceContext::Map: Two threads were found to be executing functions associated with the same Device at the same time. This will cause corruption of memory. Appropriate thread synchronization needs to occur external to the Direct3D API. 66768 and 67180 are the implicated thread ids. [ MISCELLANEOUS CORRUPTION #28: CORRUPTED_MULTITHREADING ]   My first thought was to simply lock the immediate context before calling Map(). However, my user interface is rendered on it's own dedicated deferred context (concurrently with all other deferred contexts). Specifically, a command list is generated (on the user interface deferred context) for rendering the user interface overlay to the screen on start up. That command list is reused for the life of the program (since the sequence of commands for rendering the user interface does not change), leaving the user interface's deferred context unused, yet available. In theory, if I can use this unused context to update the texture, I should be able to avoid having lock the immediate context. It would require quite a bit of rewriting just to be able to test this theory, so I decided to ask before hand to avoid doing so in vain.   Can ID3D11DeviceContext::Map() be called on a deferred context and provide immediate access to subresource data?   I apologize for taking so long to get to the question. I just wanted explain my intent and what led me to this question.
  15. C++ TBB simple/silly 2D->1D array question

    For some reason I assumed that buffer was a pointer to bytes and not a pointer to BGRA8. That was a mistake on my part. I have edited my previous answer to take that into account.   Sorry for the mistake.
  • Advertisement