Visual Studio 2013 GivesExceptions at Memset function while using DirectX 9.

  • Thread starter Thread starter rydog1234567890
  • Start date Start date
R

rydog1234567890

Guest
I am trying to program a RTS game. I did not know what to do for a minimap, so I bought a book called Programming a 3d RTS Game with Direct3D by Carl Granberg. When I tried to compile with the newer code (at this website: Carl Granberg / C-J Graphic Home the you can see the full minimap code if you check chapter 16. I used that code for my game)

When I tried to compile it, I got an exception because I was using this function (can be found around line 54 in the mapObject.cpp file)


memset(bytes, 0, sRect.Pitch*sRect.Pitch);


I am using DirectX 9, and will convert to DirectX 12 when I get this issue out of the way.


How can I fix this issue?



What I know is that this draws the black square that covers the minimap for the minimap's fog of war. When I comment out the code, the game runs fine, but I only get 1/3 of a minimap, which is an obvious problem.


If there are any other problems, just tell me.


-rydog

Continue reading...
 
Back
Top