Skip to content

glisy/program

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GlisyProgram

Installation

$ clib install glisy/program --save

Usage

#include <glisy/program.h>
#include <glisy/shader.h>
#include <fs/fs.h>

int
main (void) {

  // shader setup time
  GlisyProgram program;
  GlisyShader vertex;
  GlisyShader fragment;

  glisyProgramInit(&program);
  glisyShaderInit(&vertex,
                  GL_VERTEX_SHADER,
                  fs_read(vertexPath));

  glisyShaderInit(&fragment,
                  GL_VERTEX_SHADER,
                  fs_read(fragmentPath));

  glisyProgramAttachShader(&program, &vertex);
  glisyProgramAttachShader(&program, &fragment);
  glisyProgramLink(&program);
  glisyProgramBind(&program);

  return 0;
}

License

MIT