gel.forge: Add 'Sides' and 'Fill' parameters to 'new_circle_Sprite'.

This commit is contained in:
Rod Kay
2024-01-09 17:00:29 +11:00
parent bd635b8dcb
commit 82aadaeabe
2 changed files with 24 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
with with
openGL.Model.text .lit_colored, openGL.Model.text .lit_colored,
openGL.Model.circle .colored,
openGL.Model.circle .lit_textured, openGL.Model.circle .lit_textured,
openGL.Model.sphere .lit_colored_textured, openGL.Model.sphere .lit_colored_textured,
@@ -22,8 +23,8 @@ with
openGL.Model.segment_line, openGL.Model.segment_line,
physics.Model, physics.Model,
gel.Window, gel.Window;
float_Math.Random; -- float_Math.Random;
package body gel.Forge package body gel.Forge
@@ -130,12 +131,13 @@ is
Bounce : in math.Real := 0.5; Bounce : in math.Real := 0.5;
is_Tangible : in Boolean := True; is_Tangible : in Boolean := True;
Radius : in math.Real := 0.5; Radius : in math.Real := 0.5;
Color : in openGL.Color := opengl.Palette.White; Color : in openGL.lucid_Color := (opengl.Palette.White, openGL.Opaque);
Sides : in Positive := 24;
Fill : in Boolean := True;
Texture : in openGL.asset_Name := openGL.null_Asset; Texture : in openGL.asset_Name := openGL.null_Asset;
user_Data : in any_user_Data_view := null) return gel.Sprite.view user_Data : in any_user_Data_view := null) return gel.Sprite.view
is is
use openGL; use openGL;
use type Vector_2;
the_graphics_Model : openGL.Model.view; the_graphics_Model : openGL.Model.view;
@@ -148,15 +150,21 @@ is
begin begin
if Texture = openGL.null_Asset if Texture = openGL.null_Asset
then then
the_graphics_Model := openGL.Model.sphere.lit_colored.new_Sphere (Radius, if Fill
Color => (Color, Opaque)).all'Access; then
the_graphics_Model := openGL.Model.sphere.lit_colored_textured.new_Sphere (Radius,
Color => Color,
Image => Texture).all'Access;
else
the_graphics_Model := openGL.Model.circle.colored.new_circle (Radius,
Color => Color,
Sides => Sides).all'Access;
end if;
else else
-- the_graphics_Model := openGL.Model.sphere.lit_colored_textured.new_Sphere (Radius,
-- Color => (Color, Opaque),
-- Image => Texture).all'Access;
the_graphics_Model := openGL.Model.circle.lit_textured.new_Circle (Radius, the_graphics_Model := openGL.Model.circle.lit_textured.new_Circle (Radius,
Face => (Fades => (1 => 0.0, others => <>), Face => (Fades => [1 => 0.0, others => <>],
Textures => (1 => Texture, others => <>), Textures => [1 => Texture, others => <>],
texture_Count => 1)).all'Access; texture_Count => 1)).all'Access;
end if; end if;
@@ -183,7 +191,6 @@ is
Texture : in openGL.asset_Name := openGL.null_Asset; Texture : in openGL.asset_Name := openGL.null_Asset;
user_Data : in any_user_Data_view := null) return gel.Sprite.view user_Data : in any_user_Data_view := null) return gel.Sprite.view
is is
use Math;
use type Geometry_2d.Sites, use type Geometry_2d.Sites,
openGL.asset_Name; openGL.asset_Name;
@@ -210,8 +217,8 @@ is
(Color, openGL.Opaque)).all'Access; (Color, openGL.Opaque)).all'Access;
else else
the_graphics_Model := openGL.Model.polygon.lit_textured.new_Polygon (openGL.Vector_2_array (Vertices), the_graphics_Model := openGL.Model.polygon.lit_textured.new_Polygon (openGL.Vector_2_array (Vertices),
Face => (Fades => (1 => 0.0, others => <>), Face => (Fades => [1 => 0.0, others => <>],
Textures => (1 => Texture, others => <>), Textures => [1 => Texture, others => <>],
texture_Count => 1)).all'Access; texture_Count => 1)).all'Access;
end if; end if;

View File

@@ -61,7 +61,9 @@ is
Bounce : in math.Real := 0.5; Bounce : in math.Real := 0.5;
is_Tangible : in Boolean := True; is_Tangible : in Boolean := True;
Radius : in math.Real := 0.5; Radius : in math.Real := 0.5;
Color : in openGL.Color := opengl.Palette.White; Color : in openGL.lucid_Color := (opengl.Palette.White, openGL.Opaque);
Sides : in Positive := 24;
Fill : in Boolean := True;
Texture : in openGL.asset_Name := openGL.null_Asset; Texture : in openGL.asset_Name := openGL.null_Asset;
user_Data : in any_user_Data_view := null) return gel.Sprite.view; user_Data : in any_user_Data_view := null) return gel.Sprite.view;