Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

1011 Excellent

About turnpast

  • Rank
    Advanced Member
  1. Sorry, I have not been doing DX stuff recently and have not tired sharpdx version 3 yet. My only suggestion is to try getting your device and swap chain in a different way (use DXGI directly) and try to figure out if the problem is with getting the device or creating the swap chain. Dunno if there are any examples of this the current docs for sharpdx are a little weak so you may have to spend some time in the msdn C++ docs.
  2. Did you install the Windows SDK? I believe that it is required to develop D3D11 applications on windows 7.
  3. Yeah it used to be Managed C++ then C++/CLI and now I guess it is C++/CX leave it to MS... Anyway, if portability is a required feature then the whole problem becomes somewhat more difficult. The code you posted looks to be using a bunch of MS specific COM APIs and I strongly suspect that making it cross platform is simply not in the cards.   Looks like you can embed mono in C though. Perhaps that is the path you should be pursuing.
  4. Sorry, CLR hosting is, unfortunately, not somehitng I know much about. It does strike me as something fairly advanced and quite possibly overkill (unless you really need a customized CLR). If you just want to load and run .NET assemblies or code consider using C++/CLI (see: the '/clr' flag) either on your main applicaton or in a secondary dll (if your main application must be completely unmanaged). You should be able to do everything you need (app domains, dymnamic loading, dynamic compilation etc.) to support C# scripting without a customized CLR.
  5. Can you clarify what exactly you are trying to do?   If you are trying to make calls from c/c++ into a C# assembly (dll) then I believe that the preferred way is to create an adapter using C++/CLI as you should be able to both expose a c or c++ api and make calls directly.   If you are trying to make calls from C# to a C api than the prefered way is probably pinvoke. If you have a c++ api then C++/CLI wrapper.   Both pinvoke and C++/CLI should allow passing of function pointers if needed (with some legwork anyway) . All the COM shenanagins is a bit over my head, is using COM a requirement for this project? I know that you can import com in a c# project (see: tlbimp.exe) and I belive that you can export one as well but I generally avoid COM unless it is absolutely required.   Hope this helps.
  6. turnpast

    Geom. shader, almost there?

    I'm not entirely sure, but it looks like you problem could be the winding order of your output. With triangle strips you have to swap the order for every other triangle. You can also just output as a triangle list by restarting your strip after every three vertices (but you will have to output 6 instead of 4). Here is some more info on topology in direct3d msdn. You can also test this by turning off back face culling and seeing if all of your geometry becomes visible.
  7. Here is an Article on possibly related behavior in GLSL. (sorry I can't get the GD edit feature to work).
  8. I'm not much of an expert in HLSL, but I suspect it may have to do with dynamic branching. Have you tried using an unroll attribute on your for loop (NumSpotLights will need to be const)? This should give you a clue if nothing else.
  9. turnpast

    Dynamic Vertex Streams in SharpDX

    Yes, you have it right. And honestly it is not that important if you are just getting started, just do what seems right and worry about performance when it becomes a problem.
  10. turnpast

    Dynamic Vertex Streams in SharpDX

    Sorry, I just coppied my code and did not rename things to match yours. InstanceBuffer is the dynamic vertex buffer ('buffer' in your code I believe). You don't need to specify the offset/count in WriteRange if you are writing the entire contents of the source array. The data stream will be invalid will be invalid after the Unmap call so don't try to use it again. The discard mode is a little more advanced, and related to performance. Typically dynamic graphics resources are notably slower than non-dynamic resources and the device driver dose a fair bit of extra work to keep them sane across the GPU/CPU boundary. Telling direct3d that it can throw away the previous contents of the buffer by specifying the discard flag allows for a number of internal optimizations that you will want to take advantage of unless you have a good reason not to. Probably not something you need to be too concerned with at first.
  11. turnpast

    Dynamic Vertex Streams in SharpDX

    Yeah you will want to get rid of your top level data stream and keep instead a top level buffer size variable (totalBytes). Here is some code I have used in the past: DataStream ds; context.MapSubresource(InstanceBuffer, MapMode.WriteDiscard, SharpDX.Direct3D11.MapFlags.None, out ds); ds.WriteRange(sourceData, 0, count); context.UnmapSubresource(InstanceBuffer, 0);
  12. turnpast

    Dynamic Vertex Streams in SharpDX

    Looks like you are trying to keep an open handle into your vertex buffer and this is most likely the thing that is causing you problems. Every time you want to update your dynamic buffer (this could be every frame) you will need to call MapSubresource to get a writable handle (or stream) fill it with data and then call UnmapSubresource before attempting to use it in any Draw calls. I could be wrong, but I believe that the Buffer constructor that takes a stream expects a readable stream to populate the buffer at creation time and I am surprised it works at all with a dynamic buffer as they tend to be pretty fickle about when and how you can write them. Typically you will also want to use the MapMode.WriteDiscard flag in your map call indicating to direct3d that it can throw away the previous contents of the buffer. Hope this helps.
  13. turnpast

    Backup Software for Small Teams

    At my last position we used Cobian Backup (I believe version 9). We just made nightly archives onto a server across the windows network and less-regular archives onto removable drives. It was/is free and was more or less adequate for a small ( < 100GB development files) operation. It was not always easy to find and fix things when they went wrong (disk space and name changes being the most common), but in general it worked - at least better than no backups at all.
  14. turnpast

    Fixed-radius near neighbor search

    Look into B-Trees and in particular the B+ Tree. You should be able to create a spatially specific strategy for the generation/selection of sub nodes that is fairly efficient for nearest neighbor problems with adaptive data. If you are willing to do a little more theory work the Z-order looks really interesting and I suspect it could be quite fast for this class of problem. Hope this helps.
  15. The docs suggest that a set of delays (pDelayTimes) can be calculated by the X3DAudioCalculate function if it is passed the X3DAUDIO_CALCULATE_DELAY flag. As far as I can tell once you have the delays you are on your own though as XAudio2 does not seem to have a built in way of applying the delays to the audio stream. It may be that you will have to implement your own XAPO to actually apply them. If there is some better way to apply a delay and you find it I would love to know about it.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!