aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mgl/gl.h1
-rw-r--r--include/mgl/gl_macro.h1
-rw-r--r--include/mgl/graphics/sprite.h2
-rw-r--r--include/mgl/graphics/texture.h2
4 files changed, 6 insertions, 0 deletions
diff --git a/include/mgl/gl.h b/include/mgl/gl.h
index 2537d96..c96beea 100644
--- a/include/mgl/gl.h
+++ b/include/mgl/gl.h
@@ -85,6 +85,7 @@ typedef struct {
void (*glXSwapIntervalEXT)(Display * dpy, GLXDrawable drawable, int interval);
int (*glXSwapIntervalMESA)(unsigned int interval);
int (*glXSwapIntervalSGI)(int interval);
+ void (*glGenerateMipmap)(unsigned int target);
} mgl_gl;
int mgl_gl_load(mgl_gl *self);
diff --git a/include/mgl/gl_macro.h b/include/mgl/gl_macro.h
index 3141f78..cbecf94 100644
--- a/include/mgl/gl_macro.h
+++ b/include/mgl/gl_macro.h
@@ -46,6 +46,7 @@
#define GL_CLAMP_TO_EDGE 0x812F
#define GL_LINEAR 0x2601
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
#define GL_POINTS 0x0000
#define GL_LINES 0x0001
diff --git a/include/mgl/graphics/sprite.h b/include/mgl/graphics/sprite.h
index 0193c4c..9e4ebc7 100644
--- a/include/mgl/graphics/sprite.h
+++ b/include/mgl/graphics/sprite.h
@@ -29,6 +29,8 @@ void mgl_sprite_set_origin(mgl_sprite *self, mgl_vec2f origin);
void mgl_sprite_set_size(mgl_sprite *self, mgl_vec2f size);
/* This only has an effect if the sprite has a texture set. Scales width in proportion */
void mgl_sprite_set_height(mgl_sprite *self, float height);
+/* Texture size multiplied by the sprite scaling */
+mgl_vec2f mgl_sprite_get_size(const mgl_sprite *self);
void mgl_sprite_draw(mgl_context *context, mgl_sprite *sprite);
#endif /* MGL_SPRITE_H */
diff --git a/include/mgl/graphics/texture.h b/include/mgl/graphics/texture.h
index 9524ab1..1f473e2 100644
--- a/include/mgl/graphics/texture.h
+++ b/include/mgl/graphics/texture.h
@@ -22,11 +22,13 @@ struct mgl_texture {
int max_width;
int max_height;
bool pixel_coordinates;
+ bool mipmap;
};
typedef struct {
bool compressed; /* false by default */
bool pixel_coordinates; /* false by default, texture coordinates are normalized */
+ bool mipmap; /* false by default, generate mipmaps (available since opengl 3.0) */
} mgl_texture_load_options;
int mgl_texture_init(mgl_texture *self);