Click here to Skip to main content
15,886,067 members
Everything / Direct2D

Direct2D

Direct2D

Great Reads

by Michael Chourdakis
C++, Direct2D, one function and you got a nice picker
by Ben Aldhouse
How I stopped worrying and learned to love Direct2D.
by Shao Voon Wong
Introduction to DirectWrite Text Display and Font Enumeration
by Orphraie
Study of 3D graphics in video games with minimal prior knowledge of mathematics

Latest Articles

by Orphraie
Study of 3D graphics in video games with minimal prior knowledge of mathematics
by Shao Voon Wong
Introduction to DirectWrite Text Display and Font Enumeration
by Hans
Just for fun, a Conway's Game of Life application with many features using MFC Direct2D classes
by Michael Chourdakis
C++, Direct2D, one function and you got a nice picker

All Articles

Sort by Score

Direct2D 

2 Jun 2020 by Michael Chourdakis
C++, Direct2D, one function and you got a nice picker
27 Jun 2016 by Ben Aldhouse
How I stopped worrying and learned to love Direct2D.
10 Mar 2023 by Shao Voon Wong
Introduction to DirectWrite Text Display and Font Enumeration
4 Oct 2010 by Martin Hinchy
I'm converting a custom MFC control from GDI+ to Direct2D. The control sits on a dialog which has a bitmap background. I need to capture the portion of the dialog background which sits under the control so that I can render the background in the control's OnPaint() function. Is there a way to...
6 Oct 2010 by Martin Hinchy
Ok, finally got this working. For anyone else who is interested, here are the steps required to capture the image from a device context and render it into a Direct2D render target. In my case I wanted to capture the image from an MFC CDialogEx dialog window that had a bitmap background.The...
5 Dec 2010 by Kozlov_Sergey
Is there any way to increase performance of IDirect3DSurface9::LockRect?I use this method to put data directly to render target surface.I write the data to last line of surface. Locking list line and all area of surface gives same results.I have used profilers.Intel VTune Amplifier XE...
9 Dec 2010 by Kozlov_Sergey
Why IDirect3DSurface9::LockRect works very slow?What parameters should i use to make IDirect3DSurface9::LockRect work fast?I use Render Target surfaces because of StretchRect.
13 Dec 2010 by Kozlov_Sergey
I have used DYNAMIC texrures (D3DUSAGE_DYNAMIC) for 1 call. So i have got 34 % speed increase.local_handle_result = direct_3D_device->CreateTexture( cxImage, cyImage, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, ...
14 Dec 2010 by Kozlov_Sergey
I have used dynamic textures. LockRect does not wait with dynamic textures. HRESULT local_handle_result = S_OK; CComPtr local_source_texture; local_handle_result =...
28 Apr 2011 by chris4562
yes, but with a different approach. A pixel shader from what I have read takes 1 pixel in and provides either none or some pixels out, whereas your function modifies a whole surface at once. The actual pixel shader function would effectively do one iteration of the outer loop; and global...
8 May 2011 by ronhash
Hello,We had an application that used DirectDraw for drawing many pixels directly to the video memory at a high rate.As there is no more MS support for DirectDraw, we want to refresh this code.Does anyone any suggestion what is the best replacement? Direct2D? Dierct3D? DIB?We are in...
8 May 2011 by Sergey Alexandrovich Kryukov
How can Direct2D and Direct3D can be alternative to each other? (Yes, I would recommend usign Direct2D and/or Direct3D.) It depends on character of graphics you want to create. Of course you can always model 3D objects and render them as 2D projections; depending on the problem, it may or may...
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...
16 Jul 2023 by KarstenK
You wil have to dig it out yourself. Start by making more TRACE output with a detailed timestamp. I would use some constant for the timer id. In this code your arent correctly use the timer id. Check it! tip: start with a low frame rate like 10...
17 Jul 2023 by Rick York
One thing to keep in mind is the Windows timer works on multiples of 60Hz or 16.7ms. That is as low as it will go about 60Hz is achievable as is 30Hz. At the risk of blowing my own horn, I like this class for determining elapsed time : High...
17 Jul 2023 by TheNewbieProgrammer
I will explain the problem very briefly: In order to get a color animation, the lerp algorithm must be used to change the colors smoothly, which requires the progress of the animation (std::min)((deltaTime / duration), 1.0f) But there is a...
1 Feb 2024 by Orphraie
Study of 3D graphics in video games with minimal prior knowledge of mathematics
21 Jul 2020 by Hans
Just for fun, a Conway's Game of Life application with many features using MFC Direct2D classes
24 Sep 2010 by Sarath C
In this installment, let’s cover basic primitives. The basic primitives are the mostly used shapes like lines, rectangle, rounded rectangle, circle etc.
27 Apr 2011 by Kozlov_Sergey
Can you make from this function HLSL (High Level Shader Language) shader?Buffers can be presented as texture.I have 1 source texture (buffer) and 1 destination texture (buffer).void stretch_memory_R8G8B8A8(int source_height,int source_width,void *source_memory,int...
28 Sep 2016 by chiona
So I've been working on an unmanaged C++ 2D MFC system in Visual Studio 2013 using GDI+ (Document View architecture). I need simple shapes shaded from each vertex of the shape - either a triangle with a color in each corner, blending those colors to the interior, or a rectangle doing the...
27 Sep 2017 by Patrice T
Why don't you say that your line is a rectangle and simply fill it with your transparent colour ? [Update] Quote: Most lines are DIAGONAL, so cannot be represented by a rectangle. (I didn't bother voting, but if I did, I would also downvote.) I agree that the answer was short. But you are...
14 Dec 2019 by Michael Chourdakis
A ready to use equalizer for your projects
9 Jul 2012 by sherin_
Hi,Iam new to Direct2D. I want to apply a blur effect on a rectangle. Direct2D effects are available only in windows2008 preview. Please Help me to find a solution.Regards,Sherin
17 Jul 2015 by Austin_Cpp
I am starting with Direct2D and VC++2013. I am trying to draw a wide line with 50% transparency. On the Microsoft web site I can only find examples of transparency which use the Brush to fill in a transparent color. Can someone show how to draw lines that are transparent in Direct2D....
19 Sep 2023 by TheNewbieProgrammer
I know this may sound silly, but to fix this you need to replace the color value with the starting color. And the other thing you need to do is to use elapsedTime instead of deltaTime to calculate the progress. Here's the code: float progress =...