diff --git a/src/Magnum/Implementation/FramebufferState.h b/src/Magnum/Implementation/FramebufferState.h index 360bfaaef..d3f01ad40 100644 --- a/src/Magnum/Implementation/FramebufferState.h +++ b/src/Magnum/Implementation/FramebufferState.h @@ -30,6 +30,13 @@ #include "Magnum/Framebuffer.h" +#ifdef _MSC_VER +/* Otherwise the member function pointers will have different size based on + whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND + IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ +#include "Magnum/Renderbuffer.h" +#endif + namespace Magnum { namespace Implementation { struct FramebufferState { diff --git a/src/Magnum/Implementation/QueryState.h b/src/Magnum/Implementation/QueryState.h index 363ec5b8f..771135a3e 100644 --- a/src/Magnum/Implementation/QueryState.h +++ b/src/Magnum/Implementation/QueryState.h @@ -27,7 +27,14 @@ #include +#include "Magnum/Magnum.h" + +#ifdef _MSC_VER +/* Otherwise the member function pointers will have different size based on + whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND + IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ #include "Magnum/AbstractQuery.h" +#endif #if defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2) #error this header is not available in WebGL 1.0 build diff --git a/src/Magnum/Implementation/ShaderProgramState.h b/src/Magnum/Implementation/ShaderProgramState.h index d972729d4..9c0ceba56 100644 --- a/src/Magnum/Implementation/ShaderProgramState.h +++ b/src/Magnum/Implementation/ShaderProgramState.h @@ -31,6 +31,13 @@ #include "Magnum/Magnum.h" #include "Magnum/OpenGL.h" +#ifdef _MSC_VER +/* Otherwise the member function pointers will have different size based on + whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND + IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ +#include "Magnum/AbstractShaderProgram.h" +#endif + namespace Magnum { namespace Implementation { struct ShaderProgramState { diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/Implementation/TextureState.h index 6d2eeabf2..f6c31be43 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/Implementation/TextureState.h @@ -30,6 +30,13 @@ #include "Magnum/CubeMapTexture.h" +#ifdef _MSC_VER +/* Otherwise the member function pointers will have different size based on + whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND + IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ +#include "Magnum/BufferTexture.h" +#endif + namespace Magnum { namespace Implementation { struct TextureState { diff --git a/src/Magnum/Implementation/TransformFeedbackState.h b/src/Magnum/Implementation/TransformFeedbackState.h index ebfb431c6..97830a1bf 100644 --- a/src/Magnum/Implementation/TransformFeedbackState.h +++ b/src/Magnum/Implementation/TransformFeedbackState.h @@ -25,7 +25,17 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum/Context.h" +#include + +#include "Magnum/Magnum.h" +#include "Magnum/OpenGL.h" + +#ifdef _MSC_VER +/* Otherwise the member function pointers will have different size based on + whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND + IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ +#include "Magnum/TransformFeedback.h" +#endif #ifdef MAGNUM_TARGET_GLES2 #error this header is not available in OpenGL ES 2.0 build