1
\$\begingroup\$

is it possible to render one pixel using DirectX 11? if its possible how to do it ?

\$\endgroup\$
  • \$\begingroup\$ You can draw a single point and then swap, but why would you do that? \$\endgroup\$ – Chuck Walbourn Oct 22 '16 at 0:14
  • \$\begingroup\$ I want to write a software render using DirectX11 just for learning purposes. but what do you mean by drawing a single point and then swap ? \$\endgroup\$ – Ahmed Saleh Oct 22 '16 at 0:19
  • \$\begingroup\$ Just render a point. \$\endgroup\$ – Krythic Oct 22 '16 at 0:56
  • \$\begingroup\$ You sadly can't learn anything from creating a softwer renderer that's not obsolete or useless \$\endgroup\$ – Bálint Oct 22 '16 at 10:55
0
\$\begingroup\$

Your best option is to use a DYNAMIC 2D texture, and each 'frame' copy from a 2D array in system memory that your software renderer produces to the DYNAMIC 2D texture using Map/Unmap. You can then render a full-screen quad using your DYNAMIC 2D texture to get it into the render target backbuffer in the DXGI swapchain, and then Present to swap the buffers.

See How to: Use dynamic resources

You can use SpriteBatch in the DirectX Tool Kit to do the 'full-screen quad render' trick of your DYNAMIC texture.

\$\endgroup\$
  • \$\begingroup\$ In addition to textures, could also use the vertex buffer or a cbuffer (or any of the other buffers really) \$\endgroup\$ – CobaltHex Oct 22 '16 at 3:11
  • \$\begingroup\$ If the OP wants to render the result of a 'software rendererer', this is probably the fastest way rather than drawing width * height points. \$\endgroup\$ – Chuck Walbourn Oct 22 '16 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.