-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaterial.c
More file actions
58 lines (47 loc) · 1.08 KB
/
material.c
File metadata and controls
58 lines (47 loc) · 1.08 KB
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
/*
* Final Program, CMPS 160, Fall 1999
* Ben Gertzfield <ben@cse.ucsc.edu>
*
* This program is released under the GNU GPL, version 2 or later.
*/
/* Material routines */
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <gtk/gtk.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glx.h>
#include <pthread.h>
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include "prog.h"
#include "material.h"
float Gkos_Pearl[] = {
0.250000, 0.207250, 0.207250, 0.922000,
1.000000, 0.829000, 0.829000, 0.922000,
0.296648, 0.296648, 0.296648, 0.922000,
11.264000
};
/*
* Convert the given array of floats into a struct material.
*/
struct material gkos_get_material(float *mat_array)
{
struct material mat;
memcpy(&mat, mat_array, sizeof(struct material));
return mat;
}
/*
* Set the material on the object to the given material.
*/
void gkos_set_material(struct object *obj, float *mat)
{
obj->material = gkos_get_material(mat);
}
// Local variables:
// c-file-style:"cc-mode"
// End: