1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* NAppGUI Cross-platform C SDK
* 2015-2025 Francisco Garcia Collado
* MIT Licence
* https://nappgui.com/en/legal/license.html
*
* File: s2d.cpp
*
*/
/* Size 2d */
#include "s2d.h"
#include "s2d.hpp"
/*---------------------------------------------------------------------------*/
S2Df s2df(const real32_t width, const real32_t height)
{
S2Df s2d;
s2d.width = width;
s2d.height = height;
return s2d;
}
/*---------------------------------------------------------------------------*/
S2Df s2di(const uint32_t width, const uint32_t height)
{
S2Df s2d;
s2d.width = (real32_t)width;
s2d.height = (real32_t)height;
return s2d;
}
/*---------------------------------------------------------------------------*/
S2Dd s2dd(const real64_t width, const real64_t height)
{
S2Dd s2d;
s2d.width = width;
s2d.height = height;
return s2d;
}
/*---------------------------------------------------------------------------*/
const S2Df kS2D_ZEROf = {0, 0};
const S2Dd kS2D_ZEROd = {0, 0};
template <>
const S2D< real32_t >(*S2D< real32_t >::kZERO) = ((S2D< real32_t > *)&kS2D_ZEROf);
template <>
const S2D< real64_t >(*S2D< real64_t >::kZERO) = ((S2D< real64_t > *)&kS2D_ZEROd);
/*---------------------------------------------------------------------------*/