opengl.demos: Update code to use new openGL updates.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
with openGL.Model.texturing;
|
||||
with
|
||||
openGL.Light,
|
||||
openGL.Visual,
|
||||
openGL.Model.Box.lit_textured,
|
||||
openGL.texture_Set,
|
||||
openGL.Palette,
|
||||
openGL.Demo;
|
||||
|
||||
@@ -38,7 +40,8 @@ begin
|
||||
Upper => (texture_Name => the_Texture),
|
||||
Lower => (texture_Name => the_Texture),
|
||||
Left => (texture_Name => the_Texture),
|
||||
Right => (texture_Name => the_Texture)));
|
||||
Right => (texture_Name => the_Texture)),
|
||||
texture_Details => openGL.texture_Set.to_Details ([1 => the_Texture]));
|
||||
-- The Visual.
|
||||
--
|
||||
the_Visuals : constant openGL.Visual.views := (1 => new_Visual (the_Box.all'Access));
|
||||
|
||||
@@ -3,6 +3,7 @@ with
|
||||
openGL.Visual,
|
||||
openGL.Model.Sphere.lit_colored_textured,
|
||||
openGL.Model.Sphere.lit_colored,
|
||||
openGL.texture_Set,
|
||||
openGL.Palette,
|
||||
openGL.Demo;
|
||||
|
||||
@@ -29,8 +30,9 @@ begin
|
||||
-- The Models.
|
||||
--
|
||||
the_Ball_1_Model : constant Model.Sphere.lit_colored_textured.view
|
||||
:= openGL.Model.Sphere.lit_colored_textured.new_Sphere (Radius => 1.0,
|
||||
Image => the_Texture);
|
||||
:= openGL.Model.Sphere.lit_colored_textured.new_Sphere (Radius => 1.0,
|
||||
texture_Details => openGL.texture_Set.to_Details ([1 => the_Texture]),
|
||||
Image => the_Texture);
|
||||
the_Ball_2_Model : constant Model.Sphere.lit_colored.view
|
||||
:= openGL.Model.Sphere.lit_colored.new_Sphere (Radius => 1.0,
|
||||
Color => (light_Apricot, Opaque));
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
with
|
||||
openGL.Model.any,
|
||||
openGL.Visual,
|
||||
openGL.Light.directional,
|
||||
openGL.Light,
|
||||
openGL.texture_Set,
|
||||
openGL.Demo;
|
||||
|
||||
procedure launch_render_Asteroids
|
||||
@@ -16,24 +17,30 @@ is
|
||||
begin
|
||||
Demo.define ("openGL 'Render Asteroids' Demo");
|
||||
Demo.print_Usage ("Use space ' ' to cycle through models.");
|
||||
Demo.Camera.Position_is ((0.0, 0.0, 200.0),
|
||||
Demo.Camera.Position_is ([0.0, 0.0, 200.0],
|
||||
y_Rotation_from (to_Radians (0.0)));
|
||||
|
||||
declare
|
||||
the_Light : openGL.Light.directional.item := Demo.Renderer.Light (1);
|
||||
the_Light : openGL.Light.item := Demo.Renderer.new_Light;
|
||||
begin
|
||||
the_Light.Site_is ((5_000.0, 2_000.0, 5_000.0));
|
||||
Demo.Renderer.Light_is (1, the_Light);
|
||||
the_Light.Site_is ([5_000.0, 2_000.0, 5_000.0]);
|
||||
the_Light.ambient_Coefficient_is (0.05);
|
||||
Demo.Renderer.set (the_Light);
|
||||
end;
|
||||
|
||||
declare
|
||||
-- The models.
|
||||
--
|
||||
|
||||
-- gaspra_Model : constant openGL.Model.any.view := openGL.Model.any.new_Model (Model => to_Asset ("assets/gaspra.tab"),
|
||||
-- Texture => null_Asset,
|
||||
-- texture_Details => openGL.texture_Set.no_Details,
|
||||
-- Texture_is_lucid => False);
|
||||
gaspra_Model : constant openGL.Model.any.view := openGL.Model.any.new_Model (Model => to_Asset ("assets/gaspra.tab"),
|
||||
Texture => null_Asset,
|
||||
Texture => to_Asset ("./assets/opengl/texture/Face1.bmp"),
|
||||
texture_Details => openGL.texture_Set.to_Details ([1 => to_Asset ("./assets/opengl/texture/Face1.bmp")]),
|
||||
Texture_is_lucid => False);
|
||||
the_Models : constant openGL.Model.views := (1 => gaspra_Model.all'unchecked_Access);
|
||||
the_Models : constant openGL.Model.views := [1 => gaspra_Model.all'unchecked_Access];
|
||||
|
||||
-- The visuals.
|
||||
--
|
||||
@@ -79,7 +86,7 @@ begin
|
||||
|
||||
-- Render all visuals.
|
||||
--
|
||||
Demo.Camera.render ((1 => the_Visuals (Current)));
|
||||
Demo.Camera.render ([1 => the_Visuals (Current)]);
|
||||
|
||||
while not Demo.Camera.cull_Completed
|
||||
loop
|
||||
|
||||
@@ -2,6 +2,7 @@ with
|
||||
openGL.Visual,
|
||||
openGL.Model.Billboard. textured,
|
||||
openGL.Model.Billboard.colored_textured,
|
||||
openGL.texture_Set,
|
||||
openGL.Palette,
|
||||
openGL.Demo;
|
||||
|
||||
@@ -27,21 +28,23 @@ begin
|
||||
the_Billboard_Model : constant Model.Billboard.textured.view
|
||||
:= Model.Billboard.textured.forge.new_Billboard (--Scale => (1.0, 1.0, 1.0),
|
||||
Plane => Billboard.xy,
|
||||
Texture => the_Texture);
|
||||
Texture => the_Texture,
|
||||
texture_Details => openGL.texture_Set.to_Details ([1 => the_Texture]));
|
||||
|
||||
the_colored_Billboard_Model : constant Model.Billboard.colored_textured.view
|
||||
:= Model.Billboard.colored_textured.new_Billboard (--Scale => (1.0, 1.0, 1.0),
|
||||
Plane => Billboard.xy,
|
||||
Color => (Palette.Green, Opaque),
|
||||
Texture => the_Texture);
|
||||
Texture => the_Texture,
|
||||
texture_Details => openGL.texture_Set.to_Details ([1 => the_Texture]));
|
||||
-- The Sprites.
|
||||
--
|
||||
use openGL.Visual.Forge;
|
||||
|
||||
the_Sprites : constant openGL.Visual.views := [new_Visual ( the_Billboard_Model.all'Access),
|
||||
the_Visuals : constant openGL.Visual.views := [new_Visual ( the_Billboard_Model.all'Access),
|
||||
new_Visual (the_colored_Billboard_Model.all'Access)];
|
||||
begin
|
||||
the_Sprites (2).Site_is ([3.0, 0.0, 0.0]);
|
||||
the_Visuals (2).Site_is ([3.0, 0.0, 0.0]);
|
||||
|
||||
-- Main loop.
|
||||
--
|
||||
@@ -54,7 +57,7 @@ begin
|
||||
|
||||
-- Render the sprites.
|
||||
--
|
||||
Demo.Camera.render (the_Sprites);
|
||||
Demo.Camera.render (the_Visuals);
|
||||
|
||||
while not Demo.Camera.cull_Completed
|
||||
loop
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
with openGL.texture_Set;
|
||||
with
|
||||
openGL.Visual,
|
||||
|
||||
@@ -5,9 +6,11 @@ with
|
||||
openGL.Model.Box.textured,
|
||||
openGL.Model.Box.lit_colored_textured,
|
||||
|
||||
openGL.texture_Set,
|
||||
openGL.Palette,
|
||||
openGL.Demo;
|
||||
|
||||
|
||||
procedure launch_render_Boxes
|
||||
--
|
||||
-- Exercise the rendering of box models.
|
||||
@@ -58,7 +61,8 @@ begin
|
||||
Upper => (texture_Name => the_Texture),
|
||||
Lower => (texture_Name => the_Texture),
|
||||
Left => (texture_Name => the_Texture),
|
||||
Right => (texture_Name => the_Texture)]);
|
||||
Right => (texture_Name => the_Texture)],
|
||||
texture_Details => texture_Set.to_Details ([1 => the_Texture]));
|
||||
|
||||
-- The Visuals.
|
||||
--
|
||||
|
||||
@@ -33,7 +33,7 @@ begin
|
||||
the_Capsule_Model : constant Model.Capsule.lit_colored_textured.view
|
||||
:= Model.Capsule.lit_colored_textured.new_Capsule (Radius => 0.5,
|
||||
Height => 2.0,
|
||||
Color => (White, Opaque),
|
||||
Color => (Green, Opaque),
|
||||
Image => the_Texture);
|
||||
-- The Visuals.
|
||||
--
|
||||
@@ -42,6 +42,7 @@ begin
|
||||
the_Visuals : constant openGL.Visual.views := [1 => new_Visual (the_Capsule_Model.all'Access)];
|
||||
begin
|
||||
the_Light.Site_is ([0.0, 5.0, 10.0]);
|
||||
the_Light.ambient_Coefficient_is (0.05);
|
||||
Demo.Renderer.set (the_Light);
|
||||
|
||||
-- Main loop.
|
||||
|
||||
@@ -83,7 +83,7 @@ begin
|
||||
|
||||
the_Visuals (4).Site_is ([0.0, 0.0, -50.0]);
|
||||
|
||||
the_Visuals (1).Scale_is ([2.0, 2.0, 1.0]); -- Text visual.
|
||||
the_Visuals (1).Scale_is ([0.2, 0.2, 1.0]); -- Text visual.
|
||||
|
||||
-- Main loop.
|
||||
--
|
||||
|
||||
@@ -45,6 +45,9 @@ begin
|
||||
the_Visuals (i) := new_Visual (the_Models (i));
|
||||
end loop;
|
||||
|
||||
the_Visuals (1).Scale_is ([0.2, 0.2, 1.0]); -- Text visual.
|
||||
|
||||
|
||||
-- Main loop.
|
||||
--
|
||||
while not Demo.Done
|
||||
|
||||
@@ -3,8 +3,10 @@ with
|
||||
openGL.Palette,
|
||||
openGL.Font,
|
||||
openGL.Model.Text.lit_colored,
|
||||
openGL.texture_Set,
|
||||
openGL.Demo;
|
||||
|
||||
|
||||
procedure launch_render_Text
|
||||
--
|
||||
-- Render updated text.
|
||||
@@ -35,16 +37,20 @@ begin
|
||||
:= Model.Text.lit_colored.new_Text (Text => "Howdy",
|
||||
Font => the_font_Id,
|
||||
Color => (Red, Opaque),
|
||||
texture_Details => openGL.texture_Set.to_Details ([1 => openGL.to_Asset ("assets/texture/Face1.bmp")]),
|
||||
Centered => False);
|
||||
|
||||
-- The sprites.
|
||||
--
|
||||
use openGL.Visual.Forge;
|
||||
|
||||
the_Sprites : constant openGL.Visual.views := [1 => new_Visual (the_Text_Model.all'Access)];
|
||||
Current : constant Integer := the_Sprites'First;
|
||||
the_Visuals : constant openGL.Visual.views := [1 => new_Visual (the_Text_Model.all'Access)];
|
||||
Current : constant Integer := the_Visuals'First;
|
||||
|
||||
begin
|
||||
the_Visuals (1).Scale_is ([0.2, 0.2, 1.0]);
|
||||
|
||||
|
||||
-- Main loop.
|
||||
--
|
||||
while not Demo.Done
|
||||
@@ -78,7 +84,7 @@ begin
|
||||
|
||||
-- Render all sprites.
|
||||
--
|
||||
Demo.Camera.render ([1 => the_Sprites (Current)]);
|
||||
Demo.Camera.render ([1 => the_Visuals (Current)]);
|
||||
|
||||
while not Demo.Camera.cull_Completed
|
||||
loop
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
with openGL.texture_Set;
|
||||
with
|
||||
openGL.Camera,
|
||||
openGL.Palette,
|
||||
@@ -54,7 +55,8 @@ begin
|
||||
right => (colors => [others => (Red, Opaque)], texture_name => the_Face)]);
|
||||
|
||||
the_ball_Model : constant Model.Sphere.lit_colored_textured.view
|
||||
:= Model.Sphere.lit_colored_textured.new_Sphere (radius => 0.5);
|
||||
:= Model.Sphere.lit_colored_textured.new_Sphere (radius => 0.5,
|
||||
texture_Details => texture_Set.to_Details ([1 => the_Face]));
|
||||
|
||||
-- The Sprites.
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user