Skip to content

Textures in DirectX 11 #1845

Answered by curin
jjb-pro asked this question in Q&A
Dec 17, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Since we don't have bindings to the directx XTK that function you are mentioning isn't available, but you could also import that function yourself if you really wanted to. Otherwise, this is some older code I wrote for DX12 (uses sharpdx from when that was still active), but the code is pretty much identical to how you would do this in silk. https://github.com/curin/CPU-GPU-Renderer/blob/master/GPUShaders/ShaderProfiles/SimpleTexture.cs#L195. It loads a bitmap as C# normally would and then converts it to a byte buffer with proper ordering (depends on what your resource is setup as rgba, rgb, argb, etc.) Then it writes it to a resource. This is essentially what the XTK function does for yo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jjb-pro
Comment options

Answer selected by jjb-pro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants