• Content count

  • Joined

  • Last visited

Community Reputation

150 Neutral

About Yenian

  • Rank
  1. Render DirectX in Windows Form

    SlimDX has a set of 3 intro tutorials on their site that will get drawing a triangle in a DirectX Context on a Windows Form.   When I say SlimDX diverges slightly, it is only very slightly.  IIRC, the state blocks (BlendState, RasterizerState, DepthStencilState) and some of the Desc structs have members slightly reorganized from their native cousins.  I've managed to port a fairly extensive C# graphics project from library to the other with minimal effort: other than changing the #using from SlimDX.whatever to SharpDX.whatever, and the mismatches in descs and states, almost everything behaves similarly and usually has the same name.   Because of that, I'll bet you could follow the SlimDX tutorials using SharpDX with some name substitution and get pretty close.  You'll find more help resources for SlimDX than SharpDX, so maybe you should consider using that.  They both support DX11, and both are good libraries.
  2. Render DirectX in Windows Form

    Unless you're absolutely set on creating your own bindings to access DirectX from .NET, might I recommend either SlimDX or SharpDX?   Both are managed wrappers around DirectX. SlimDX is older and supports D3D9 through D3D11; SharpDX only supports D3D10/11.  SlimDX diverges slightly from directly wrapping the DirectX spec; SharpDX is auto-generated from the headers and therefore cleaves very closely.   Either one of these should let you render into a .NET Windows Form with minimal effort.
  3. The most basic answer is that taking the dot product of the surface normal for a point you are shading with the normalized vector to the light source being considered gives you the contribution that light source makes to the perceived color at that point on the surface, if the surface is entirely diffuse, and has no specular/illuminance/more advanced BRDF. The wikipedia article on lambertian reflectance may help: [url=""]http://en.wikipedia....ian_reflectance[/url]
  4. Only if your render step makes an effort to interpolate between physics update steps is there any reason to render faster than you update. Displaying two identical images in a row for half a second each is the same as displaying one image for a full second. I don't know if Box 2D allows you to do this easily. (Never used it) If you are not making this effort, then there is no point in doing a new render if you haven't done a physics update to cause a change to the screen image. In some physics heavy AAA titles, physics will actually be updated many more times per frame than a render or other update. This done gain a better approximation of the curves objects trace as they interact; Forza 3 I believe runs a physics update at 300hz, render at 60 hz to match the display refresh. There are many methods of maintaining numerical stability in a physics simulation; small time steps can help. Supreme Commander on the other hand only updates it's simulation at 10 hz. Changes to the state of the world, (unit orders, etc.) are actually only updated 10 times a second; units are updated once per frame to interpolate between simulation updates, so they appear to move smoothly through the environment. Supreme Commander does this to make it possible to synchronize the thousands of entities that can exist in a multiplayer game across the network; without the long intervals it would not be possible to keep all clients in sync. (and even then it can break down sometimes). There are many ways to construct a game loop; if you are just starting to learn then sticking with a simple 'update then render' loop is probably fine. No need to get into simulate->update->render or multi-threaded update unless you are specifically interested in learning them or your project demands it.
  5. Adapters Enumeration Issue

    [quote name='EverXiao' timestamp='1315848379' post='4860761'] Hi iedoc, thank you for the reply. I have the driver up to date, and when I try set the first param of EnumAdapters to 1 instead of 0, it just return nothing. The reason why I have to get all cards and setting the one my program going to use is that most of the games(nearly all) will start with the better graphic card it finds in my notebook(Nvidia one), I really want to know how I can make my program do the same. I made some search and find that the games that know which card to use are actually in the list of Nvidia control panel on my notebook, even I haven't set them there by myself. I don't know how to do it yet but I guess this is the way to go rather than doing it in the program? [/quote] You may need to set something specific in your NVidia settings for your executable. I have a laptop with the same graphics card configuration, and unless I set my application to use the GeForce 525, it's started using the Intel card. It's possible that the system graphics settings actually block your application from seeing both adapters, since the intent is that one is used in 'low power' situations to conserve battery. I haven't tried enumerating adapters, but without setting that feature I would create a DirectX 10.1 feature level device instead of a DX11 feature level device, since it would use the Intel card by default. Try adding your executable to the list in your NVidia settings.
  6. Deploying C++ DirectX 9 games from XP to 7

    One thing to try is installing the VS2008 C++ Redistributable on the Win7 machine; I remember fixing something similar that way a couple years ago. If that works, you'll need to bundle that with your installer.
  7. SDL and Xbox

    [quote name='nfries88' timestamp='1303421845' post='4801390'] SDL does not run on XBLA and likely never will, unless someone crafts a C interpreter for C# But there's no reason why an SDL-based game couldn't be used for a pitch. But why use C(++) and SDL when you can save yourself loads of time by starting with C# and XNA? [/quote] XBLA does not require use of C#/XNA. Most XBLA games are developed against the native XDK using C/C++. XBLI is the channel that restricts you to C#/XNA; for XBLA it is only an option. 'Schizoid' was the first XBLA game to be released that used C#/XNA as it's primary development platform; how many XBLA games were released before 'Schizoid'? This seems to be a very common misconception about how games are developed for different segments of the service. XBLI == C#/XNA. XBLA == (C#/XNA OR Native XDK) That said, I don't know enough about SDL to comment on how readily it would run on an Xbox 360 via the native XDK.
  8. Yes, Managed DirectX is deprecated and has been unsupported for years now. Use of SlimDX or XNA is strongly recommended.
  9. Wireless controllers always communicate with the console/PC wirelessly; they only use the USB cable for power. In order you use a Wireless Xbox 360 controller with your PC, you need the Xbox 360 Wireless dongle for PC, and then you need to sync your controller with that dongle. If you use a wired 360 controller, it should just work.