-
Notifications
You must be signed in to change notification settings - Fork 2
/
chugl_util.h
64 lines (52 loc) · 1.7 KB
/
chugl_util.h
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
58
59
60
61
62
/*----------------------------------------------------------------------------
chugl
Chuck OpenGL library module
Copyright (c) 2014 Spencer Salazar. All rights reserved.
https://ccrma.stanford.edu/~spencer/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
U.S.A.
-----------------------------------------------------------------------------*/
#include "chugl.h"
#include "chuck_dl.h"
#include "chuck_def.h"
#include "chuck_type.h"
template<typename T>
void copy_ckarray4_to_array(T *array, Chuck_Array4 *ckarray)
{
t_CKUINT val;
for(int i = 0; i < ckarray->size(); i++)
{
ckarray->get(i, &val);
array[i] = val;
}
}
template<typename T>
void copy_ckarray8_to_array(T *array, Chuck_Array8 *ckarray)
{
t_CKFLOAT val;
for(int i = 0; i < ckarray->size(); i++)
{
ckarray->get(i, &val);
array[i] = val;
}
}
template<typename T>
void copy_array_to_ckarray4(T *array, Chuck_Array4 *ckarray)
{
t_CKINT val;
for(int i = 0; i < ckarray->size(); i++)
{
val = array[i];
ckarray->set(i, val);
}
}