I understand that programming languages can either be run in a VM (Java, etc) on every OS that supports the VM natively or can be compiled to machine code (C, etc) for each platform.
What I don't necessarily understand is why programs (whether dealing with graphics APIs like OpenGL, DirectX12 or Mantle, or not dealing with any at all) aren't all cross-platform if it's as easy as cross-compiling?
What is it that keeps programs, games, APIs (for example OpenGL) from being compatible on all platforms (except that maybe the developers only wanted it on one platform)?
With the new graphics API, Vulkan, coming out soon, would it be theoretically possible if using a toolkit like wxWidgets, for native GUI, along with an API like Vulkan to create programs that run completely cross platform as long as the OS has a Vulkan driver? Any other insight on something I'm missing would be appreciated.