+#include <msp/gl/extensions/msp_texture1d.h>
#include "bindable.h"
#include "error.h"
#include "texture1d.h"
ifmt(RGB),
width(0),
allocated(0)
-{ }
+{
+ static Require _req(MSP_texture1D);
+}
void Texture1D::storage(PixelFormat fmt, unsigned wd)
{
if(allocated&(1<<level))
return;
- image(level, get_base_pixelformat(ifmt), UNSIGNED_BYTE, 0);
+ PixelFormat base_fmt = get_base_pixelformat(ifmt);
+ image(level, base_fmt, get_alloc_type(base_fmt), 0);
}
void Texture1D::image(unsigned level, PixelFormat fmt, DataType type, const void *data)
allocated |= 1<<level;
if(gen_mipmap && level==0)
{
+ auto_generate_mipmap();
for(; w; w>>=1, ++level) ;
allocated |= (1<<level)-1;
}