*/
#include "except.h"
-#include "ilwrap.h"
#include "texture2d.h"
using namespace std;
void Texture2D::load_image(const string &fn)
{
- Image img;
+ Graphics::Image img;
img.load_file(fn);
image(img);
}
-void Texture2D::image(const Image &img)
+void Texture2D::image(const Graphics::Image &img)
{
unsigned w=img.get_width();
unsigned h=img.get_height();
- PixelFormat fmt=img.get_format();
+ PixelFormat fmt=pixelformat_from_graphics(img.get_format());
if(width==0)
storage(fmt, w, h, 0);
else if(w!=width || h!=height)
void Texture2D::Loader::image_data(const string &data)
{
- Image img;
- img.load_lump(data.data(), data.size());
+ Graphics::Image img;
+ img.load_memory(data.data(), data.size());
- static_cast<Texture2D &>(tex).image(img);
+ static_cast<Texture2D &>(obj).image(img);
}
void Texture2D::Loader::raw_data(const string &data)
{
- Texture2D &t2d=static_cast<Texture2D &>(tex);;
+ Texture2D &t2d=static_cast<Texture2D &>(obj);
t2d.image(0, t2d.ifmt, UNSIGNED_BYTE, data.data());
}
void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h, unsigned b)
{
- static_cast<Texture2D &>(tex).storage(fmt, w, h, b);
+ static_cast<Texture2D &>(obj).storage(fmt, w, h, b);
}
} // namespace GL