textures
[nexus3d] / src / gfx.h
index fc9816a..cf3887c 100644 (file)
--- a/src/gfx.h
+++ b/src/gfx.h
@@ -43,6 +43,17 @@ enum nex_cube_face {
        NEX_CUBE_PZ, NEX_CUBE_NZ
 };
 
+enum nex_pixfmt {
+       NEX_GREY8,
+       NEX_RGB24,
+       NEX_RGBA32,
+       NEX_SRGB,
+       NEX_SRGBA,
+       NEX_GREYF,
+       NEX_RGBF,
+       NEX_RGBAF
+};
+
 typedef struct nex_buffer nex_buffer;
 typedef struct nex_geometry nex_geometry;
 typedef struct nex_shader nex_shader;
@@ -104,4 +115,21 @@ nex_sdrprog *nex_load_sdrprog(const char *vpath, const char *ppath);
 nex_texture *nex_alloc_texture(enum nex_tex_type type);
 void nex_free_texture(nex_texture *tex);
 
+void nex_tex_storage1d(nex_texture *tex, int sz, enum nex_pixfmt fmt);
+void nex_tex_storage2d(nex_texture *tex, int xsz, int ysz, enum nex_pixfmt fmt);
+void nex_tex_storage3d(nex_texture *tex, int xsz, int ysz, int zsz, enum nex_pixfmt fmt);
+void nex_tex_storagecube(nex_texture *tex, int xsz, int ysz, enum nex_pixfmt fmt);
+
+void nex_tex_update1d(nex_texture *tex, int lvl, int x, int width,
+               enum nex_pixfmt pixfmt, void *data, long pitch);
+void nex_tex_update2d(nex_texture *tex, int lvl, int x, int y, int width, int height,
+               enum nex_pixfmt pixfmt, void *data, long pitch);
+void nex_tex_update3d(nex_texture *tex, int lvl, int x, int y, int z, int width,
+               int height, int depth, enum nex_pixfmt pixfmt, void *data, long pitch);
+void nex_tex_updatecube(nex_texture *tex, int lvl, enum nex_cube_face face,
+               int x, int y, int width, int height, enum nex_pixfmt pixfmt, void *data,
+               long pitch);
+
+void bind_texture(int tunit, nex_texture *tex);
+
 #endif /* NEXUS3D_GFX_H_ */