25 #include "eng3d/ui/image.hpp"
26 #include "eng3d/texture.hpp"
27 #include "eng3d/state.hpp"
37 Image::Image(
int _x,
int _y,
unsigned w,
unsigned h, std::shared_ptr<Eng3D::Texture> tex,
Widget* _parent)
43 Image::Image(
int _x,
int _y,
unsigned w,
unsigned h,
const std::string& texture_path,
Widget* _parent)
47 current_texture = s.tex_man.load(s.package_man.get_unique(texture_path));
50 Image::Image(
int _x,
int _y,
unsigned w,
unsigned h,
const std::string& texture_path,
bool mipmap,
Widget* _parent)
55 options.
min_filter = Eng3D::TextureOptions::Filter::LINEAR_MIPMAP;
56 options.
mag_filter = Eng3D::TextureOptions::Filter::LINEAR;
57 options.
wrap_s = Eng3D::TextureOptions::Wrap::CLAMP_TO_EDGE;
58 options.
wrap_t = Eng3D::TextureOptions::Wrap::CLAMP_TO_EDGE;
61 current_texture = s.tex_man.load(s.package_man.get_unique(texture_path), options);
72 no_drop_options.min_filter = Eng3D::TextureOptions::Filter::LINEAR_MIPMAP;
73 no_drop_options.mag_filter = Eng3D::TextureOptions::Filter::LINEAR;
76 auto texture = s.tex_man.load(s.package_man.get_unique(texture_path), no_drop_options);
83 :
Image(_x, _y, w, h, tex, _parent)
static State & get_instance()
enum Eng3D::TextureOptions::Filter min_filter
enum Eng3D::TextureOptions::Wrap wrap_s
AspectImage(int x, int y, unsigned w, unsigned max_h, std::shared_ptr< Eng3D::Texture > tex, Widget *parent=nullptr)
Image widget, can display pictures or effects on the screen.
static Image * make_transparent(int x, int y, unsigned w, unsigned h, const std::string &tex_path, Widget *parent=nullptr)
Image(int x, int y, unsigned w, unsigned h, Widget *parent=nullptr)
WidgetType
The type of the widget, some widgets share types between them to keep simplicity.