Files
lace/3-mid/opengl/source/lean/text/opengl-glyph-texture.adb
2022-07-31 17:34:54 +10:00

61 lines
2.0 KiB
Ada

package body openGL.Glyph.texture
is
---------
-- Forge
--
function to_Glyph (glyth_Slot : in freetype_c.FT_GlyphSlot.item;
texture_Id : in openGL.Texture.texture_Name;
xOffset, yOffset : in Integer;
Width, Height : in Integer) return Glyph.texture.item
is
Self : Glyph .texture.item;
Impl : constant GlyphImpl.texture.view := GlyphImpl.texture.new_GlyphImpl (glyth_Slot,
texture_Id,
xOffset, yOffset,
Width, Height);
begin
Self.define (Impl.all'Access);
return Self;
end to_Glyph;
function new_Glyph (glyth_Slot : in freetype_c.FT_GlyphSlot.item;
texture_Id : in openGL.Texture.texture_Name;
xOffset, yOffset : in Integer;
Width, Height : in Integer) return Glyph.texture.view
is
begin
return new Glyph.texture.item' (to_Glyph (glyth_Slot,
texture_Id,
xOffset, yOffset,
Width, Height));
end new_Glyph;
--------------
-- Attributes
--
function Quad (Self : in Item; Pen : in Vector_3) return GlyphImpl.texture.Quad_t
is
begin
return GlyphImpl.texture.view (Self.Impl).Quad (Pen);
end Quad;
--------------
-- Operations
--
overriding function render (Self : in Item; Pen : in Vector_3;
renderMode : in Integer) return Vector_3
is
begin
return GlyphImpl.texture.view (Self.Impl).renderImpl (Pen, renderMode);
end render;
end openGL.Glyph.texture;