add handling of GL_TEXTURE_RECTANGLE target, and add automatic handling if using it as a sprite
This commit is contained in:
@@ -129,6 +129,7 @@ EXPORT uint32_t texture_getheight(texture_t tex);
|
||||
EXPORT enum gs_color_format texture_getcolorformat(texture_t tex);
|
||||
EXPORT bool texture_map(texture_t tex, void **ptr, uint32_t *row_bytes);
|
||||
EXPORT void texture_unmap(texture_t tex);
|
||||
EXPORT bool texture_isrect(texture_t tex);
|
||||
|
||||
EXPORT void cubetexture_destroy(texture_t cubetex);
|
||||
EXPORT uint32_t cubetexture_getsize(texture_t cubetex);
|
||||
|
@@ -223,3 +223,14 @@ failed:
|
||||
gl_bind_texture(GL_TEXTURE_2D, 0);
|
||||
blog(LOG_ERROR, "texture_unmap (GL) failed");
|
||||
}
|
||||
|
||||
bool texture_isrect(texture_t tex)
|
||||
{
|
||||
struct gs_texture_2d *tex2d = (struct gs_texture_2d*)tex;
|
||||
if (!is_texture_2d(tex, "texture_unmap")) {
|
||||
blog(LOG_ERROR, "texture_isrect (GL) failed");
|
||||
return false;
|
||||
}
|
||||
|
||||
return tex2d->base.gl_target == GL_TEXTURE_RECTANGLE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user