Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!

Zaoshi Kaba

Member Since 04 Nov 2012
Offline Last Active Today, 01:53 AM

#5169723 Drawing fullscreen triangle without vertex buffers

Posted by Zaoshi Kaba on 28 July 2014 - 06:24 AM

  1. Is black your clear color?
  2. You return alpha of 0.0f, depending on blending settings which we cannot see your pixels might do nothing;
  3. Set correct primitive topology (TRIANGLESTRIP);
  4. You need to draw 4 vertices to make a quad, at the moment you have only 3;
  5. It doesn't seem you need depth buffer at all; don't bind it.

#5168017 looping through struct array

Posted by Zaoshi Kaba on 20 July 2014 - 03:42 PM

Well that's more or less correct thinking.

Use vector<string> which doesn't have size limit and you can retrieve number of items without making own extra variable.

#5167995 Why Java games do not need installation

Posted by Zaoshi Kaba on 20 July 2014 - 02:24 PM

Java applications do not run without Java runtime installed, it just happens that most users have it installed. On top of that all resources get packaged into .jar file, so you don't need any external files.


Same can be achieved with .exe files, but you wouldn't like 20 GB .exe file, would you?

#5167372 What's the next step after LZ77?

Posted by Zaoshi Kaba on 17 July 2014 - 05:46 AM

LZMA is an improved LZ77 algorithm, you could try using it. I think on average it compresses better than WinRAR.

It's in public domain so you don't need any licenses (I'm not an expert) and could use SDK:


#5165786 Device or Context lost. Should I bother?

Posted by Zaoshi Kaba on 09 July 2014 - 05:53 AM

Device and Context cannot be lost, but Swap Chain can be (though you have to reinstall driver or physically remove GPU). Read more here: http://msdn.microsoft.com/en-us/library/windows/apps/dn458383.aspx

#5163818 very strange bug (when runing c basic arrays code)

Posted by Zaoshi Kaba on 30 June 2014 - 06:51 AM

100*1000 is 100,000 elements, 6 such arrays make 600,000 elements 4 bytes each, that's 2,400,000 bytes or over 2 MB. That's bigger than default stack size, that's why you get crash. Use new[] operator for those arrays and it'll work just fine.

#5162072 Why do we need to iterate data structures as they are already in RAM

Posted by Zaoshi Kaba on 22 June 2014 - 06:29 AM

I'm not sure I understand correctly. Are you asking why we have to look at all values in the array while searching for the one we need?

Imagine with stack of paper pages with just 1 word on each and you need to find page with specific word. You cannot take it out on first try, so you look at all pages 1 by 1 until you find what you need. Same principle is here.

#5156334 Best comment ever

Posted by Zaoshi Kaba on 27 May 2014 - 01:49 PM

You can find more at http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered

#5136903 Visual Studio 2013 Graphics Debug

Posted by Zaoshi Kaba on 06 March 2014 - 12:11 PM

Visual Studio 2013 comes with Direct SDK built-in into Windows SDK.

In other words, you need only VS2013. Uninstall your DirectX June 2010 SDK (or whatever month it is).

However keep in mind that you will lose D3DX, which includes texture loading & other stuff.

#5133495 version of the offline shader compiler

Posted by Zaoshi Kaba on 22 February 2014 - 05:09 AM

Microsoft stopped developing DirectX SDK as separate thing. It now comes with Visual Studio 2013 build-in into Windows API. I'm afraid you'll have to download it if you want newer compiler.

#5131806 Map texture for reading problem

Posted by Zaoshi Kaba on 16 February 2014 - 02:38 PM

Depending on driver, GPU and other things there might be some padding. Sometimes till power of 2, sometimes till multiple of 2 or other number.

In short 800 * 4 bytes are pixel data, next 128 bytes are unused, then next row starts.

#5128136 Data of texture

Posted by Zaoshi Kaba on 02 February 2014 - 05:54 AM

You're on the right track, however, what exactly isn't working? Does it crash, silently fail, etc?


  1. I'm not sure if it's possible to use D3D11_BIND_SHADER_RESOURCE flag with D3D11_USAGE_STAGING, try to set bind flags to 0.
  2. You have different number of mip levels, it might be unable to copy data because of that (I've failed to find info on MSDN).
  3. 400x400 texture isn't power of 2, therefore it's most likely bigger than (td.Width * td.Height), use D3D11_MAPPED_SUBRESOURCE::RowPitch value for "width".

#5121097 Animatian data: disk versus memory

Posted by Zaoshi Kaba on 04 January 2014 - 04:14 AM

7x 50,000 floats is only 1.4 MB. That might become a problem only if you'll have thousands of such animations.

Reading next frame from disk all the time is one huge disadvantage: disk IO is very slow, plus it puts extra wear on it.

#5119292 Simple draw command not working.

Posted by Zaoshi Kaba on 26 December 2013 - 08:18 AM

is this what mine should be like instead?

That should do it. Does it work yet?

If not try to enable (if not yet enabled) debug layer. Debugging will cause D3D to throw messages into Visual Studio if any problems arise.

#5119205 Simple draw command not working.

Posted by Zaoshi Kaba on 25 December 2013 - 11:12 AM

  1. I cannot see ID3D11DeviceContext::OMSetRenderTargets() call
  2. Vertex & Pixel shaders might contain problem as well, would be useful to see them
  3. Graphics::createVertexBuffer creates buffer but doesn't save it to variable like you imagine; it needs pointer reference or double pointer