Add texture (not yet fully implemented) and fix chaning of dispose handlers

This commit is contained in:
2020-06-30 21:49:37 +02:00
parent 93fb12eb24
commit 74fd10883c
7 changed files with 7856 additions and 2 deletions

View File

@@ -0,0 +1,45 @@
#ifndef _SHIMATTA_OPENGL_TEXTURE_H_
#define _SHIMATTA_OPENGL_TEXTURE_H_
#include <glib.h>
#include <glib-object.h>
#include <epoxy/gl.h>
G_BEGIN_DECLS
#define SHIMATTA_TYPE_OPENGL_TEXTURE (shimatta_opengl_texture_get_type())
G_DECLARE_DERIVABLE_TYPE(ShimattaOpenglTexture, shimatta_opengl_texture, SHIMATTA, OPENGL_TEXTURE, GObject);
struct _ShimattaOpenglTextureClass {
GObjectClass super;
void (*use)(ShimattaOpenglTexture *texture);
int (*use_in_slot)(ShimattaOpenglTexture *texture, unsigned int slot);
};
void shimatta_opengl_texture_use(ShimattaOpenglTexture *texture);
int shimatta_opengl_texture_use_in_slot(ShimattaOpenglTexture *texture, unsigned int slot);
ShimattaOpenglTexture *shimatta_opengl_texture_new(void);
void shimatta_opengl_texture_set_filter(ShimattaOpenglTexture *texture, int filter_s, int filter_t);
void shimatta_opengl_texture_set_wrap(ShimattaOpenglTexture *texture, int wrap_s, int wrap_t);
void shimatta_opengl_texture_set_gen_mipmap(ShimattaOpenglTexture *texture, gboolean gen_mipmap);
int shimatta_opengl_texture_get_filter(ShimattaOpenglTexture *texture, int *filter_s, int *filter_t);
int shimatta_opengl_texture_get_wrap(ShimattaOpenglTexture *texture, int *wrap_s, int *wrap_t);
gboolean shimatta_opengl_texture_get_gen_mipmap(ShimattaOpenglTexture *texture);
int shimatta_opengl_texture_set_data(ShimattaOpenglTexture *texture, unsigned int width, unsigned int height,
GLenum format, void *buffer);
int shimatta_opengl_texture_set_from_image(ShimattaOpenglTexture *texture, const char *path);
G_END_DECLS
#endif /* _SHIMATTA_OPENGL_TEXTURE_H_ */

7656
include/stb/stb_image.h Normal file

File diff suppressed because it is too large Load Diff