R
R
Recardo_Recoly2017-06-13 15:11:14
Programming
Recardo_Recoly, 2017-06-13 15:11:14

How to render an unsigned char* buffer in D3D9 C++?

I have an application that uses d3d9 rendering and has an array of rgba pixels (every 4 cells = pixel).
So... How to turn it into a d3d texture?
PS: I use Awesomium. And I want to somehow render it in the game window, let's say so.
And I need to render through d3d.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tomatho, 2017-06-13
@Recardo_Recoly

I know two options.
The first is dynamic texture. Keywords:
Now for some details:
Usage: D3DUSAGE_DYNAMIC. If not, then normal. How to check it is possible or not - the second link.
Format: D3DFMT_X8R8G8B8 or D3DFMT_A8R8G8B8 or converting on the fly to D3DFMT_R8G8B8.
Mipmaps: no. Explanation in the second link.
To figure it out - take any sample with a textured square / triangle and just change the texture to your own and test it. Then you already change the format, and usage (use).
The second option is blt directly on the surface. Theoretically possible. Practically - did not check.
Cons - you can't twist, twirl, and since it's not a texture, you can't apply it to a mesh, respectively. (for example, it cannot be displayed as in the screen of some virtual monitor)
Perhaps there are no pluses, but you can also look in this direction.
Key:
PS: Oh yes, I forgot to say. Don't even ask me about DX10+

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question