1
\$\begingroup\$

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

\$\endgroup\$
4
  • \$\begingroup\$ You can draw a single point and then swap, but why would you do that? \$\endgroup\$ Oct 22, 2016 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\$ Oct 22, 2016 at 0:19
  • \$\begingroup\$ Just render a point. \$\endgroup\$
    – Krythic
    Oct 22, 2016 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, 2016 at 10:55

1 Answer 1

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\$
2
  • \$\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, 2016 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\$ Oct 22, 2016 at 7:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .