Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


kolarz3

Member Since 10 Jun 2013
Offline Last Active Jun 26 2014 07:33 AM

Posts I've Made

In Topic: 3D Engine to analysis

30 April 2014 - 02:40 AM

I need this engine to learning, I have't any special project. Very important for me is source code editor to learn more about architecture and relationship between engine and editor. I'm searching engine like Unity3D but not soooo large. Maybe like this: http://www.maratis3d.org/?p=343. It would be best if engine will be only for windows and written on DirectX 11 or 10.Do you have any suggestions?


In Topic: Problem with creating "blanc" ID3D11Texture2D

16 February 2014 - 04:49 PM

bool ModelData::createDefaultMaterial()
{
	struct Pix
	{
		float r,g,b,a;
	};
	Pix* img;
	img=new Pix[256*256];

	for(int y=0;y<256;y++)for(int x=0;x<256;x++){img[y*256+x].r=1.0;img[y*256+x].g=0.0;img[y*256+x].b=0.0;img[y*256+x].a=1.0;}
	D3D11_TEXTURE2D_DESC desc; 
	ZeroMemory( &desc, sizeof(desc)); 
	desc.Width = 256; 
	desc.Height = 256; 
	desc.MipLevels = desc.ArraySize = 1; 
	desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; 
	desc.SampleDesc.Count = 1; 
	desc.Usage = D3D11_USAGE_DYNAMIC; 
	desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; 
	desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; 

	ID3D11Texture2D *pTexture = NULL; 
	engine.d3d11Device->CreateTexture2D( &desc, NULL, &pTexture ); 

	D3D11_MAPPED_SUBRESOURCE mapResource;
	engine.d3d11DevCon->Map(pTexture,0,D3D11_MAP_WRITE_DISCARD,0,&mapResource);
	BYTE* mappedData = reinterpret_cast<BYTE*>(mapResource.pData);
	memcpy(mappedData, img, 256*256*4*sizeof(float));
	engine.d3d11DevCon->Unmap(pTexture, 0);
	D3DX11SaveTextureToFile(engine.d3d11DevCon,pTexture,D3DX11_IFF_PNG,L"nazwaa.png");
	return TRUE;
}

Problem is solved. I must change Format to DXGI_FORMAT_R32G32B32A32_FLOAT


In Topic: Texture atlas generation for popular format

23 August 2013 - 03:58 AM

I didnt see any texture adds in DirectX SDK. I have 2010 version. But I'd like program that also load mesh and change UV cords. 


In Topic: DirectX 11 maping ID3D11Texture2D

19 July 2013 - 01:14 AM

Anyway "Color* obj = (Color*)mapResource.pData;" do the same that "memcpy(obj, mapResource.pData,mapResource.RowPitch*Height);"


In Topic: DirectX 11 maping ID3D11Texture2D

18 July 2013 - 04:22 PM

But in this case we must to cast data from D3D11_MAPPED_SUBRESOURCE to BYTE.


PARTNERS