Skip to main content
gamedev.net
🔒 Locked 🎮 Unity

Unknown Warning in my Code!!

Started by NovaCaine Sep 7, 2005 at 10:11 PM 2 replies 1.4k views
Original Post
NovaCaine
NovaCaine
Hey all, I've got this warning in my code warning C4793: 'aligned data types not supported in managed code' : causes native code generation for function 'CGame::SetupMatrices' and i dont understand what has caused it. The code for the function is

    // Rotate The Tiger Model A bit
	g_fXRot += 0.0f;
	g_fYRot = (timeGetTime()/25.0f) * 0.0174532925f;
	g_fZRot += 0.0f;

	m_Tiger.SetMeshRotation( g_fYRot, g_fXRot, g_fZRot );

    // Set up our view matrix. A view matrix can be defined given an eye point,
    // a point to lookat, and a direction for which way is up. Here, we set the
    // eye five units back along the z-axis and up three units, look at the 
    // origin, and define "up" to be in the y-direction.
    D3DXVECTOR3 vEyePt( 0.0f, 3.0f,-5.0f );
    D3DXVECTOR3 vLookatPt( 0.0f, 0.0f, 0.0f );
    D3DXVECTOR3 vUpVec( 0.0f, 1.0f, 0.0f );
    D3DXMATRIXA16 matView;
    D3DXMatrixLookAtLH( &matView, &vEyePt, &vLookatPt, &vUpVec );
    m_D3DDevice->SetTransform( D3DTS_VIEW, &matView );

    // For the projection matrix, we set up a perspective transform (which
    // transforms geometry from 3D view space to 2D viewport space, with
    // a perspective divide making objects smaller in the distance). To build
    // a perpsective transform, we need the field of view (1/4 pi is common),
    // the aspect ratio, and the near and far clipping planes (which define at
    // what distances geometry should be no longer be rendered).
    D3DXMATRIXA16 matProj;
    D3DXMatrixPerspectiveFovLH( &matProj, D3DX_PI/4, 1.0f, 1.0f, 100.0f );
    m_D3DDevice->SetTransform( D3DTS_PROJECTION, &matProj );

Im using VC++ 2005 Beta 2 with DirectX (obviously). Any help would be greatly appreciated. Thanks to all in advance.
Gorwooken
Gorwooken
just use the D3DMATRIX instead of the aligned D3DXMATRIXA16 structure
NovaCaine
NovaCaine
thats all it was!??!??!? now i feel stupid....


cheers for that.
Arild Fines
Arild Fines
Are you sure you want to be compiling as managed code in the first place? That looks very much like unmanaged DirectX, and if you're using that there's really not much point in using managed code.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.