/*
Copyright (c) 2015, Mislav Bozicevic <misbozice@foi.hr>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef VALJAK_H
#define VALJAK_H

#include <assert.h>
#include <stdlib.h>
#include <math.h>
#include <GL/gl.h>

#ifndef M_PI
#define M_PI 3.14159265358979323846264338327
#endif

struct valjak_t{
	double n;
	float h;
	int vrhovi_plast_len;
	GLfloat *vrhovi_plast;
	int normale_plast_len;
	GLfloat *normale_plast;
	int indeksi_plast_len;
	GLuint *indeksi_plast;
	int vrhovi_baza1_len;
	GLfloat *vrhovi_baza1;
	int normale_baza1_len;
	GLfloat *normale_baza1;
	int vrhovi_baza2_len;
	GLfloat *vrhovi_baza2;
	int normale_baza2_len;
	GLfloat *normale_baza2;
	int indeksi_baza_len;
	GLuint *indeksi_baza;
};

struct valjak_t* valjak_inicijaliziraj(float, float, int);
void valjak_crtaj(struct valjak_t*);
void valjak_oslobodi(struct valjak_t*);
#endif