Sign in to follow this  
Sturmh

DX11 [Solved] DX11 Updating texture data

Recommended Posts

Sturmh    310
After looking through all the threads I could find relating to this topic and failing, it would seem it is now time to ask for some help.


I have a 32bit BGRA buffer that I am binding to a texture:
[Code]
D3D11_TEXTURE2D_DESC td;
td.ArraySize = 1;
td.BindFlags = D3D11_BIND_SHADER_RESOURCE;
td.Usage = D3D11_USAGE_DYNAMIC;
td.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
td.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
td.Height = m_renderBuffer.height;
td.Width = m_renderBuffer.width;
td.MipLevels = 1;
td.MiscFlags = 0;
td.SampleDesc.Count = 1;
td.SampleDesc.Quality = 0;

D3D11_SUBRESOURCE_DATA srd;
srd.pSysMem = m_renderBuffer.buffer;
srd.SysMemPitch = m_renderBuffer.rowspan;
srd.SysMemSlicePitch = 0;

HR(device->CreateTexture2D(&td, &srd, &m_texture));
[/Code]

which I then bind to a ShaderResourceView and set as a shader resource
[Code]
HR(device->CreateShaderResourceView(m_texture, 0, &m_textureRV));
.
.
deviceContext->PSSetShaderResources(0, 1, &m_textureRV);
[/Code]

I render this once and it works just as expected.
Then I try to update the texture..
[Code]
HR(deviceContext->Map(m_texture, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource)

mappedResource.pData = (void*)m_renderBuffer.buffer;
mappedResource.RowPitch = m_renderBuffer.rowspan;
mappedResource.DepthPitch = 0;

deviceContext->Unmap(m_texture, 0);
[/Code]

Right now Im just updating with the same buffer but that wont be the case in reality. After I try to update the texture, the texture is no longer shows up, and nothing shows up anymore. I am not getting any errors related to this from the Debug Device. I feel like I am doing everything correctly. Creating the texture with D3D11_USAGE_DYNAMIC, and D3D11_CPU_ACCESS_WRITE then using Map to update the texture. Everything I read says this is the proper method. Either I missed something, or I am doing it incorrectly.

Any ideas?

Share this post


Link to post
Share on other sites
RDragon1    1205
[font="Arial"][size="2"]You're not using this right. What Map() does is reserve a piece of GPU memory for you to copy your data in, and gives you a pointer that you can use to write into that memory. That's the [color="#1C2837"][color="#000000"]mappedResource[/color][color="#666600"].[/color][color="#000000"]pData pointer. You're not meant to set that pointer to your data, but instead copy your data into the memory it points to.[/color][/color][/size][/font]

Share this post


Link to post
Share on other sites
Sturmh    310
So I am trying to update my buffer and after copying my new texture data in, the texture is rendered with a shearing effect.

[Code]

D3D11_MAPPED_SUBRESOURCE mappedResource;
HR(deviceContext->Map(m_texture, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource));
memcpy(mappedResource.pData, buffer, rowspan*height);
deviceContext->Unmap(m_texture, 0);
[/Code]

I am pretty sure the buffer itself is not the issue because so my guess is it has something to do with my use of memcpy but i just do see it.
I feel like I am being a little vague, but cant think of anything else to say haha. I can try to elaborate if need be.

Share this post


Link to post
Share on other sites
MJP    19753
The texture resource will have it's own pitch (the number of bytes in a row), which is probably different than the pitch of your source data. This pitch is given to you as the "RowPitch" member of D3D11_MAPPED_SUBRESOURCE. So typically you do something like this:
[code]
BYTE* mappedData = reinterpret_cast<BYTE*>(mappedResource.pData);
for(UINT i = 0; i < height; ++i)
{
memcpy(mappedData, buffer, rowspan);
mappedData += mappedResource.RowPitch;
buffer += rowspan;
}
[/code]

Share this post


Link to post
Share on other sites
Sturmh    310
[quote name='MJP' timestamp='1310492347' post='4834406']
The texture resource will have it's own pitch (the number of bytes in a row), which is probably different than the pitch of your source data. This pitch is given to you as the "RowPitch" member of D3D11_MAPPED_SUBRESOURCE. So typically you do something like this:
[code]
BYTE* mappedData = reinterpret_cast<BYTE*>(mappedResource.pData);
for(UINT i = 0; i < height; ++i)
{
memcpy(mappedData, buffer, rowspan);
mappedData += mappedResource.RowPitch;
buffer += rowspan;
}
[/code]
[/quote]

Excellent, works perfectly. Except now I am curious why the pitch of the texture is different when I set the pitch in the D3D11_SUBRESOURCE_DATA description.

Share this post


Link to post
Share on other sites
Demirug    884
[size="3"][font="Calibri"][size="3"][font="Calibri"][/font][/size]

You don’t set the pitch with D3D11_SUBRESOURCE_DATA. You just tell the runtime what pitch your data uses. The runtime will use this information and the real pitch from your texture to copy the data correctly. As Map gives you a memory pointer were the driver wants the data to be copied it tells you the real pitch.[/font][/size]

Share this post


Link to post
Share on other sites
Sturmh    310
Everything is working and I am updating the texture several times a second. After about 30 seconds or so I get a E_OUTOFMEMORY error from:

[size="2"][Code]deviceContext->Map(m_texture, 0, D3D11_MAP_WRITE_DISCARD], 0, &mappedResource)[/Code][/size]

All I am doing in my program is updating the texture, then drawing the texture on a quad.

Could it be how I am updating my constant buffer and resource view for the shader that is causing this problem? I dont feel like that would be it assuming I was doing something incorrectly.
[font="CourierNew, monospace"] [/font]
[font="CourierNew, monospace"] [/font]

Share this post


Link to post
Share on other sites
Magmatwister    109
[quote name='MJP' timestamp='1310492347' post='4834406']
The texture resource will have it's own pitch (the number of bytes in a row), which is probably different than the pitch of your source data. This pitch is given to you as the "RowPitch" member of D3D11_MAPPED_SUBRESOURCE. So typically you do something like this:
[code]
BYTE* mappedData = reinterpret_cast<BYTE*>(mappedResource.pData);
for(UINT i = 0; i < height; ++i)
{
memcpy(mappedData, buffer, rowspan);
mappedData += mappedResource.RowPitch;
buffer += rowspan;
}
[/code]
[/quote]

MJP, I've seen you post this at least twice now besides for me, I'm thinking that maybe msdn should post the information about this under the map method in remarks?

Share this post


Link to post
Share on other sites
MJP    19753
[quote name='Sturmh' timestamp='1310580540' post='4834932']
Everything is working and I am updating the texture several times a second. After about 30 seconds or so I get a E_OUTOFMEMORY error from:

[size="2"][Code]deviceContext->Map(m_texture, 0, D3D11_MAP_WRITE_DISCARD], 0, &mappedResource)[/Code][/size]

All I am doing in my program is updating the texture, then drawing the texture on a quad.

Could it be how I am updating my constant buffer and resource view for the shader that is causing this problem? I dont feel like that would be it assuming I was doing something incorrectly.
[font="CourierNew, monospace"] [/font]
[font="CourierNew, monospace"] [/font]
[/quote]

I've never heard of an out of memory error happening from mapping a resource. You're not creating any resources during the frame, are you? Also, did you remember to call Unmap after copying in the data?

Share this post


Link to post
Share on other sites
MJP    19753
[quote name='SnailCoder' timestamp='1310655297' post='4835277']
[quote name='MJP' timestamp='1310492347' post='4834406']
The texture resource will have it's own pitch (the number of bytes in a row), which is probably different than the pitch of your source data. This pitch is given to you as the "RowPitch" member of D3D11_MAPPED_SUBRESOURCE. So typically you do something like this:
[code]
BYTE* mappedData = reinterpret_cast<BYTE*>(mappedResource.pData);
for(UINT i = 0; i < height; ++i)
{
memcpy(mappedData, buffer, rowspan);
mappedData += mappedResource.RowPitch;
buffer += rowspan;
}
[/code]
[/quote]

MJP, I've seen you post this at least twice now besides for me, I'm thinking that maybe msdn should post the information about this under the map method in remarks?
[/quote]

Yeah, that would be nice. I can also add it under the "community content" section at the bottom of the page, which might be helpful for some people.

Share this post


Link to post
Share on other sites
Sturmh    310
[quote name='MJP' timestamp='1310668864' post='4835371']
[quote name='Sturmh' timestamp='1310580540' post='4834932']
Everything is working and I am updating the texture several times a second. After about 30 seconds or so I get a E_OUTOFMEMORY error from:

[size="2"][Code]deviceContext->Map(m_texture, 0, D3D11_MAP_WRITE_DISCARD], 0, &mappedResource)[/Code][/size]

All I am doing in my program is updating the texture, then drawing the texture on a quad.

Could it be how I am updating my constant buffer and resource view for the shader that is causing this problem? I dont feel like that would be it assuming I was doing something incorrectly.
[font="CourierNew, monospace"] [/font]
[font="CourierNew, monospace"] [/font]
[/quote]

I've never heard of an out of memory error happening from mapping a resource. You're not creating any resources during the frame, are you? Also, did you remember to call Unmap after copying in the data?
[/quote]

No I am not.
Each frame i call two functions, update() and render().
update -> update a buffer, check if it changed from last frame, and if it did, update the texture with:

[Code]
HR(deviceContext->Map(m_texture, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource));

BYTE* mappedData = reinterpret_cast<BYTE*>(mappedResource.pData);
for(UINT i = 0; i < m_renderBuffer.height; ++i)
{
memcpy(mappedData, m_renderBuffer.buffer, m_renderBuffer.rowspan);
mappedData += mappedResource.RowPitch;
m_renderBuffer.buffer += m_renderBuffer.rowspan;
}
deviceContext->Unmap(m_texture, 0);
[/Code]

Additionally, every time i call map here, the D3D debug output says "Error:......Resource is already mapped" or something of the sort. I know for a fact that the above map call is the cause of the "error"

I ran it once with the texture size at about 300 x 150, as opposed to about 800 x 400, and I never encountered the E_OUTOFMEMORY problem,

Share this post


Link to post
Share on other sites
MJP    19753
[quote name='Sturmh' timestamp='1310669951' post='4835383']
Additionally, every time i call map here, the D3D debug output says "Error:......Resource is already mapped" or something of the sort.
[/quote]

Well that definitely sounds like your problem. The driver is probably continuing to allocate hidden textures behind the scenes (since that's what they do to avoid stalling when updating dynamic resources), and not freeing them because you're not unmapping them.

Share this post


Link to post
Share on other sites
Sturmh    310
Hidden
[quote name='MJP' timestamp='1310677463' post='4835435']
[quote name='Sturmh' timestamp='1310669951' post='4835383']
Additionally, every time i call map here, the D3D debug output says "Error:......Resource is already mapped" or something of the sort.
[/quote]

Well that definitely sounds like your problem. The driver is probably continuing to allocate hidden textures behind the scenes (since that's what they do to avoid stalling when updating dynamic resources), and not freeing them because you're not unmapping them.
[/quote]

I'm sorry but I am still confused haha. Like I said before every frame, I am only updating the texture and rendering it.
[Code]

HR(deviceContext->Map(m_texture, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource));

BYTE* mappedData = reinterpret_cast<BYTE*>(mappedResource.pData);
unsigned char* keep = m_buffer.buffer;
for(UINT i = 0; i < m_buffer.height; ++i)
{
memcpy(mappedData, m_buffer.buffer, m_buffer.rowspan);
mappedData += mappedResource.RowPitch;
m_buffer.buffer += m_buffer.rowspan;
}
m_buffer.buffer = keep;
deviceContext->Unmap(m_texture, 0);
[/Code]
allocating resources and furthermore how do I figure out how to free it. Is it the second parameter of Unmap? Either way I'm stumped haha.

Share this post


Link to post
Sturmh    310
[quote name='MJP' timestamp='1310677463' post='4835435']
[quote name='Sturmh' timestamp='1310669951' post='4835383']
Additionally, every time i call map here, the D3D debug output says "Error:......Resource is already mapped" or something of the sort.
[/quote]

Well that definitely sounds like your problem. The driver is probably continuing to allocate hidden textures behind the scenes (since that's what they do to avoid stalling when updating dynamic resources), and not freeing them because you're not unmapping them.
[/quote]

Sorry but I am still a little confused. How do I free these hidden textures haha. I'm not really sure where I should be looking to try and fix this. Could I be using incorrect parameters for the Map and Unmap calls. Also, could it be my code to render, even though I have pinpointed the "Resource already mapped" error. I'm just stumped haha.

Share this post


Link to post
Share on other sites
Sturmh    310
To expand on what I said previously, could I be using the Subresource parameter of the map call incorrectly? I dont really understand what that corresponds to. I dont know if this is correct but I am using the same subresource parameter when mapping the buffer to the texture as when I map my constant buffer for the vertex shader. This is the only other map call in the program. I dont know if posting this code will be any help, but it wont hurt:


[Code]

//Lock constant buffer to write to it
HR(deviceContext->Map(m_matrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResources));

//Get point to data in constant buffer
matrixBuffer = (MatrixBuffer*)mappedResources.pData;

matrixBuffer->world = world;
matrixBuffer->view = view;
matrixBuffer->proj = proj;

//Unlock constant buffer after done writing to it
deviceContext->Unmap(m_matrixBuffer, 0);

//Set contant buffer in the vertex shader with new values
deviceContext->VSSetConstantBuffers(0, 1, &m_matrixBuffer);

//Set shader texture resource in the pixel shader
deviceContext->PSSetShaderResources(0, 1, &m_textureRV);
[/Code]


Edit:
Hmm, I just noticed when I comment out the map call to update the texture I still get:
D3D11: ERROR: ID3D11DeviceContext::Map: This resource is already mapped! [ RESOURCE_MANIPULATION ERROR #2097213: RESOURCE_MAP_ALREADYMAPPED ]

This also happens when I comment out the map call for updating the constant buffer and running the map call updating the texture;

I would seem all my attempts to use the map function are not working out to well. Some additional understanding of how to properly use of the map function, if I am indeed using it incorrectly, would be greatly appreciated.

Share this post


Link to post
Share on other sites
Sturmh    310
I changed up the program to see if some other part of my code was indirectly causing the mapping issue. Now, all I am doing is initializing D3D then calling this
[Code]
//Fill out texture desc
D3D11_TEXTURE2D_DESC td;
td.ArraySize = 1;
td.BindFlags = D3D11_BIND_SHADER_RESOURCE;
td.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
td.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
td.Height = 500;
td.MipLevels = 1;
td.MiscFlags = 0;
td.SampleDesc.Count = 1;
td.SampleDesc.Quality = 0;
td.Usage = D3D11_USAGE_DYNAMIC;
td.Width = 500;

HR(device->CreateTexture2D(&td, 0, &m_texture));

D3D11_MAPPED_SUBRESOURCE mappedResource;
HR(dc->Map(m_texture, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource));

BYTE* mappedData = reinterpret_cast<BYTE*>(mappedResource.pData);
for(UINT i = 0; i < m_buffer.height; ++i)
{
memcpy(mappedData, m_buffer.buffer, m_buffer.rowspan);
mappedData += mappedResource.RowPitch;
m_buffer.buffer += m_buffer.rowspan;
}

dc->Unmap(m_texture, 0);
[/Code]
And I am getting the "already mapped error." Now I am really confused. How can it be already mapped if this the first and only map call I am making. To quote msdn for initializing a dynamic texture
[Quote]

[b]Dynamic Usage[/b]
To fill a dynamic texture (one created with D3D11_USAGE_DYNAMIC):

[list=1][*]Get a pointer to the texture memory by passing in D3D11_MAP_WRITE_DISCARD when calling [url="http://msdn.microsoft.com/en-us/library/ff476457%28v=vs.85%29.aspx"][b]ID3D11DeviceContext::Map[/b][/url].[*]Write data to the memory.[*]Call [url="http://msdn.microsoft.com/en-us/library/ff476485%28v=vs.85%29.aspx"][b]ID3D11DeviceContext::Unmap[/b][/url] when you are finished writing data[/list]
[/Quote]

Thats exactly what you guys are telling me and what I am doing haha.
Could it be possible that I am initializing my devices incorrectly?

Edit:
Tried it on a different computer and also got out of memory error, so pretty obvious now that im doing something wrong haha.

Share this post


Link to post
Share on other sites
Sturmh    310
Well I figured out what the problem was. It was my HR macro that I was using around the map call.


[Code]

#define HR(x) \
{ \
HRESULT hr = (x); \
if(FAILED(x)) \
{ \
DXTrace(__FILE__, (DWORD)__LINE__, hr, L#x, true); \
} \
}
[/Code]

No Idea why this was causing the issue with map, but everything seems to work once i removed it.

Share this post


Link to post
Share on other sites
Matias Goldberg    9573
[quote name='Sturmh' timestamp='1311009253' post='4836886']
Well I figured out what the problem was. It was my HR macro that I was using around the map call.


[Code]

#define HR(x) \
{ \
HRESULT hr = (x); \
if(FAILED(x)) \
{ \
DXTrace(__FILE__, (DWORD)__LINE__, hr, L#x, true); \
} \
}
[/Code]

No Idea why this was causing the issue with map, but everything seems to work once i removed it.
[/quote]
Because [url="http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.5"]macros are evil[/url]. Your macro was calling map() at least twice in that 'function' (i.e. it's not doing what you intuitively think it should be doing).

Cheers
Dark Sylinc

Share this post


Link to post
Share on other sites
MJP    19753
Yeah your macro would expand to this if you looked at the preprocessed version:
[code]
HRESULT hr = deviceContext->Map(m_matrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResources);
if(FAILED(deviceContext->Map(m_matrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResources)))
{
DXTrace(__FILE__, (DWORD)__LINE__, hr, L#x, true);
}
[/code]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By gsc
      Hi! I am trying to implement simple SSAO postprocess. The main source of my knowledge on this topic is that awesome tutorial.
      But unfortunately something doesn't work... And after a few long hours I need some help. Here is my hlsl shader:
      float3 randVec = _noise * 2.0f - 1.0f; // noise: vec: {[0;1], [0;1], 0} float3 tangent = normalize(randVec - normalVS * dot(randVec, normalVS)); float3 bitangent = cross(tangent, normalVS); float3x3 TBN = float3x3(tangent, bitangent, normalVS); float occlusion = 0.0; for (int i = 0; i < kernelSize; ++i) { float3 samplePos = samples[i].xyz; // samples: {[-1;1], [-1;1], [0;1]} samplePos = mul(samplePos, TBN); samplePos = positionVS.xyz + samplePos * ssaoRadius; float4 offset = float4(samplePos, 1.0f); offset = mul(offset, projectionMatrix); offset.xy /= offset.w; offset.y = -offset.y; offset.xy = offset.xy * 0.5f + 0.5f; float sampleDepth = tex_4.Sample(textureSampler, offset.xy).a; sampleDepth = vsPosFromDepth(sampleDepth, input.uv).z; const float threshold = 0.025f; float rangeCheck = abs(positionVS.z - sampleDepth) < ssaoRadius ? 1.0 : 0.0; occlusion += (sampleDepth <= samplePos.z + threshold ? 1.0 : 0.0) * rangeCheck; } occlusion = saturate(1 - (occlusion / kernelSize)); And current result: http://imgur.com/UX2X1fc
      I will really appreciate for any advice!
    • By isu diss
       I'm trying to code Rayleigh part of Nishita's model (Display Method of the Sky Color Taking into Account Multiple Scattering). I get black screen no colors. Can anyone find the issue for me?
       
      #define InnerRadius 6320000 #define OutterRadius 6420000 #define PI 3.141592653 #define Isteps 20 #define Ksteps 10 static float3 RayleighCoeffs = float3(6.55e-6, 1.73e-5, 2.30e-5); RWTexture2D<float4> SkyColors : register (u0); cbuffer CSCONSTANTBUF : register( b0 ) { float fHeight; float3 vSunDir; } float Density(float Height) { return exp(-Height/8340); } float RaySphereIntersection(float3 RayOrigin, float3 RayDirection, float3 SphereOrigin, float Radius) { float t1, t0; float3 L = SphereOrigin - RayOrigin; float tCA = dot(L, RayDirection); if (tCA < 0) return -1; float lenL = length(L); float D2 = (lenL*lenL) - (tCA*tCA); float Radius2 = (Radius*Radius); if (D2<=Radius2) { float tHC = sqrt(Radius2 - D2); t0 = tCA-tHC; t1 = tCA+tHC; } else return -1; return t1; } float RayleighPhaseFunction(float cosTheta) { return ((3/(16*PI))*(1+cosTheta*cosTheta)); } float OpticalDepth(float3 StartPosition, float3 EndPosition) { float3 Direction = normalize(EndPosition - StartPosition); float RayLength = RaySphereIntersection(StartPosition, Direction, float3(0, 0, 0), OutterRadius); float SampleLength = RayLength / Isteps; float3 tmpPos = StartPosition + 0.5 * SampleLength * Direction; float tmp; for (int i=0; i<Isteps; i++) { tmp += Density(length(tmpPos)-InnerRadius); tmpPos += SampleLength * Direction; } return tmp*SampleLength; } static float fExposure = -2; float3 HDR( float3 LDR) { return 1.0f - exp( fExposure * LDR ); } [numthreads(32, 32, 1)] //disptach 8, 8, 1 it's 256 by 256 image void ComputeSky(uint3 DTID : SV_DispatchThreadID) { float X = ((2 * DTID.x) / 255) - 1; float Y = 1 - ((2 * DTID.y) / 255); float r = sqrt(((X*X)+(Y*Y))); float Theta = r * (PI); float Phi = atan2(Y, X); static float3 Eye = float3(0, 10, 0); float ViewOD = 0, SunOD = 0, tmpDensity = 0; float3 Attenuation = 0, tmp = 0, Irgb = 0; //if (r<=1) { float3 ViewDir = normalize(float3(sin(Theta)*cos(Phi), cos(Theta),sin(Theta)*sin(Phi) )); float ViewRayLength = RaySphereIntersection(Eye, ViewDir, float3(0, 0, 0), OutterRadius); float SampleLength = ViewRayLength / Ksteps; //vSunDir = normalize(vSunDir); float cosTheta = dot(normalize(vSunDir), ViewDir); float3 tmpPos = Eye + 0.5 * SampleLength * ViewDir; for(int k=0; k<Ksteps; k++) { float SunRayLength = RaySphereIntersection(tmpPos, vSunDir, float3(0, 0, 0), OutterRadius); float3 TopAtmosphere = tmpPos + SunRayLength*vSunDir; ViewOD = OpticalDepth(Eye, tmpPos); SunOD = OpticalDepth(tmpPos, TopAtmosphere); tmpDensity = Density(length(tmpPos)-InnerRadius); Attenuation = exp(-RayleighCoeffs*(ViewOD+SunOD)); tmp += tmpDensity*Attenuation; tmpPos += SampleLength * ViewDir; } Irgb = RayleighCoeffs*RayleighPhaseFunction(cosTheta)*tmp*SampleLength; SkyColors[DTID.xy] = float4(Irgb, 1); } }  
    • By amadeus12
      I made my obj parser
      and It also calculate tagent space for normalmap.
      it seems calculation is wrong..
      any good suggestion for this?
      I can't upload my pics so I link my question.
      https://gamedev.stackexchange.com/questions/147199/how-to-debug-calculating-tangent-space
      and I uploaded my code here


      ObjLoader.cpp
      ObjLoader.h
    • By Alessandro Pozzer
      Hi guys, 

      I dont know if this is the right section, but I did not know where to post this. 
      I am implementing a day night cycle on my game engine and I was wondering if there was a nice way to interpolate properly between warm colors, such as orange (sunset) and dark blue (night) color. I am using HSL format.
      Thank  you.
    • By thefoxbard
      I am aiming to learn Windows Forms with the purpose of creating some game-related tools, but since I know absolutely nothing about Windows Forms yet, I wonder:
      Is it possible to render a Direct3D 11 viewport inside a Windows Form Application? I see a lot of game editors that have a region of the window reserved for displaying and manipulating a 3D or 2D scene. That's what I am aiming for.
      Otherwise, would you suggest another library to create a GUI for game-related tools?
       
      EDIT:
      I've found a tutorial here in gamedev that shows a solution:
      Though it's for D3D9, I'm not sure if it would work for D3D11?
       
  • Popular Now