gel.demo: Use 'gel_sdl'.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -76,6 +76,7 @@ launch_math_testsuite
|
|||||||
launch_many_boxes_demo
|
launch_many_boxes_demo
|
||||||
launch_model_scaling
|
launch_model_scaling
|
||||||
launch_modeller_test
|
launch_modeller_test
|
||||||
|
launch_mouse_motion
|
||||||
launch_mouse_selection
|
launch_mouse_selection
|
||||||
launch_render_arrows
|
launch_render_arrows
|
||||||
launch_render_asteroids
|
launch_render_asteroids
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ with
|
|||||||
GL.Binding,
|
GL.Binding,
|
||||||
ada.Strings.fixed;
|
ada.Strings.fixed;
|
||||||
|
|
||||||
|
with ada.Text_IO;
|
||||||
|
|
||||||
|
|
||||||
package body openGL.Geometry.texturing
|
package body openGL.Geometry.texturing
|
||||||
is
|
is
|
||||||
@@ -185,6 +187,8 @@ is
|
|||||||
procedure enable_Textures (Self : in out Item)
|
procedure enable_Textures (Self : in out Item)
|
||||||
is
|
is
|
||||||
begin
|
begin
|
||||||
|
ada.Text_IO.put_Line (Self.Model'Image);
|
||||||
|
|
||||||
texturing.enable (for_Model => Self.Model.all'Access,
|
texturing.enable (for_Model => Self.Model.all'Access,
|
||||||
Uniforms => texture_Uniforms,
|
Uniforms => texture_Uniforms,
|
||||||
texture_Set => Self.texture_Set);
|
texture_Set => Self.texture_Set);
|
||||||
|
|||||||
@@ -6,17 +6,24 @@ set -e
|
|||||||
## Clean
|
## Clean
|
||||||
#
|
#
|
||||||
rm -fr ./dsa
|
rm -fr ./dsa
|
||||||
gprclean -r -P ../gel_demo.gpr -Xrestrictions=xgc -Xopengl_platform=glx -Xopengl_profile=lean
|
gprclean -r -P ../gel_demo.gpr -Xrestrictions=xgc -Xopengl_platform=egl -Xopengl_profile=lean
|
||||||
|
|
||||||
|
|
||||||
#########
|
#########
|
||||||
## Build
|
## Build
|
||||||
#
|
#
|
||||||
|
mkdir --parents dsa/x86_64-unknown-linux-gnu/obj
|
||||||
|
cp /usr/lib/gcc/x86_64-pc-linux-gnu/13.2.1/adalib/a-sttebu.ali \
|
||||||
|
dsa/x86_64-unknown-linux-gnu/obj
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
po_gnatdist -Xrestrictions=xgc -Xopengl_platform=glx -Xopengl_profile=lean -P demo_dsa.gpr simple_dsa.cfg
|
po_gnatdist -Xrestrictions=xgc -Xopengl_platform=egl -Xopengl_profile=lean -P demo_dsa.gpr simple_dsa.cfg
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
||||||
|
echo __________________________________________________ PHASE 2 _____________________________________________
|
||||||
|
|
||||||
cp dsa/x86_64-unknown-linux-gnu/obj/*.o dsa/x86_64-unknown-linux-gnu/partitions/simple_dsa/server_partition
|
cp dsa/x86_64-unknown-linux-gnu/obj/*.o dsa/x86_64-unknown-linux-gnu/partitions/simple_dsa/server_partition
|
||||||
cp dsa/x86_64-unknown-linux-gnu/obj/*.o dsa/x86_64-unknown-linux-gnu/partitions/simple_dsa/client_partition
|
cp dsa/x86_64-unknown-linux-gnu/obj/*.o dsa/x86_64-unknown-linux-gnu/partitions/simple_dsa/client_partition
|
||||||
|
|
||||||
po_gnatdist -Xrestrictions=xgc -Xopengl_platform=glx -Xopengl_profile=lean -P demo_dsa.gpr simple_dsa.cfg
|
po_gnatdist -Xrestrictions=xgc -Xopengl_platform=egl -Xopengl_profile=lean -P demo_dsa.gpr simple_dsa.cfg
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
|
||||||
"../gel_demo",
|
"../gel_demo",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project GEL_fused
|
project GEL_fused
|
||||||
is
|
is
|
||||||
for Source_Dirs use (".");
|
for Source_Dirs use (".");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
project gel_Demo
|
project gel_Demo
|
||||||
|
|||||||
@@ -3,10 +3,12 @@ with
|
|||||||
gel_demo_Server,
|
gel_demo_Server,
|
||||||
|
|
||||||
gel.Applet.client_World,
|
gel.Applet.client_World,
|
||||||
|
gel.Window.setup,
|
||||||
gel.Forge,
|
gel.Forge,
|
||||||
gel.Camera,
|
gel.Camera,
|
||||||
|
|
||||||
|
openGL.Light,
|
||||||
|
|
||||||
ada.Calendar,
|
ada.Calendar,
|
||||||
ada.Text_IO,
|
ada.Text_IO,
|
||||||
ada.Exceptions;
|
ada.Exceptions;
|
||||||
@@ -40,6 +42,17 @@ is
|
|||||||
the_Applet.client_Camera.Site_is ([0.0, 0.0, 20.0]);
|
the_Applet.client_Camera.Site_is ([0.0, 0.0, 20.0]);
|
||||||
the_Applet.enable_simple_Dolly (1);
|
the_Applet.enable_simple_Dolly (1);
|
||||||
|
|
||||||
|
|
||||||
|
-- Set the lights position.
|
||||||
|
--
|
||||||
|
declare
|
||||||
|
Light : openGL.Light.item := the_Applet.Renderer.new_Light;
|
||||||
|
begin
|
||||||
|
Light.Site_is ([0.0, -1000.0, 0.0]);
|
||||||
|
the_Applet.Renderer.set (Light);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
next_render_Time := ada.Calendar.clock;
|
next_render_Time := ada.Calendar.clock;
|
||||||
|
|
||||||
-- Begin processing.
|
-- Begin processing.
|
||||||
|
|||||||
@@ -1,5 +1,34 @@
|
|||||||
#version 140
|
#version 140
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Texturing snippet.
|
||||||
|
//
|
||||||
|
uniform int texture_Count;
|
||||||
|
uniform sampler2D Textures [32];
|
||||||
|
uniform float Fade [32];
|
||||||
|
|
||||||
|
vec4
|
||||||
|
apply_Texturing (vec2 Coords)
|
||||||
|
{
|
||||||
|
vec4 Color = vec4 (0);
|
||||||
|
|
||||||
|
for (int i = 0; i < texture_Count; ++i)
|
||||||
|
{
|
||||||
|
Color.rgb += texture (Textures [i], Coords).rgb
|
||||||
|
* texture (Textures [i], Coords).a
|
||||||
|
* (1.0 - Fade [i]);
|
||||||
|
|
||||||
|
Color.a = max (Color.a, texture (Textures [i],
|
||||||
|
Coords).a);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct light
|
struct light
|
||||||
{
|
{
|
||||||
vec4 Site;
|
vec4 Site;
|
||||||
@@ -15,7 +44,7 @@ uniform mat4 model_Transform;
|
|||||||
uniform mat3 inverse_model_Rotation;
|
uniform mat3 inverse_model_Rotation;
|
||||||
uniform vec3 camera_Site;
|
uniform vec3 camera_Site;
|
||||||
uniform vec3 specular_Color; // The materials specular color.
|
uniform vec3 specular_Color; // The materials specular color.
|
||||||
uniform sampler2D Texture;
|
//uniform sampler2D Texture;
|
||||||
uniform int light_Count;
|
uniform int light_Count;
|
||||||
uniform light Lights [10];
|
uniform light Lights [10];
|
||||||
|
|
||||||
@@ -95,8 +124,8 @@ apply_Light (light Light,
|
|||||||
void
|
void
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
vec4 texture_Color = texture (Texture, frag_Coords);
|
vec4 texture_Color = apply_Texturing (frag_Coords); // texture (Texture, frag_Coords);
|
||||||
|
|
||||||
vec4 surface_Color = vec4 (mix (texture_Color.rgb,
|
vec4 surface_Color = vec4 (mix (texture_Color.rgb,
|
||||||
frag_Color .rgb,
|
frag_Color .rgb,
|
||||||
0.5),
|
0.5),
|
||||||
|
|||||||
@@ -1,5 +1,32 @@
|
|||||||
#version 140
|
#version 140
|
||||||
|
|
||||||
|
|
||||||
|
// Texturing snippet.
|
||||||
|
//
|
||||||
|
uniform int texture_Count;
|
||||||
|
uniform sampler2D Textures [32];
|
||||||
|
uniform float Fade [32];
|
||||||
|
|
||||||
|
vec4
|
||||||
|
apply_Texturing (vec2 Coords)
|
||||||
|
{
|
||||||
|
vec4 Color = vec4 (0);
|
||||||
|
|
||||||
|
for (int i = 0; i < texture_Count; ++i)
|
||||||
|
{
|
||||||
|
Color.rgb += texture (Textures [i], Coords).rgb
|
||||||
|
* texture (Textures [i], Coords).a
|
||||||
|
* (1.0 - Fade [i]);
|
||||||
|
|
||||||
|
Color.a = max (Color.a, texture (Textures [i],
|
||||||
|
Coords).a);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct light
|
struct light
|
||||||
{
|
{
|
||||||
vec4 Site;
|
vec4 Site;
|
||||||
@@ -15,7 +42,7 @@ uniform mat4 model_Transform;
|
|||||||
uniform mat3 inverse_model_Rotation;
|
uniform mat3 inverse_model_Rotation;
|
||||||
uniform vec3 camera_Site;
|
uniform vec3 camera_Site;
|
||||||
uniform vec3 specular_Color; // The materials specular color.
|
uniform vec3 specular_Color; // The materials specular color.
|
||||||
uniform sampler2D Texture;
|
//uniform sampler2D Texture;
|
||||||
uniform int light_Count;
|
uniform int light_Count;
|
||||||
uniform light Lights [10];
|
uniform light Lights [10];
|
||||||
|
|
||||||
@@ -29,6 +56,8 @@ in float frag_Shine;
|
|||||||
out vec4 final_Color;
|
out vec4 final_Color;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vec3
|
vec3
|
||||||
apply_Light (light Light,
|
apply_Light (light Light,
|
||||||
vec3 surface_Color,
|
vec3 surface_Color,
|
||||||
@@ -92,16 +121,15 @@ apply_Light (light Light,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
vec3 surface_Site = vec3 ( model_Transform
|
vec3 surface_Site = vec3 ( model_Transform
|
||||||
* vec4 (frag_Site, 1));
|
* vec4 (frag_Site, 1));
|
||||||
|
vec4 surface_Color = mix (apply_Texturing (frag_Coords),
|
||||||
vec4 surface_Color = mix (texture (Texture, frag_Coords),
|
|
||||||
frag_Color,
|
frag_Color,
|
||||||
0.5);
|
0.5);
|
||||||
|
|
||||||
vec3 Surface_to_Camera = normalize (camera_Site - surface_Site);
|
vec3 Surface_to_Camera = normalize (camera_Site - surface_Site);
|
||||||
vec3 Normal = normalize (frag_Normal * inverse_model_Rotation);
|
vec3 Normal = normalize (frag_Normal * inverse_model_Rotation);
|
||||||
|
|
||||||
@@ -118,8 +146,7 @@ main()
|
|||||||
Surface_to_Camera);
|
Surface_to_Camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 Gamma = vec3 (1.0 / 2.2);
|
vec3 Gamma = vec3 (1.0 / 2.2);
|
||||||
|
|
||||||
final_Color = vec4 (pow (linear_Color, // Final color (after gamma correction).
|
final_Color = vec4 (pow (linear_Color, // Final color (after gamma correction).
|
||||||
Gamma),
|
Gamma),
|
||||||
surface_Color.a);
|
surface_Color.a);
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#version 140
|
// Include 'version.header'.
|
||||||
|
// Include 'texturing.frag'.
|
||||||
|
|
||||||
|
|
||||||
struct light
|
struct light
|
||||||
{
|
{
|
||||||
@@ -15,7 +17,7 @@ uniform mat4 model_Transform;
|
|||||||
uniform mat3 inverse_model_Rotation;
|
uniform mat3 inverse_model_Rotation;
|
||||||
uniform vec3 camera_Site;
|
uniform vec3 camera_Site;
|
||||||
uniform vec3 specular_Color; // The materials specular color.
|
uniform vec3 specular_Color; // The materials specular color.
|
||||||
uniform sampler2D Texture;
|
|
||||||
uniform int light_Count;
|
uniform int light_Count;
|
||||||
uniform light Lights [10];
|
uniform light Lights [10];
|
||||||
|
|
||||||
@@ -28,6 +30,8 @@ in float frag_Shine;
|
|||||||
out vec4 final_Color;
|
out vec4 final_Color;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vec3
|
vec3
|
||||||
apply_Light (light Light,
|
apply_Light (light Light,
|
||||||
vec3 surface_Color,
|
vec3 surface_Color,
|
||||||
@@ -91,18 +95,16 @@ apply_Light (light Light,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
vec3 surface_Site = vec3 ( model_Transform
|
vec3 surface_Site = vec3 ( model_Transform
|
||||||
* vec4 (frag_Site, 1));
|
* vec4 (frag_Site, 1));
|
||||||
|
vec4 surface_Color = apply_Texturing (frag_Coords);
|
||||||
vec4 surface_Color = texture (Texture, frag_Coords);
|
|
||||||
|
|
||||||
vec3 Surface_to_Camera = normalize (camera_Site - surface_Site);
|
vec3 Surface_to_Camera = normalize (camera_Site - surface_Site);
|
||||||
vec3 Normal = normalize ( frag_Normal
|
vec3 Normal = normalize ( frag_Normal
|
||||||
* inverse_model_Rotation);
|
* inverse_model_Rotation);
|
||||||
|
|
||||||
// Combine color from all the lights.
|
// Combine color from all the lights.
|
||||||
//
|
//
|
||||||
vec3 linear_Color = vec3 (0);
|
vec3 linear_Color = vec3 (0);
|
||||||
@@ -116,8 +118,7 @@ main()
|
|||||||
Surface_to_Camera);
|
Surface_to_Camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 Gamma = vec3 (1.0 / 2.2);
|
vec3 Gamma = vec3 (1.0 / 2.2);
|
||||||
|
|
||||||
final_Color = vec4 (pow (linear_Color, // Final color (after gamma correction).
|
final_Color = vec4 (pow (linear_Color, // Final color (after gamma correction).
|
||||||
Gamma),
|
Gamma),
|
||||||
surface_Color.a);
|
surface_Color.a);
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
#version 140
|
// Include 'version.header'.
|
||||||
|
// Include 'texturing.frag'.
|
||||||
|
|
||||||
uniform sampler2D sTexture;
|
in vec2 frag_Coords;
|
||||||
|
out vec4 final_Color;
|
||||||
varying vec4 vColor;
|
|
||||||
varying vec2 vCoords;
|
|
||||||
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
gl_FragColor = texture2D (sTexture, vCoords) * vColor; // Modulate light color with texture.
|
final_Color = apply_Texturing (frag_Coords);
|
||||||
}
|
}
|
||||||
@@ -1,25 +1,16 @@
|
|||||||
#version 140
|
#version 140
|
||||||
|
|
||||||
uniform mat4 mvp_Transform;
|
uniform mat4 mvp_Transform;
|
||||||
uniform vec3 Scale;
|
uniform vec3 Scale;
|
||||||
|
|
||||||
|
in vec3 Site;
|
||||||
|
in vec2 Coords;
|
||||||
|
|
||||||
attribute vec3 Site;
|
out vec2 frag_Coords;
|
||||||
attribute vec2 Coords;
|
|
||||||
|
|
||||||
|
|
||||||
varying vec4 vColor;
|
|
||||||
varying vec2 vCoords;
|
|
||||||
|
|
||||||
|
|
||||||
const float c_zero = 0.0;
|
|
||||||
const float c_one = 1.0;
|
|
||||||
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
frag_Coords = Coords;
|
||||||
gl_Position = mvp_Transform * vec4 (Site * Scale, 1.0);
|
gl_Position = mvp_Transform * vec4 (Site * Scale, 1.0);
|
||||||
|
|
||||||
vColor = vec4 (1.0, 1.0, 1.0, 1.0);
|
|
||||||
vCoords = Coords;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
with
|
with
|
||||||
gel.Window.setup,
|
gel.Window.setup,
|
||||||
gel.Applet.gui_and_sim_world,
|
gel.Applet.gui_world,
|
||||||
gel.Forge,
|
gel.Forge,
|
||||||
gel.Sprite,
|
gel.Sprite,
|
||||||
|
|
||||||
@@ -28,10 +28,10 @@ is
|
|||||||
openGL.Model.box,
|
openGL.Model.box,
|
||||||
opengl.Palette;
|
opengl.Palette;
|
||||||
|
|
||||||
the_Applet : constant gel.Applet.gui_and_sim_world.view := gel.Forge.new_gui_and_sim_Applet ("mixed Shapes", 1536, 864);
|
the_Applet : constant gel.Applet.gui_world.view := gel.Forge.new_gui_Applet ("mixed Shapes", 1536, 864);
|
||||||
|
|
||||||
|
|
||||||
text_line_Site : gel.Math.Vector_3 := (-10.0, 50.0, -60.0);
|
text_line_Site : gel.Math.Vector_3 := [-10.0, 50.0, -60.0];
|
||||||
|
|
||||||
procedure put_Line (Message : in String)
|
procedure put_Line (Message : in String)
|
||||||
is
|
is
|
||||||
@@ -94,8 +94,8 @@ is
|
|||||||
the_terrain_physics_Model : constant physics.Model.view
|
the_terrain_physics_Model : constant physics.Model.view
|
||||||
:= physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.heightfield,
|
:= physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.heightfield,
|
||||||
Heights => new physics.Heightfield' (to_Heightfield (gl_Heights.all)),
|
Heights => new physics.Heightfield' (to_Heightfield (gl_Heights.all)),
|
||||||
height_Range => (0.0, 200.0)),
|
height_Range => [0.0, 200.0]),
|
||||||
Scale => (hs, 1.0, hs));
|
Scale => [hs, 1.0, hs]);
|
||||||
the_Terrain : constant gel.Sprite.view
|
the_Terrain : constant gel.Sprite.view
|
||||||
:= gel.Sprite.forge.new_Sprite ("demo.Terrain",
|
:= gel.Sprite.forge.new_Sprite ("demo.Terrain",
|
||||||
the_Applet.gui_World.all'Access,
|
the_Applet.gui_World.all'Access,
|
||||||
@@ -105,15 +105,14 @@ is
|
|||||||
begin
|
begin
|
||||||
-- Setup the applet.
|
-- Setup the applet.
|
||||||
--
|
--
|
||||||
the_Applet.gui_Camera.Site_is ((0.0, 4.0, 30.0)); -- Position the camera.
|
the_Applet.gui_Camera.Site_is ([0.0, 4.0, 30.0]); -- Position the camera.
|
||||||
the_Applet.sim_Camera.Site_is ((0.0, 4.0, 30.0)); -- Position the camera.
|
|
||||||
|
|
||||||
the_Applet.enable_simple_Dolly (in_World => the_Applet.sim_World.Id); -- Enable user camera control via keyboard.
|
the_Applet.enable_simple_Dolly (in_World => the_Applet.gui_World.Id); -- Enable user camera control via keyboard.
|
||||||
the_Applet.Dolly.Speed_is (0.1);
|
the_Applet.Dolly.Speed_is (0.1);
|
||||||
|
|
||||||
the_Applet.Renderer.Background_is (sky_Blue);
|
the_Applet.Renderer.Background_is (sky_Blue);
|
||||||
|
|
||||||
the_Applet.sim_World.Gravity_is ((0.0, -9.8, 0.0));
|
the_Applet.gui_World.Gravity_is ([0.0, -9.8, 0.0]);
|
||||||
|
|
||||||
|
|
||||||
-- Camera controls text.
|
-- Camera controls text.
|
||||||
@@ -131,7 +130,7 @@ begin
|
|||||||
Light : openGL.Light.item := the_Applet.Renderer.new_Light;
|
Light : openGL.Light.item := the_Applet.Renderer.new_Light;
|
||||||
begin
|
begin
|
||||||
Light.Kind_is (Diffuse);
|
Light.Kind_is (Diffuse);
|
||||||
Light.Site_is ((0.0, 100.0, 100.0));
|
Light.Site_is ([0.0, 100.0, 100.0]);
|
||||||
Light.ambient_Coefficient_is (0.2);
|
Light.ambient_Coefficient_is (0.2);
|
||||||
|
|
||||||
the_Applet.Renderer.set (Light);
|
the_Applet.Renderer.set (Light);
|
||||||
@@ -140,7 +139,7 @@ begin
|
|||||||
|
|
||||||
-- Terrain.
|
-- Terrain.
|
||||||
--
|
--
|
||||||
the_Applet.sim_World.add (the_Terrain); -- Add the terrain.
|
the_Applet.gui_World.add (the_Terrain); -- Add the terrain.
|
||||||
|
|
||||||
|
|
||||||
-- Add several sprites of each shape.
|
-- Add several sprites of each shape.
|
||||||
@@ -151,13 +150,13 @@ begin
|
|||||||
-- Box
|
-- Box
|
||||||
--
|
--
|
||||||
the_box_Model : constant openGL.Model.box.colored.view
|
the_box_Model : constant openGL.Model.box.colored.view
|
||||||
:= openGL.Model.box.colored.new_Box (Size => (1.0, 1.0, 1.0),
|
:= openGL.Model.box.colored.new_Box (Size => [1.0, 1.0, 1.0],
|
||||||
Faces => (Front => (Colors => (others => (Red, Opaque))),
|
Faces => [Front => (Colors => [others => (Red, Opaque)]),
|
||||||
Rear => (Colors => (others => (Green, Opaque))),
|
Rear => (Colors => [others => (Green, Opaque)]),
|
||||||
Upper => (Colors => (others => (Violet, Opaque))),
|
Upper => (Colors => [others => (Violet, Opaque)]),
|
||||||
Lower => (Colors => (others => (Yellow, Opaque))),
|
Lower => (Colors => [others => (Yellow, Opaque)]),
|
||||||
Left => (Colors => (others => (Cyan, Opaque))),
|
Left => (Colors => [others => (Cyan, Opaque)]),
|
||||||
Right => (Colors => (others => (Magenta, Opaque)))));
|
Right => (Colors => [others => (Magenta, Opaque)])]);
|
||||||
the_box_physics_Model : constant physics.Model.view
|
the_box_physics_Model : constant physics.Model.view
|
||||||
:= physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.Cube,
|
:= physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.Cube,
|
||||||
half_Extents => the_box_Model.Size / 2.0),
|
half_Extents => the_box_Model.Size / 2.0),
|
||||||
@@ -232,8 +231,8 @@ begin
|
|||||||
|
|
||||||
the_multi_Sphere_physics_Model : constant physics.Model.view
|
the_multi_Sphere_physics_Model : constant physics.Model.view
|
||||||
:= physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.multi_Sphere,
|
:= physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.multi_Sphere,
|
||||||
Sites => new physics.Vector_3_array' ((-0.5, 0.0, 0.0),
|
Sites => new physics.Vector_3_array' ([-0.5, 0.0, 0.0],
|
||||||
( 0.5, 0.0, 0.0)),
|
[ 0.5, 0.0, 0.0]),
|
||||||
Radii => new gel.math.Vector' (1 => 0.5,
|
Radii => new gel.math.Vector' (1 => 0.5,
|
||||||
2 => 0.5)),
|
2 => 0.5)),
|
||||||
Mass => 1.0);
|
Mass => 1.0);
|
||||||
@@ -249,41 +248,41 @@ begin
|
|||||||
--
|
--
|
||||||
s : constant := 0.5;
|
s : constant := 0.5;
|
||||||
the_hull_Model : constant openGL.Model.box.colored.view
|
the_hull_Model : constant openGL.Model.box.colored.view
|
||||||
:= openGL.Model.box.colored.new_Box (Size => (s * 2.0, s * 2.0, s * 2.0),
|
:= openGL.Model.box.colored.new_Box (Size => [s * 2.0, s * 2.0, s * 2.0],
|
||||||
Faces => (others => (others => (others => (Palette.random_Color, Opaque)))));
|
Faces => [others => (others => [others => (Palette.random_Color, Opaque)])]);
|
||||||
|
|
||||||
the_hull_physics_Model : constant physics.Model.view
|
the_hull_physics_Model : constant physics.Model.view
|
||||||
:= physics.Model.forge.new_physics_Model (shape_Info => (Kind => physics.Model.hull,
|
:= physics.Model.forge.new_physics_Model (Mass => 1.0,
|
||||||
Points => new physics.Vector_3_array' ((-s, -s, s),
|
shape_Info => (Kind => physics.Model.hull,
|
||||||
( s, -s, s),
|
Points => new physics.Vector_3_array' ([-s, -s, s],
|
||||||
( s, s, s),
|
[ s, -s, s],
|
||||||
(-s, s, s),
|
[ s, s, s],
|
||||||
|
[-s, s, s],
|
||||||
|
|
||||||
(-s, -s, -s),
|
[-s, -s, -s],
|
||||||
( s, -s, -s),
|
[ s, -s, -s],
|
||||||
( s, s, -s),
|
[ s, s, -s],
|
||||||
(-s, s, -s))),
|
[-s, s, -s])));
|
||||||
Mass => 1.0);
|
the_Hull : constant gel.Sprite.view
|
||||||
the_Hull : constant gel.Sprite.view
|
|
||||||
:= gel.Sprite.forge.new_Sprite ("demo.Hull",
|
:= gel.Sprite.forge.new_Sprite ("demo.Hull",
|
||||||
the_Applet.gui_World.all'Access,
|
the_Applet.gui_World.all'Access,
|
||||||
Origin_3D,
|
Origin_3D,
|
||||||
the_hull_Model.all'Access,
|
the_hull_Model.all'Access,
|
||||||
the_hull_physics_Model);
|
the_hull_physics_Model);
|
||||||
begin
|
begin
|
||||||
the_Applet.sim_World.add (the_Ball);
|
the_Applet.gui_World.add (the_Ball);
|
||||||
the_Applet.sim_World.add (the_Box);
|
the_Applet.gui_World.add (the_Box);
|
||||||
the_Applet.sim_World.add (the_Cone);
|
the_Applet.gui_World.add (the_Cone);
|
||||||
the_Applet.sim_World.add (the_Capsule);
|
the_Applet.gui_World.add (the_Capsule);
|
||||||
the_Applet.sim_World.add (the_multi_Sphere);
|
the_Applet.gui_World.add (the_multi_Sphere);
|
||||||
the_Applet.sim_World.add (the_Hull);
|
the_Applet.gui_World.add (the_Hull);
|
||||||
|
|
||||||
the_Ball .Site_is (( x, y, 0.0));
|
the_Ball .Site_is ([ x, y, 0.0]);
|
||||||
the_Box .Site_is (( 0.0, y, -2.5));
|
the_Box .Site_is ([ 0.0, y, -2.5]);
|
||||||
the_Cone .Site_is (( 0.0, y, 0.0));
|
the_Cone .Site_is ([ 0.0, y, 0.0]);
|
||||||
the_Capsule .Site_is (( 0.0 + X, y, 0.0 + x));
|
the_Capsule .Site_is ([ 0.0 + X, y, 0.0 + x]);
|
||||||
the_multi_Sphere.Site_is ((-4.0, y, 4.4));
|
the_multi_Sphere.Site_is ([-4.0, y, 4.4]);
|
||||||
the_Hull .Site_is (( 4.0, y, 4.4));
|
the_Hull .Site_is ([ 4.0, y, 4.4]);
|
||||||
|
|
||||||
x := x + 2.0;
|
x := x + 2.0;
|
||||||
y := y + 2.0;
|
y := y + 2.0;
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project Hello_SDL_GEL
|
project Hello_SDL_GEL
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project opengl_Model
|
project opengl_Model
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project Mouse_Motion
|
project Mouse_Motion
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project Mouse_selection
|
project Mouse_selection
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
with "gel";
|
with
|
||||||
|
"gel_sdl";
|
||||||
|
|
||||||
|
|
||||||
project Human_Model_V1
|
project Human_Model_V1
|
||||||
@@ -8,15 +9,19 @@ is
|
|||||||
for Exec_Dir use ".";
|
for Exec_Dir use ".";
|
||||||
for Main use ("launch_human_model_v1.adb");
|
for Main use ("launch_human_model_v1.adb");
|
||||||
for Languages use ("Ada");
|
for Languages use ("Ada");
|
||||||
|
|
||||||
type Os_Type is
|
type Os_Type is
|
||||||
("Windows_NT", "Linux", "MacOSX");
|
("Windows_NT", "Linux", "MacOSX");
|
||||||
Os : Os_Type := external ("OS");
|
Os : Os_Type := external ("OS");
|
||||||
|
|
||||||
type Restrictions is
|
type Restrictions is
|
||||||
("xgc", "ravenscar");
|
("xgc", "ravenscar");
|
||||||
Restrictions : Restrictions := external ("restrictions");
|
Restrictions : Restrictions := external ("restrictions");
|
||||||
|
|
||||||
type Platform is
|
type Platform is
|
||||||
("egl", "glx");
|
("egl", "glx");
|
||||||
Opengl_Platform : Platform := external ("opengl_platform");
|
Opengl_Platform : Platform := external ("opengl_platform");
|
||||||
|
|
||||||
type Profile is
|
type Profile is
|
||||||
("safe", "lean", "desk");
|
("safe", "lean", "desk");
|
||||||
Opengl_Profile : Profile := external ("opengl_profile");
|
Opengl_Profile : Profile := external ("opengl_profile");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project box_rig_1_bone_Demo
|
project box_rig_1_bone_Demo
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project rig_Demo
|
project rig_Demo
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project human_rig_Demo
|
project human_rig_Demo
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project Chains_2D
|
project Chains_2D
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -14,4 +15,4 @@ is
|
|||||||
package Compiler renames Lace_shared.Compiler;
|
package Compiler renames Lace_shared.Compiler;
|
||||||
package Binder renames Lace_shared.Binder;
|
package Binder renames Lace_shared.Binder;
|
||||||
|
|
||||||
end Chains_2D;
|
end Chains_2D;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project Drop_Ball_On_Box
|
project Drop_Ball_On_Box
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -19,4 +20,4 @@ is
|
|||||||
for Linker_Options use ("-g", "-lGL", "-lGLU", "-lglut", "-lSDL2");
|
for Linker_Options use ("-g", "-lGL", "-lGLU", "-lglut", "-lSDL2");
|
||||||
end Linker;
|
end Linker;
|
||||||
|
|
||||||
end Drop_Ball_On_Box;
|
end Drop_Ball_On_Box;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project drop_Box_on_Box
|
project drop_Box_on_Box
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -14,4 +15,4 @@ is
|
|||||||
package Compiler renames Lace_shared.Compiler;
|
package Compiler renames Lace_shared.Compiler;
|
||||||
package Binder renames Lace_shared.Binder;
|
package Binder renames Lace_shared.Binder;
|
||||||
|
|
||||||
end drop_Box_on_Box;
|
end drop_Box_on_Box;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project hinged_Box
|
project hinged_Box
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -14,4 +15,4 @@ is
|
|||||||
package Compiler renames Lace_shared.Compiler;
|
package Compiler renames Lace_shared.Compiler;
|
||||||
package Binder renames Lace_shared.Binder;
|
package Binder renames Lace_shared.Binder;
|
||||||
|
|
||||||
end hinged_Box;
|
end hinged_Box;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project mixed_Joints
|
project mixed_Joints
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -14,4 +15,4 @@ is
|
|||||||
package Compiler renames Lace_shared.Compiler;
|
package Compiler renames Lace_shared.Compiler;
|
||||||
package Binder renames Lace_shared.Binder;
|
package Binder renames Lace_shared.Binder;
|
||||||
|
|
||||||
end mixed_Joints;
|
end mixed_Joints;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project mixed_Joints_2D
|
project mixed_Joints_2D
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -14,4 +15,4 @@ is
|
|||||||
package Compiler renames Lace_shared.Compiler;
|
package Compiler renames Lace_shared.Compiler;
|
||||||
package Binder renames Lace_shared.Binder;
|
package Binder renames Lace_shared.Binder;
|
||||||
|
|
||||||
end mixed_Joints_2D;
|
end mixed_Joints_2D;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project mixed_Shapes
|
project mixed_Shapes
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -14,4 +15,4 @@ is
|
|||||||
package Compiler renames Lace_shared.Compiler;
|
package Compiler renames Lace_shared.Compiler;
|
||||||
package Binder renames Lace_shared.Binder;
|
package Binder renames Lace_shared.Binder;
|
||||||
|
|
||||||
end mixed_Shapes;
|
end mixed_Shapes;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project text_sprite_Demo
|
project text_sprite_Demo
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -14,4 +15,4 @@ is
|
|||||||
package Compiler renames Lace_shared.Compiler;
|
package Compiler renames Lace_shared.Compiler;
|
||||||
package Binder renames Lace_shared.Binder;
|
package Binder renames Lace_shared.Binder;
|
||||||
|
|
||||||
end text_sprite_Demo;
|
end text_sprite_Demo;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project add_rid
|
project add_rid
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -14,4 +15,4 @@ is
|
|||||||
package Compiler renames Lace_shared.Compiler;
|
package Compiler renames Lace_shared.Compiler;
|
||||||
package Binder renames Lace_shared.Binder;
|
package Binder renames Lace_shared.Binder;
|
||||||
|
|
||||||
end add_rid;
|
end add_rid;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project add_rid_Sprite_Test
|
project add_rid_Sprite_Test
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -18,4 +19,4 @@ is
|
|||||||
for Default_Switches ("ada") use ("-lGL", "-lX11", "-lexpat", "-g");
|
for Default_Switches ("ada") use ("-lGL", "-lX11", "-lexpat", "-g");
|
||||||
end Linker;
|
end Linker;
|
||||||
|
|
||||||
end add_rid_Sprite_Test;
|
end add_rid_Sprite_Test;
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
with
|
with
|
||||||
"gel",
|
"gel_sdl",
|
||||||
"lace_shared";
|
"lace_shared";
|
||||||
|
|
||||||
|
|
||||||
project pong_Tute
|
project pong_Tute
|
||||||
is
|
is
|
||||||
for Object_Dir use "build";
|
for Object_Dir use "build";
|
||||||
@@ -14,4 +15,4 @@ is
|
|||||||
package Compiler renames Lace_shared.Compiler;
|
package Compiler renames Lace_shared.Compiler;
|
||||||
package Binder renames Lace_shared.Binder;
|
package Binder renames Lace_shared.Binder;
|
||||||
|
|
||||||
end pong_Tute;
|
end pong_Tute;
|
||||||
Reference in New Issue
Block a user