sharpdx

Is there a SharpDx Template, for a Windows Universal App?

与世无争的帅哥 提交于 2019-12-18 17:30:22
问题 I tried to write a game for Windows and Windows Phone 8.1, with SharpDx. But when I try, to add a Windows Phone 8.1 Version to my already existing Windows 8.1 Game, I get a few errors and the App doesn't work. Now the question: Is there an SharpDx Template in XNA Style for a Windows Universal App, like the Template I got for my only Windows 8.1 Game (from the SharpDx Visual Studio Extension)? 回答1: No there isn't, yet. What you should do is open an issue (https://github.com/sharpdx/SharpDX

How to create bitmap from Surface (SharpDX)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 13:35:06
问题 I am new to DirectX and trying to use SharpDX to capture a screen shot using the Desktop Duplication API. I am wondering if there is any easy way to create bitmap that I can use in CPU (i.e. save on file, etc.) I am using the following code the get the desktop screen shot: var factory = new SharpDX.DXGI.Factory1(); var adapter = factory.Adapters1[0]; var output = adapter.Outputs[0]; var device = new SharpDX.Direct3D11.Device(SharpDX.Direct3D.DriverType.Hardware, DeviceCreationFlags

Playing a sound from a generated buffer in a Windows 8 app

爷,独闯天下 提交于 2019-12-18 12:35:03
问题 I'm porting some C# Windows Phone 7 apps over to Windows 8. The phone apps used an XNA SoundEffect to play arbitrary sounds from a buffer. In the simplest cases I'd just create a sine wave of the required duration and frequency. Both the duration and frequency can vary greatly, so I'd prefer not to rely on MediaElements (unless there is someway to shift the frequency of a base file, but that will only help me with the single frequency generation). What is the equivalent of an XNA

Include mouse cursor in screen capture using SharpDX

蹲街弑〆低调 提交于 2019-12-13 19:43:14
问题 I'm using the ScreenCapture sample of SharpDX library to be able take a screenshot of a game that is in fullscreen (because common GDI+ capture techniques here doesn't work, even the Windos default "Print" key cannot take a proper screenshot of the game). The code that I'm using in my application is practically the same of the official sample linked above (translated to VB.NET), so I think is not necessary to publish the same code block here. The problem I have is that I would like to include

HUD basics using SharpDX: How to Draw over the screen surface?

浪子不回头ぞ 提交于 2019-12-13 13:21:31
问题 Scenario I'm planning to learn the basics about how to develop a custom HUD for a 3rd party PC-game (free, legal), my intention is to develop an application that will draw/show additional info on the screen (by reading mem addresses). So I've researched for profesional projects and I've found TurboHUD that uses SharpDX library to draw objects/overlays/text over the screen using that DirectX based library and the results are very good (it does not loose performancy at any moment when drawing

Resizing and position a SharpDX sprite

两盒软妹~` 提交于 2019-12-13 05:19:40
问题 I'm trying to resize a DirectX Texture and place it in the top right corner of the window. I am drawing the texture using a sprite, here's is my code (I am using SharpDX): albumArtSprite.Begin(); NativeMethods.RECT rect; NativeMethods.GetClientRect(device.CreationParameters.HFocusWindow, out rect); float targetDimensions = 150f; var matrix = Matrix.Scaling(targetDimensions / albumArtInformation.Width, targetDimensions / albumArtInformation.Height, 0f) * Matrix.Translation(rect.Width -

Projecting a 3D point to a 2D screen position issue

送分小仙女□ 提交于 2019-12-12 10:18:45
问题 I have tried 4 methods, all which didn't work. Everywhere else my code works, the camera moves properly and the objects move properly. I am using SharpDX and my projection matrix is a perspective projection matrix. I am trying to get the screen position of a 3d point in order to position the cursor at that point. These are the 4 methods I have tried: public Vector2 WorldPosToScreenPos1(Vector3 p) { Vector3.Transform(ref p, ref View, out p); Vector3.Transform(ref p, ref Projection, out p);

sharpdx_direct3d11_effects_x64.dll DLLNotFoundException

不羁的心 提交于 2019-12-12 05:04:41
问题 What's the correct procedure for deploying WinForms / WPF Applications which use SharpDX.Direct3D11.Effects v3 NuGet package? They seem to depend on two unmanaged DLLs: sharpdx_direct3d11_effects_x64.dll sharpdx_direct3d11_effects_x86.dll Should these be copied to the output directory? As a post build step or otherwise? 回答1: After we publish the WPF/WinForms applications from Visual Studio, it will generate an Application Files folder which contains .dll.deploy files. I installed the SharpDX

SharpDX.Direct2D1.RenderTarget.EndDraw doesn't return HRESULT - how detect a failure? Especially D2DERR_RECREATE_TARGET?

佐手、 提交于 2019-12-12 04:43:31
问题 Porting code from Microsoft's old managed DirectX interfaces to SharpDX. The documentation for Microsoft's ID2D1RenderTarget::EndDraw says that it should return an HRESULT : If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code and sets tag1 and tag2 to the tags that were active when the error occurred. Especially important is that this is the place I would usually detect the need to recreate the target ( D2DERR_RECREATE_TARGET ). Indeed, Microsoft shows this in

Can I create a text outline in SharpDX using a custom text renderer?

一曲冷凌霜 提交于 2019-12-12 04:08:32
问题 Background Previously I was rendering text, and giving it a glowing outline by drawing the outline 1px to each side and then placing the text on top: // Draw outline 1px to each side context2D.DrawTextLayout(new Vector2(-1, 0), _textLayout, _highlightBrush, DrawTextOptions.NoSnap); context2D.DrawTextLayout(new Vector2(0, -1), _textLayout, _highlightBrush, DrawTextOptions.NoSnap); context2D.DrawTextLayout(new Vector2(1, 0), _textLayout, _highlightBrush, DrawTextOptions.NoSnap); context2D