src/render/SDL_d3dmath.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 10 Mar 2014 17:19:19 -0700
changeset 8599 532cd234e923
child 8764 3d5ef7548688
permissions -rw-r--r--
Fixed D3D9 initialization on Windows 8, which doesn't have D3DX
slouken@8599
     1
/*
slouken@8599
     2
  Simple DirectMedia Layer
slouken@8599
     3
  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
slouken@8599
     4
slouken@8599
     5
  This software is provided 'as-is', without any express or implied
slouken@8599
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@8599
     7
  arising from the use of this software.
slouken@8599
     8
slouken@8599
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@8599
    10
  including commercial applications, and to alter it and redistribute it
slouken@8599
    11
  freely, subject to the following restrictions:
slouken@8599
    12
slouken@8599
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@8599
    14
     claim that you wrote the original software. If you use this software
slouken@8599
    15
     in a product, an acknowledgment in the product documentation would be
slouken@8599
    16
     appreciated but is not required.
slouken@8599
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@8599
    18
     misrepresented as being the original software.
slouken@8599
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@8599
    20
*/
slouken@8599
    21
#include "../SDL_internal.h"
slouken@8599
    22
slouken@8599
    23
slouken@8599
    24
/* Direct3D matrix math functions */
slouken@8599
    25
slouken@8599
    26
typedef struct
slouken@8599
    27
{
slouken@8599
    28
    float x;
slouken@8599
    29
    float y;
slouken@8599
    30
} Float2;
slouken@8599
    31
slouken@8599
    32
typedef struct
slouken@8599
    33
{
slouken@8599
    34
    float x;
slouken@8599
    35
    float y;
slouken@8599
    36
    float z;
slouken@8599
    37
} Float3;
slouken@8599
    38
slouken@8599
    39
typedef struct
slouken@8599
    40
{
slouken@8599
    41
    float x;
slouken@8599
    42
    float y;
slouken@8599
    43
    float z;
slouken@8599
    44
    float w;
slouken@8599
    45
} Float4;
slouken@8599
    46
slouken@8599
    47
typedef struct
slouken@8599
    48
{
slouken@8599
    49
    union {
slouken@8599
    50
        struct {
slouken@8599
    51
            float _11, _12, _13, _14;
slouken@8599
    52
            float _21, _22, _23, _24;
slouken@8599
    53
            float _31, _32, _33, _34;
slouken@8599
    54
            float _41, _42, _43, _44;
slouken@8599
    55
        };
slouken@8599
    56
        float m[4][4];
slouken@8599
    57
    };
slouken@8599
    58
} Float4X4;
slouken@8599
    59
slouken@8599
    60
slouken@8599
    61
Float4X4 MatrixIdentity();
slouken@8599
    62
Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2);
slouken@8599
    63
Float4X4 MatrixScaling(float x, float y, float z);
slouken@8599
    64
Float4X4 MatrixTranslation(float x, float y, float z);
slouken@8599
    65
Float4X4 MatrixRotationX(float r);
slouken@8599
    66
Float4X4 MatrixRotationY(float r);
slouken@8599
    67
Float4X4 MatrixRotationZ(float r);
slouken@8599
    68
slouken@8599
    69
/* vi: set ts=4 sw=4 expandtab: */