This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
csce441pine64backup/L04/src/Shape.h
2017-02-17 17:32:44 -06:00

36 lines
750 B
C++

#pragma once
#ifndef _SHAPE_H_
#define _SHAPE_H_
#include <string>
#include <vector>
#include <memory>
class Program;
/**
* A shape defined by a list of triangles
* - posBuf should be of length 3*ntris
* - norBuf should be of length 3*ntris (if normals are available)
* - texBuf should be of length 2*ntris (if texture coords are available)
* posBufID, norBufID, and texBufID are OpenGL buffer identifiers.
*/
class Shape
{
public:
Shape();
virtual ~Shape();
void loadMesh(const std::string &meshName);
void init();
void draw(const std::shared_ptr<Program> prog) const;
private:
std::vector<float> posBuf;
std::vector<float> norBuf;
std::vector<float> texBuf;
unsigned posBufID;
unsigned norBufID;
unsigned texBufID;
};
#endif