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!


Member Since 21 Feb 2008
Offline Last Active Today, 06:44 AM

#5239188 directxmath headers

Posted by NightCreature83 on 09 July 2015 - 06:12 AM

Seems like you are missing a few headers that define these macros/functions maybe this helps: https://msdn.microsoft.com/en-us/library/hh916382.aspx

Which most likely means it can't find this header: #include <sal.h>


This explains what sal does: https://msdn.microsoft.com/en-us/library/hh916383.aspx

#5237467 Direct3d 11 programming using Windows SDK

Posted by NightCreature83 on 29 June 2015 - 05:57 AM

There is not much difference between the version in the Windows SDK and the June 2010 SDK. The sample from the DX SDK are still all valid. Replacing D3DX is not that hard, most of what D3DX did can be achieved with the DirectX Toolkit. Loading and compiling a shader yourself is not that hard, same as writing your own FX library, but if you dont want to do taht I believe the June SDK comes with the source for the FX shaders.

The math lib now resides in DirectXMath.h instead of xnamath.h

#5234021 HLSL matrix initialization

Posted by NightCreature83 on 10 June 2015 - 03:25 AM

You can also just per vector initialise the float3x3 which should work.


like  this, I ripped this from some old code I had but it seems to work properly:

float3 Normal  = normalize(normalTangentSpace);
float3 Tangent = normalize(tangent);
float3 binormal = normalize( cross(Tangent, Normal) );
float3x3 matInverse = transpose( float3x3(Tangent, binormal, normalize(normal)));

I would always initialise the matrix types from vector types just to avoid the problems of alignment.


I believe newer syntax allows you to use things like this, which makes what you mean far more explicit.

float4x4 mat = float4( {1,2,3,4}, {1,2,3,4}, {1,2,3,4}, {1,2,3,4} );
float3x3 mat = float3( {1,2,3}, {1,2,3}, {1,2,3} );

#5230684 Is Xbox360 live arcade development still worth it?

Posted by NightCreature83 on 24 May 2015 - 09:34 AM

The audience for xblig was never huge anyway.

Microsoft were put under pressure by AAA studios to give big releases priority positions in the search results, basically making indie games second class citizens in the arcade store.

Considering AAA studios might pay a lot for licensing to release games on physical dvds in brick and mortar stores for xbox, and xblig published games paid $99 a year it's easy to see why they might have got a bit miffed.

As more and more move from 360 to xbox one, the audience will continue to decrease, I wouldn't bother with it if I were you and stay tuned for an xbox one equivalent.

You can change that might to AAA studios pay a license fee to MS and Sony to release on the consoles, there is no might about that fact.

I have a feeling the XBox One equivalent will just be the strore like it is on Windows now.

#5229529 Running Debug and Release Code Simultaneously

Posted by NightCreature83 on 17 May 2015 - 09:43 PM

If this is c++ set your solution to release and warp parts of the code that you want in debug in pragma optimize. Look at MSDN, GCC or Clang docs for the precise syntax because it is compiler dependant.



#pragma optimize( "", off)
//Code in here is not optimized.
#pragma optimize( "", on)


This is not the same as running a release build with debug symbols, the code in the wrapped pragma is actually compiled as un-optimized code, like a debug build. This makes debugging easier. Sometimes you need to do this with whole files because inline functions and stuff like that.

#5223736 Time to decide on a UI Framework (SharpDX)

Posted by NightCreature83 on 16 April 2015 - 11:12 AM

Xaml is no good for games the only good thing about xaml is its data bindings. As soon as you go down the path of fixed objects for your UI eg.: text boxt, button, etc. you have locked yourself into implementing every object.


An aspect or component based approach is a lot easier to deal with, where an item has behaviours attached to it. The benefit of this is that rendering is completely seperate from the objects themselves, anything can become a button as soon as you give it the selecatable behaviour.

#5223697 Why high level languages are slow

Posted by NightCreature83 on 16 April 2015 - 09:37 AM

Honestly the part that annoys me most about trying to code with CPU cache in mind?

I have no guarantees.

I don't know how big the cache is. I don't know how big the cache lines are. Structs that fit in caches on one machine will fail to fit and cripple performance on another. Alignments that set up the addresses all nice and neat on CPU A will all be offset on CPU B and, again, push it over the cache line.

Sure, I might be able to make some assumptions about today's processes (64 byte line size seems to be relatively common) but what about that 128mb monster mentioned earlier in the thread?

And people wonder why consoles are popular to develop games for - things like cache sizes and line sizes are fixed for 5+ years ;)

Ironically, a language like C# or Java could actually JIT the struct sizes or split them up differently based on cache sizes of the CPU the program is running on - thereby increasing speed. I am not saying either of them do - but because they make fewer guarantees about memory layout and the like they have the flexibility to do so... a C/C++ compiler cannot do that. So that's another case where a "higher level" language can win out - tailoring your code at execution time to the actual end-user's environment.

This is not true in general in x86 land your cache lines are 64 bytes and have been for a long time now, heck even the PowerPc chips in 360 and PS3 had 64 byte cachelines. When moving to arm chips is where things might change but I bet the arm architecture has a common chacheline size.

But you actually dont have to care that much about this, as long as you keep what you want to access close to each other and go through this in a linear fashion, the prefetcher in the CPU will hide most of the latency for you.

You dont have to care about the L4 cache size you have 20MB haswells out there right now, thats not what you optimize for just means that the 64 cacheline code you wrote can be faster longer before you have to hit actual memory.

A JIT however doesn't have the information needed to make sure that the split it makes for the cachelines is how the algoritm that operates on that memory is using that structure.


And yes consoles among developers are popular for their fixed hardware but that matters less than you think, now that all hardware is out of order hardware. The CPU will do more micro optimisations on the instructions than what you can do with asm.

#5223385 Why high level languages are slow

Posted by NightCreature83 on 15 April 2015 - 05:16 AM

Found this article and thought I should share this with you guys:


#5215471 Returning a true in a function that has a bool return type

Posted by NightCreature83 on 09 March 2015 - 01:14 PM

How about you print a  seperator in between consecutive executions of the if statement that should help too.

#5215384 Returning a true in a function that has a bool return type

Posted by NightCreature83 on 09 March 2015 - 02:41 AM

Depending on your environment another possibility is that you have a situation where the source code doesn't actually match the object code you're debugging. In that case a full rebuild may eliminate some weirdness. 

This is usually the first thing you should do when you encounter something that doesn't make sense. The other thing you can do is look at the assembly code that is being executed and see if it doesn't jump to the wrong location.

#5214932 When and how do I start graphics? (C++)

Posted by NightCreature83 on 06 March 2015 - 05:56 AM

I took the jump in at the deep end path of learning GL and DX, and just did an internship for a company where I ported a OpenGL renderer to D3D9c. The benefit of doing this was that I didn't have to deal with setting up a pipeline to be able to render stuff that all existed, I could just focus on learning D3D and GL

#5211132 Modern game development/programming for a not-quite beginner?

Posted by NightCreature83 on 17 February 2015 - 02:16 AM

If you are doing C/C++ I would start with writing 64 bit code, this is not inherently different from 32 bit code with the exception that you don't expect data types to have specific sizes. If you start to think that data types have specific sizes like a pointer being 4 bytes you are in for some surprises in 64 bits where this length doubles. Not doing this means your code is easier to port between 32 bit and 64 bit, as in mostly recompile and fix minor issues.


If you go with a managed language this generally doesn't matter, specially with Java or C# as they compile into byte code, and its up to the VM to deal with 32/64 bit issues mostly.


IDE wise on Windows and C#, C/C++ stick with Visual Studio, the 2013 CE version is Pro version so you get everything most professional devs have. On OSx I would go with Xcode, *nix you have eclipse or netbeans (there are probably others too), I prefer the latter one but thats a GUI thing mostly. I know of several coders that actually never use an IDE and just use Sublime, Vim, Emacs or your own preferred text editor and command line tools for the compiler and debugger which is an other option to go.

#5210906 Disassociate mouse with its position

Posted by NightCreature83 on 15 February 2015 - 07:19 PM

You have to listen to raw input for this too work, Raw input will just give you the absolute movement or relative movement from the previous position. From what I have seen from my clickpad and logitech mouse is that it will give you relative position updates and these have no border. So you can actually move your mouse indefinitely and you will get updates from that direction.


Dont inmplement Direct Input, MS tells you not to use direct input for mouse or keyboard input and use instead use Raw input.

#5210438 best and fastest way to understand a code written by some one else

Posted by NightCreature83 on 13 February 2015 - 02:55 AM

First thing I would do is actually install doxgen or another code documentation generation tool, and graphviz dot package and generate me a documentation well that contains inheritance and composition graphs. From there you will get an overall view of how the classes and code is connected, so the overall architecture.

#5210243 Modern game development/programming for a not-quite beginner?

Posted by NightCreature83 on 12 February 2015 - 05:33 AM

I would stay away from snake (python) the duck typing of the language and the interpreter teach a few bad behaviours that you are better of not picking up. Seeing you already have programming experience I would go with C# or C/C++ the major difference between the two is that you do not have to do everything yourself in C#. Everything you know about C/C++ pretty much directly translates to C#, with maybe the only real exception that a struct in C# is a value type like an int.


If you worked with C++98 not that much has changed in the language, it just become a bit more standardized STL now pretty much behaves the same on the 3 major implementations (MSVC, GCC, Clang). C++11 added some handy features like nullptr instead of 0, functions to create smart pointers and such, you pick this up fast enough and there are a million resources out there online. http://www.cplusplus.com is a good one and it will show you the differences between 98 and 11 on most of its references.


If you are purely looking into writing a game I would advice you to use a game framework so you dont have to deal with all the boiler plate code and can just start writing your game. Anything from a full game engine like UE4 to helper frameworks like SFML, SDL, SlimDX, monogame will do for this stuff and will speed up your work. The major difference between the engines and the frameworks is that you will still have to deal with connecting up the frameworks yourself, were in the engines you can just start creating content and gameplay code.


If you are more interested in doing all of this yourself just grab the latest windows SDK which will contain the DirectX sdk and start writing that boilerplate code yourself.