Click here to Skip to main content
15,886,799 members
Everything / Multimedia / DirectX

DirectX

DirectX

Great Reads

by Dr. WPF
.NET 3.5 SP1 is here! It's time to break out your DirectX skills. This article provides the information necessary to get started using a new DirectX interop feature in WPF called D3DImage.
by shunninghuang
CPS1 emulator, ROM hacking
by Maxim Kartavenkov
Article describes how to make H.264 Video Encoder DirectShow Filter using NVIDIA encoder API in C#
by CMalcheski
Thinking outside the box can result in critical performance gains

Latest Articles

by Michael Chourdakis
An introduction to machine learning with working C++ code that trains a linear regression model.
by Michael Chourdakis
DirectX hardware screen capture and encoding with audio mixing capabilities. H264/H265/VP80/VP90/FLAC/MP3. HDR supported.
by Shao Voon Wong
Lee Algorithm Mazesolver in MFC and Direct2D
by ColleagueRiley
A multi-platform single-header very simple-to-use framework library for creating GUI Libraries or simple GUI programs.

All Articles

Sort by Updated

DirectX 

N 18 Apr 2024 by Michael Chourdakis
An introduction to machine learning with working C++ code that trains a linear regression model.
20 Mar 2024 by Michael Chourdakis
DirectX hardware screen capture and encoding with audio mixing capabilities. H264/H265/VP80/VP90/FLAC/MP3. HDR supported.
3 Mar 2024 by Shao Voon Wong
Lee Algorithm Mazesolver in MFC and Direct2D
25 Feb 2024 by ColleagueRiley
A multi-platform single-header very simple-to-use framework library for creating GUI Libraries or simple GUI programs.
30 Sep 2023 by honey the codewitch
Run and develop Arduino code, including a display, on PC using this Windows PC shim and emulator.
13 Sep 2023 by honey the codewitch
I have a little directX that is simply an overlapped window with a Direct2d surface on it. In WM_PAINT, I try to fill some memory with the color purple, and then copy that to a bitmap, before writing the bitmap to a display. Trouble is,...
13 Sep 2023 by Maxim Kartavenkov
You should made proper question naming as your question is about Direct2D not the DirectDraw - different technologies. Anyway here is the simple workable example implementation of what you need. It trigger repaint event each second and update...
18 Aug 2023 by EgorYusov
This article introduces Diligent Engine, a modern cross-platform graphics API abstraction library and rendering framework
23 Jul 2023 by Graeme_Grant
If you want pure perf, have a look at using openGL on WPF: Using OpenGL in a WPF Application | CodeProject[^] UPDATE You could look at using LiveCharts[^]. It could handle 100,000 points easily. This is now a dead library, as it is in the...
23 Jul 2023 by Patrice T
There is no magic language or library that is magically faster than others. Quote: I need an advice. I would like to show data as an line diagramm. The most important feature is speed. The word 'Speed' alone means nothing. How fast do you need...
23 Jul 2023 by Member 14807608
Hello together, I need an advice. I would like to show data as an line diagramm. The most important feature is speed. What I have tried: I tried it with WinForms, no chance. With Delphi and a component from Steema (TeeChart), to slow. I...
12 Jul 2023 by EgorYusov
This article describes Unity low-level plugin interface and the Unity graphics interface emulator that facilitates native plugin development.
28 Aug 2022 by thebluetropics
Currently I learning how to build a native windows app using Win32 API along with Direct2D API. I was successfully built my component-based UI in my app. However, the big problem is I don't know how to check whether a button is clicked and not...
28 Apr 2022 by free5lot
Camera_Net is a FLOSS library for using video-cameras and video-inputs in .NET projects easily
23 Oct 2021 by djc2032
I have downloaded a 3D model of the planet Jupiter from the NASA website, in the form of a glb file. When I try to display it using the header only library cgltf, I get a huge white blob. When I look at the vertices in the debugger, I see a range...
3 Apr 2021 by shunninghuang
CPS1 emulator, ROM hacking
11 Jan 2021 by EgorYusov
An introduction to ray tracing API in Diligent Engine
10 Oct 2020 by LeisureBamboo
In this article, you will see the steps required to simultaneously play multiple midi file from memory using MCI functions.
23 Sep 2020 by EgorYusov
Introduction to amplification and mesh shaders, the new programmable stages available in modern GPUs, and how to use them to implement view frustum culling and object LOD selection on the GPU using the Diligent Engine API
28 Jan 2020 by Rick York
This is a real shot in the dark here but check the icons and see what their alpha channel looks like. If it is completely black they might be interpreted as being fully transparent.
28 Jan 2020 by Tatyana Entin
32-bit depth Icons become invisible while connecting second display and choosing "Control Panel\Display\Change Display Settings\Multiple displays: extend these displays" setting. I draw icons in my MFC\C++\ATL Windows application using ::DrawIconEx( hDC, x, y, hIcon,W,H,NULL,NULL, DI_NORMAL)...
11 Nov 2019 by Member 14075717
I have done the active window capturing in Bitblt but i want to implement the active window capturing specifically in Direct 11 in c++. Can any one help with code in Directx 11 not in 9.Thank you given below is for Bitblt implementation Screen Capture (Simple Win32 Dialog Based)[^] What I...
11 Nov 2019 by Richard MacCutchan
See Directx 11 - Google Search[^]
21 Jul 2019 by Shao Voon Wong
Bring your existing WPF and Winform application to the Microsoft Store
1 Jul 2019 by Member 14131869
I have a working graphics pipeline with perspective projection. i wanted to get the transformed vertices on the CPU, now the only way to achieve that was to multiply the vector with my transformation matrices using DirectX::XMVector4Transform. I expected the resulting vectors to be normalized...
23 Jun 2019 by Member 14131869
I have rendered 3d objects numerous times before in DirectX but this time encountered a strange problem, on which I wasted a day figuring out and still have nothing. I have a DX11 Context in which I load 3d models from obj files. I had to make a skybox and figured out that a good starting point...
23 Jun 2019 by Shao Voon Wong
I notice that you did not set your normals, they are all zeroes. You can try setting the topology as trianglelist before setting input layout. direct3DDeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); direct3DDeviceContext->IASetInputLayout(mInputLayout.Get()); ...
14 Jun 2019 by KarstenK
You should optimize your code. Like adding all meshes to a vector isnt a good idea. What about having an array of structs with a single mesh and shader. This would reduce looping times. And you should draw each mesh in a single step, but start the render engine once and draw ALL meshes. ...
14 Jun 2019 by Member 14131869
I am working on a graphics engine in c++ and DirectX 11. While importing scenes (using Assimp) I have to render multiple meshes with separate shaders. I do this by the following method I have an std::vector to store shaders and another one for meshes. After I open the file I add all the meshes...
9 May 2019 by Michael Chourdakis
Create music easily
23 Mar 2019 by Member 14131869
I am trying to render a cube in c++ using DirectX 11. I managed to render it, however I am not able to transform the model to the world position with perspective projection. I followed the MSDN tutorial for this Here's the code : { DirectX::XMMATRIX g_World; DirectX::XMMATRIX g_View;...
8 Mar 2019 by Member 14073125
//using Microsoft.DirectX //using Microsoft.DirectX.DirectInput DeviceList dList = Manager.GetDevices(DeviceClass.GameControl, EnumDevicesFlags.AttachedOnly); DeviceInstance dInstance; foreach (DeviceInstance deviceInstance in dList) { ...
18 Jan 2019 by ilostmyid2
hi i'm in the process of deciding how to decode received video frames, based on the following: 1. platform is Windows. 2. frames are encoded in H264 or H265. 3. GPU should be used as much 4. certainly we prefer less coding and simplest code. we just need to decode and show the result on screen....
18 Jan 2019 by RickZeeland
Maybe the easiest way is to use LibVLC (which use ffmpeg too), see example here: .net - How to streaming video via VLC api in C# - Stack Overflow[^]
10 Jan 2019 by Nizar Belhiba
And here we go, for those who need to do something similar It's not that difficult as I thought in the beginning, when you know what you have to do! And that was exactly my main issue. I had no idea what to do or how to approach the task. So to get started in DirectShow you need to build a graph...
10 Jan 2019 by Nizar Belhiba
I need to cut a sequence/period of an avi video file. Let's say the video is 5min long. I need to create a new video for example from time 1min to 2min. only images are mandatory, I don't care about the audio (my videos are without audio) by using iMediaSeek. GetDuration (out duration) and...
10 Jan 2019 by RickZeeland
See answers here: How to trim the video using Directshow!?[^] And here: C# Video TimeLine Control for DirectShow & VLC Like Adobe AfterEffects[^] It also might be needed to install an older DirectX version, like the DirectX 9 SDK. This should still be available for download as DXSDK_Jun10.exe.
22 Dec 2018 by EgorYusov
This article introduces the problem of resource state management and synchronization in modern graphics APIs such as Direct3D12 and Vulkan and describes a solution offered by Diligent Engine.
11 Dec 2018 by omeecode
Google Maps Offline in windows discusses how one can download or save Google maps and then view these images offline
14 Nov 2018 by solairx
Does anyone know if it is possible to render a WPF/Win32 inside a Unity or dx12 application ? We have a old WPF that we would like to Embedded as a part of a Mixed Reality Application. What I have tried: I've tried Noesis that seems great but that would mean a complete rewrite of our...
14 Nov 2018 by Gerry Schmitz
Any "old" Windows app (including WPF) can run in a "Mixed Reality" environment. Difference is, it can only run as a 2D "panel" (i.e. "window") in the MR space.
13 Sep 2018 by Member 13908153
I want to capture desktop image in win7 using Getfrontbufferdata, a interface function in DirectX9Ex. But I met the below two problems. 1. In Windowed Mode,I can capture desktop image correctly. Then I want to capture image in full-screen mode. So I changed the Windowed value into FALSE,But...
13 Sep 2018 by KarstenK
Read the article and code about Capturing an Image. The trick is to use the full screen as device context.
11 Sep 2018 by EgorYusov
This article describes several strategies to update GPU resources in Diligent Engine (a modern low-level graphic library) as well as important internal details and performance implications related to each method.
18 Aug 2018 by OriginalGriff
Don't post this under Quick Answers - if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them. Posting this here relies on them...
18 Aug 2018 by Member 13951607
Hi I've taken your code and 'remoulded' it so that it works with Windows 10 and the current version of the Windows SDK (Which includes the latest direct x versions). What I would like to do, is place the code in a github repository so that other users may find it's approach useful. Obviously...
27 Jul 2018 by xXxRevolutionxXx
I am trying to draw boxes, triangles and text using SharpDx. The documentation seems very vague for me, and through several examples I came up with a code that I cannot understand why it does not work. What I have tried: My code so far is: using System; using System.Collections.Generic;...
11 Jul 2018 by Member 13775524
I have a question related to DirectShow transform filter. I use USB2.0 camera to get the real-time video at 30fps (1920x1080) and I want to process the video image by inserting a transform filter. But after the insertion, the frame rate is decreased. For example, the processing time is about...
26 Jun 2018 by CMalcheski
A Full DirectX Sample Application Created in Pure Assembly Language
14 Jun 2018 by Rick York
Personally, I would go with old-style OpenGL. I think that is the simplest 3D libary/engine to get started with and easiest to get things done with quickly. There are a fair number of sample programs that use OpenGL here. Two of them are compilations of fifty different sample programs and they...
14 Jun 2018 by BerthaDusStuf
I am reading jumping into C++ currently but I have a computing project for school where I will need to program in 3D so I want to learn to program in 3D ASAP. I dont have any experience in 2D programming and would like to skip that if possible and then return to it after I have completed my...
13 Jun 2018 by Maciej Los
An answer to such of "question" (see my comment to the question) is opinion based only. If you need to learn 3D programming ASAP, i'd suggest to buy any book... which is already accessible to you. When i typed "C++ 3D programming book" in Google, it returned me, for example: What books should I...
13 Jun 2018 by Richard MacCutchan
directX - Google Search[^]
22 May 2018 by SHCruz
After use SetParent with Directx window, need to refresh the winform. Just: this.Refresh();
22 May 2018 by SHCruz
Goal: - Capture a winform window containing a directx game window (like screenshot, but specific handle). Scenario: - Inside a winform I insert a panel1 normally. - I used the winapi SETPARENT to insert a directx main game window inside the penel1 Problem: When capturing the winform window...
15 May 2018 by Christian Graus
I think you should look at WPF. It uses DirectX to display everything and makes it easy to superimpose video on things.
15 May 2018 by Member 13752082
We're working on a system to stream live sports events from the local high school stadium. We're feeding three IP streaming cameras into a laptop and switching between them with a DirectShow application we built in Visual Studio. We would like to superimpose a scoreboard and subtitles...
14 Apr 2018 by Member 13755707
Hey I need some advice here How can I make more bigger map from my worldmap.cs file using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Content; namespace...
13 Apr 2018 by Member 13755707
Hey I need to know how to add a function for my fps xna game so my pistol model can shoot and I need a function for adding monsters in the game to shoot with there own health... my main game.cs file using System; using System.Collections.Generic; using System.Linq; using...
12 Apr 2018 by KarstenK
It isnt a simple task that you want to do, but some high skilled software. You need to learn the basics about HDR Lighting and Displays. Maybe that HDRCubeMap sample shows you some useful techniques. You are at the start of a big journey ;-)
12 Apr 2018 by Member 13755707
Hey, I need to know how to add shaders to my game. So, for example, I have tried some DirectX wrappers where you just drag and drop the d3d9.dll, or d3d8.dll and the ini file to your game directory of choice and you can add support for stuff like anti alies hdr lighting bloom ect.. I need to...
12 Apr 2018 by Member 13755707
my code below I need to bind a shader to my program... My code below has no shader code only code for my menu hook only 'gui interface" #include "MenuClass.h" oReset pReset; oEndScene pEndScene; QmoMenu dMenu; LPDIRECT3DDEVICE9 g_pDevice = 0; int xFontOffSet = 15; int hackopt1; int...
29 Mar 2018 by _GX_
can i use visual studio .net framework to make node system like visual programming (""the visual part of it not the logic part of it"") or i need to implement opengl or directx or etc......... What I have tried: n--------------o------------t---------------h------------i-------------n------------g
29 Mar 2018 by KarstenK
You should stick to OpenGL and avoid directX. Interesting is that OpenGL works similar on other platforms and even other languages. Thats why mastering OpenGL is a precious skill, so take the time to understand its resources and buffering architecture. Here is a outstanding article about...
28 Mar 2018 by Patrice T
Quote: Can I use visual studio .NET framework to make node system like visual programming Your answer: No. The question show that you lack the necessary knowledge. Technically, one can do about anything with any language and framework combination. But from what I understand of your project, it...
11 Dec 2017 by FrankieTheSkin
Okay, I'm going insane here, there seems to be absolutely nothing wrong, yet D3D10CreateDeviceAndSwapChain() keeps failing because of 'invalid' parameters (0x887A0001), even though I've searched the web and everything I find seems to confirm that my code is just fine. Someone please tell me what...
23 Nov 2017 by Member 9927463
Greetings,I am currently working on a project in which we need to stream live video off of a USB device and I was wondering, how I could go about doing it. I was able to accomplish the task using dynamic web twain(Trial Version) but I was wondering if there's another way that would be less...
23 Nov 2017 by EgorYusov
This article describes how to implement dynamic resources with Direct3D12 API using ring buffers.
30 Oct 2017 by Member 13443508
I am going to explain how to get hand on a texture containing Blackmagic captured frame, so you can display it into your DirectX scene
4 Oct 2017 by CMalcheski
Thinking outside the box can result in critical performance gains
10 Jul 2017 by CMalcheski
App Initialization and Main Window Creation
22 Jun 2017 by RickZeeland
In Windows Firewall configure your app to allow it to use a port.
18 Jun 2017 by RickZeeland
I don't know about DotNetZip, but 7zip can do it, you can call it with Process.Start(). Examples from 7zip help: 7z a archive1.zip subdir\ adds all files and subfolders from folder subdir to archive archive1.zip. The filenames in archive will contain subdir\ prefix.7z a archive2.zip .\subdir\*...
18 Jun 2017 by Heather Czerniak
I'm writing a C# .NET WinForms app where I need to create a zip file (using DotNetZip) consisting of items of the following types: System.Drawing.Image someimage Microsoft.DirectX.AudioVideoPlayback.Audio someaudio Microsoft.DirectX.AudioVideoPlayback.Video somevideo Problem: In all the code...
18 Jun 2017 by Heather Czerniak
Rick, if you mean copy the files to the app's executable path, that means I'll still have a filepath rely on. Is it possible to write the value of a DirectX Audio or DirectX Video variable to a file? I read the value into a variable from a filepath, now I want to write the value of that variable...
17 Jun 2017 by Heather Czerniak
Rick, the problem is that the end user might open the zip archive in my app on a different computer where those image, audio and video files may not exist. If they open the zip, those files won't load because they won't exist on another computer. Once I add an image, audio or video to a file in...
16 Jun 2017 by Heather Czerniak
Dave, I know that the original filepath is not saved in the .zip, only what's at the end of it. Apparently, DotNetZip will only allow me to add a file from a filepath, so I need to find a way to write the value of a variable to a temp file so I can read it into a byte array from that temp file...
16 Jun 2017 by Dave Kreskowiak
Ummm...it seems you have no idea how .ZIP files work. Either that or you're doing a terrible job of describing the problem. The original path is not saved in the .ZIP. If you add folders to a .ZIP the RELATIVE path is saved. That means the files are unzipped to a path relative to where the...
14 Jun 2017 by CMalcheski
Part II - Laying the Foundation for the Migration to Assembly
8 Jun 2017 by CMalcheski
How to Create a Complete DirectX Game in Assembly Language
6 Jun 2017 by Buddhi Chaturanga
I am developing Win32 C++ Program which creates child process of a Game Program(i.e "Game.exe"),using CreateProcess(...) function in Windows API.(This Game was developed by an external party therefore,I don't have the source code of the program and also it uses direct3D for 3D-drawing...
6 Jun 2017 by David 'dex' Schwartz
I realise it's not great to just post a link but the content is long. Instrumenting Direct3D applications Here is a short excerpt of the initial steps to achieve your goal. The code we have provided starts the target process in suspended mode, and hooks the Direct3DCreate9 entry point in the...
30 May 2017 by trident99
I am in the middle of porting over my openGL 3d viewer to a DirectX 10 equivalent. I have come across the fact that there is no glReadPixels equivalent. After a lot of searching on the internet I still haven't found an answer. I use the glReadPixels to get z depth of a pixel under the mouse....
30 May 2017 by barneyman
in dx9 (sorry, but that should get you started) you'd render to a texture (using SetRenderTarget) then get to that texture's surface (GetSurfaceLevel), then lock that and read from it (LockRect)
18 Apr 2017 by Atakutabrak
I build project with video Imports Microsoft.DirectX.AudioVideoPlayback when developing I can play video why in the client video cannot played? I get this error in client: "Unhandled exception has occurred in your application. If you click Continue. the application will ignore this error and...
17 Apr 2017 by Atakutabrak
I build project with Microsoft Visual Studio 2010 and get this Error "Unhandled exception has occured in your application.." when play video in project, problem solve with disable LoaderLock in VS2010 toolbar Debug, Exceptions.. , Managed Debugging Assistants, Uncheck LoaderLock but after I...
17 Apr 2017 by Jochen Arndt
Your complete approach is wrong. Instead of disabling the exception you should find the cause and fix that. Ignoring the execption may lead to a deadlock: loaderLock MDA[^]: Effect on the Runtime Typically, several threads inside the process will deadlock. One of those threads is likely to be...
17 Apr 2017 by EgorYusov
Descriptors and descriptor heaps are key components of a new resource binding paradigm introduced in Direct3D12. This article describes an efficient system for managing descriptor heaps.