Sign in to follow this  
Mezz

D3DXMATRIXA16 and std::vector

Recommended Posts

I have a problem that basically I am stumped on. It goes a little something like this.
#include <vector>
#include <Windows.h>
#include <d3dx9.h>

class Bullshit
{
public:
    D3DXMATRIXA16 m_mat;
};

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
    std::vector <Bullshit> vec;
    return(0);
}

That's the little test program I made to ensure I wasn't insane. When I compile it, I get this error:
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\vector(507) : error C2719: '_Val': formal parameter with __declspec(align('16')) won't be aligned
        d:\Mezz\Poo\App.cpp(14) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
        with
        [
            _Ty=Bullshit
        ]
If I take out the matrix member, it's fine. If I make it a vector of pointers to the class, it's fine. But why doesn't it work like that? I would prefer to use a 16-byte aligned matrix if possible... -Mezz

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this