46 lines
680 B
C++

#ifndef ___SPHERE_H
#define ___SPHERE_H
#include "GL/glew.h"
#include <GL/GL.h>
#include <glm/mat4x4.hpp>
#include <vector>
#include "ADrawable.h"
#include "Loader.h"
class Sphere : public ADrawable
{
public:
Sphere();
Sphere(float rad, GLuint sl, GLuint st);
~Sphere();
void draw(ShaderProgram *shader, glm::mat4x4 proj_matrix, glm::mat4x4 view_matrix);
int getVertexArrayHandle();
GLuint VAO, VBO_position, VBO_normal, VBO_tex, IBO;
private:
GLuint nVerts, elements;
float radius;
GLuint slices, stacks;
void generateVerts(float *, float *, float *, unsigned int *);
// Inherited via ADrawable
virtual DrawableType getType() override;
};
#endif