directx

C#: Creating a graphical screensaver

老子叫甜甜 提交于 2019-12-04 19:44:32
I am thinking about creating a screen saver. I have the whole thing, its graphics and the back-end kind of ready in my head. But I am not quite sure how to get the graphics out in code. What I would like is a slide show of images with a bit of movement (kind of like the slide show in media center) and some floating text and shapes on top. The shapes somehow translucent. I currently have a very simple static slideshow made in WinForms. Just a simple application that goes fullscreen and displays some images and pretends to fade them in and out in a hackish kind of way. But it is not very well

How to draw line and font without D3DX9 in DirectX 9?

天大地大妈咪最大 提交于 2019-12-04 19:28:32
I saw that D3DX9 is not recommended by Microsoft and not shipped with Windows SDK. I would like to adopt. I'm missing my line drawing utility. How can I replace ID3DXLine and ID3DXFont in "new" DirectX9? Generally, lines and fonts are sprites. ID3DXLine and ID3DXFont use ID3DXSprite interface under the hood. (Of course, there are other options too, but sprite approach is the most widely used) Drawing sprites So, firstly, you will need either 3rd party or your own sprite renderer. Typically, development of "bedroom" sprite engine, consists of stages: drawing bunch of simple colored quads (two

Recording a live video stream in C#/XNA

假装没事ソ 提交于 2019-12-04 19:18:29
I have a project that renders the web cam stream onto a texture. I was wondering if there was a way, either through DirectX's Audio/Video functionality or through XNA directly where I can record the stream into an avi file format? Thanks in advance for the help. Direct show will do exactly what you need through the ICaptureGraphBuilder For a C# wrapper, see: http://sourceforge.net/projects/directshownet/ I have used this VideoTexture Class before with success and would recommend you to use it. It gives you the current state as Texture2D , which is easily renderable and should be reasonable to

DirectX Screen Capture - Desktop Duplication API - limited frame rate of AcquireNextFrame

南楼画角 提交于 2019-12-04 18:39:00
I'm trying to use Windows Desktop Duplication API to capture the screen and save the raw output to a video. I'm using AcquireNextFrame with a very high timeout value (999ms). This way I should get every new frame from windows as soon as it at has one, which naturally should be at 60fps anyway. I end up getting sequences where everything looks good (frame 6-11), and then sequences where things look bad (frame 12-14). If I check AccumulatedFrames lFrameInfo.AccumulatedFrames the value is often 2 or higher. From my understanding, this means windows is saying "hey hold up, I don't have a frame for

OpenGL or Direct3D for a new Windows game project? Or something else?

我的未来我决定 提交于 2019-12-04 18:11:17
问题 I'm starting a hobby game project on Windows that will make heavy use of 3D graphics effects. It will most likely be written in C++. Should I use OpenGL or Direct3D for my graphics backend? Why? Or should I use a ready-made graphics engine such as OGRE 3D? Which one? Some "how to get started" links would be useful. (On either technology, or both.) Edit - Yes I really meant Direct3D, not DirectX, thanks to graham.reeds for clarification Edit - Mihai Lazar pointed out that I could also use a

Why does OpenGL be designed as a state machine originally? [closed]

喜夏-厌秋 提交于 2019-12-04 18:07:15
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . During my OpenGL experience, I often forgot to set some states. So I think state machine may not be a good design today. But now it

SharpDX: Enabling BlendState

主宰稳场 提交于 2019-12-04 17:21:05
I'm trying to get the "SharpDX.Direct3D11.DeviceContext.OutputMerger.Blendstate" to work. Without this, i have nice scene (Polygones with textures on it, for a Spaceshooter). I've done OpenGL Graphics in the past three years, so i thought it might be as simple as in OpenGL - just enable Blending and set the right Dst/Src Modes. But if i set a new BlendStateDescription, all Output is Black, even if "RenderTarget[x].IsBlendEnabled" is set to "false". I searched for a tutorial or something, and find one - but it uses effects. So my question is simple - do i have to use technique's and effects in

Calculating screen texture coordinates in CG/HLSL

蓝咒 提交于 2019-12-04 17:00:38
In OpenGL , sometimes when doing multi-pass rendering and post-processing I need to apply texels to the primitive's assembly fragments which are part of full screen texture composition.That is usually the case when the current pass comes from FBO texture to which the screen quad had been rendered during previous pass.To achieve this I calculate objects UV coordinates in SCREEN SPACE .In GLSL I calculate it like this: vec2 texelSize = 1.0 / vec2(textureSize(TEXTURE, 0)); vec2 screenTexCoords = gl_FragCoord.xy * texelSize; Now I am experimenting with Unity3D which uses CG /HLSL.The docs for

Directx 11 Front Buffer

我们两清 提交于 2019-12-04 16:57:25
I am hoping this is a easy answer to an easy question which I cannot find an answer to. How do I access the front buffer in Directx 11 / DXGI? I have found in Directx 9 you can use GetFrontBufferData() and you can use GetBuffer() in Directx 11 to get access to the backbuffer but there are problems with this. The backbuffer doesn't have calculations done to it that the front buffer does. So I was wondering if there is something I am missing. I could try using GetDisplaySurfaceData and unless I have mis-understood something then it wouldn't work because I am not always in full-screen mode. Edit:

C# Capturing A Fullscreen Game With SlimDX

时间秒杀一切 提交于 2019-12-04 15:39:42
I have recently made an application that takes screenshots of games. First I used GDI to capture the game but for that I had to disable aero at win7/vis and I had some issues on windows XP. Than I decided going with DirectX and after realizing that microsoft's DX isn't going to work for me, I found this great example of a SlimDX screen capture (http://spazzarama.wordpress.com/2009/02/07/screencapture-with-direct3d/) SlimDX worked GREAT! and it even allowed me to capture a game without having to disable aero on win7/vis. Only problem is - when I switch the game to fullscreen I get "D3DERR