polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

ui.h (607B)


      1 
      2 #ifndef POLYADVENT_UI_H
      3 #define POLYADVENT_UI_H
      4 
      5 #include "common.h"
      6 #include "shader.h"
      7 #include "geometry.h"
      8 
      9 struct ui {
     10     struct gpu_program *shader;
     11     geometry_id quad_geom_id;
     12     gpu_addr attrs[n_vertex_attrs];
     13 
     14     struct ui_uniforms {
     15         GLint mvp;
     16         GLint uipos;
     17         GLint uisize;
     18         GLint texture;
     19     } uniforms;
     20 
     21     float ortho[MAT4_ELEMS];
     22 };
     23 
     24 void create_ui(struct ui *ui, int width, int height,
     25                struct gpu_program *);
     26 
     27 void resize_ui(struct ui *ui, int width, int height);
     28 void render_ui(struct ui *ui, float *camera);
     29 
     30 
     31 #endif /* POLYADVENT_UI_H */