opengl.light: Add a forge.
This commit is contained in:
@@ -1,6 +1,37 @@
|
||||
package body openGL.Light
|
||||
is
|
||||
|
||||
package body Forge
|
||||
is
|
||||
function to_Light (Id : in Id_t := null_Id;
|
||||
Kind : in Kind_t := Direct;
|
||||
is_On : in Boolean := True;
|
||||
Site : in openGL.Site := [0.0, 0.0, 1.0];
|
||||
Strength : in Intensity := 1.0;
|
||||
Color : in openGL.Color := (1.0, 1.0, 1.0);
|
||||
Attenuation : in Real := 0.0;
|
||||
ambient_Coefficient : in Real := 0.0;
|
||||
cone_Angle : in Degrees := 90.0;
|
||||
cone_Direction : in Vector_3 := [0.0, 0.0, -1.0]) return Item
|
||||
is
|
||||
begin
|
||||
return (Id => Id,
|
||||
Kind => Kind,
|
||||
On => is_On,
|
||||
Site => Site,
|
||||
Color => Color,
|
||||
Strength => Strength,
|
||||
Attenuation => Attenuation,
|
||||
ambient_Coefficient => ambient_Coefficient,
|
||||
cone_Angle => cone_Angle,
|
||||
cone_Direction => cone_Direction);
|
||||
end to_Light;
|
||||
|
||||
end Forge;
|
||||
|
||||
|
||||
|
||||
|
||||
function Id (Self : in Item) return light.Id_t
|
||||
is
|
||||
begin
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
with
|
||||
openGL.Palette;
|
||||
|
||||
|
||||
package openGL.Light
|
||||
package openGL.Light with Pure
|
||||
--
|
||||
-- Models a light.
|
||||
--
|
||||
@@ -11,15 +7,31 @@ is
|
||||
type Items is array (Positive range <>) of Item;
|
||||
|
||||
|
||||
--------------
|
||||
--- Attributes
|
||||
--
|
||||
type Id_t is new Natural;
|
||||
type Kind_t is (Diffuse, Direct);
|
||||
type Intensity is digits 5 range 0.0 .. 10.0;
|
||||
|
||||
null_Id : constant Id_t;
|
||||
|
||||
|
||||
package Forge
|
||||
is
|
||||
function to_Light (Id : in Id_t := null_Id;
|
||||
Kind : in Kind_t := Direct;
|
||||
is_On : in Boolean := True;
|
||||
Site : in openGL.Site := [0.0, 0.0, 1.0];
|
||||
Strength : in Intensity := 1.0;
|
||||
Color : in openGL.Color := (1.0, 1.0, 1.0);
|
||||
Attenuation : in Real := 0.0;
|
||||
ambient_Coefficient : in Real := 0.0;
|
||||
cone_Angle : in Degrees := 90.0;
|
||||
cone_Direction : in Vector_3 := [0.0, 0.0, -1.0]) return Item;
|
||||
end Forge;
|
||||
|
||||
|
||||
--------------
|
||||
--- Attributes
|
||||
--
|
||||
function Id (Self : in Item) return light.Id_t;
|
||||
procedure Id_is (Self : in out Item; Now : in light.Id_t);
|
||||
|
||||
@@ -60,8 +72,8 @@ private
|
||||
On : Boolean := True;
|
||||
Site : openGL.Site := [0.0, 0.0, 1.0]; -- The GL default.
|
||||
|
||||
Color : openGL.Color := (1.0, 1.0, 1.0);
|
||||
Strength : Intensity := 1.0;
|
||||
Color : openGL.Color := Palette.White;
|
||||
Attenuation : Real := 0.0;
|
||||
ambient_Coefficient : Real := 0.0;
|
||||
cone_Angle : Degrees := 90.0;
|
||||
|
||||
Reference in New Issue
Block a user