// -*- c++ -*-
// load and update shader
#ifndef SHADER_H
#define SHADER_H

// Apple's annoying non-standard GL include location
#if defined(__APPLE__) || defined(MACOSX)
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#else
#include <GL/gl.h>
#include <GL/glext.h>
#endif


#include <sys/stat.h>
#include <string>

// info on a vertex or fragment shader
class ShaderInfo {
public:
    enum ShaderType {VERTEX, FRAGMENT, NUM_SHADER_TYPES};

private:
    ShaderType type;
    std::string name;
    struct stat time;
public:
    GLhandleARB glsl;
    
public:
    ShaderInfo(ShaderType t);
    void setName(std::string n);
    void updateShader();
};

extern ShaderInfo vertInfo, fragInfo;

// update both vertex and fragment shader
extern "C" void updateShaders();

#endif
