program.h 542 B

123456789101112131415161718192021222324252627282930
  1. #ifndef PROGRAM_H
  2. #define PROGRAM_H
  3. #include <glplatform/glplatform-glcore.h>
  4. #include "lua.h"
  5. struct program {
  6. const char *vertex_text;
  7. const char *fragment_text;
  8. GLuint vertex_shader;
  9. GLuint fragment_shader;
  10. GLuint program;
  11. bool linked;
  12. };
  13. void program_init(struct program *p);
  14. bool program_compile(struct program *p);
  15. bool program_link(struct program *p);
  16. void program_destroy(struct program *p);
  17. void lprogram_create(lua_State *L);
  18. bool lprogram_set_shaders(lua_State *L, const char *vs_text, const char *fs_text);
  19. #endif