text
stringlengths
0
234
procedure Graphic_display (Self : in out Window'Class;
Extras : GLOBE_3D.Visual_array := GLOBE_3D.null_Visuals) is
use G3D;
begin
G3D.render (Self.Objects (1 .. Self.object_Count) & Extras, Self.Camera);
if Self.Show_Status then
Display_status (Self, Self.Average * 0.001);
end if;
end Graphic_display;
procedure Fill_screen (Self : in out Window'Class;
Extras : GLOBE_3D.Visual_array := GLOBE_3D.null_Visuals) is
procedure Display is
begin
Graphic_display (Self, Extras);
end Display;
package SAA is new GLOBE_3D.Software_Anti_Aliasing (Display);
begin
case Self.Smoothing is
when Software =>
SAA.Set_Quality (SAA.Q3);
for SAA_Phase in 1 .. SAA.Anti_Alias_phases loop
SAA.Display_with_Anti_Aliasing (SAA_Phase);
end loop;
when Hardware =>
Enable (MULTISAMPLE_ARB); -- (if not done yet)
-- ClearColor (0.0, 0.0, 0.0, 1.0); -- Specifies clear values for color buffer (s)
-- ClearColor (0.15, 0.4, 0.15, 1.0); -- Specifies clear values for color buffer (s) -- tbd : make clear color user - settable
ClearColor (0.0, 0.0, 0.0, 1.0); -- Specifies clear values for color buffer (s) -- tbd : make clear color user - settable
ClearAccum (0.0, 0.0, 0.0, 0.0); -- Specifies clear values for the accumulation buffer
Graphic_display (Self, Extras);
Flush;
when None =>
Graphic_display (Self, Extras);
Flush;
end case;
GLUT.SwapBuffers;
end Fill_screen;
procedure Reset_eye (Self : in out Window'Class) is
begin
Self.Camera.Clipper.Eye_Position := (0.0, 5.0, 4.0);
Self.Camera.World_Rotation := GLOBE_3D.Id_33;
end Reset_eye;
function Image (Date : Ada.Calendar.Time) return String;
-- Proxy for Ada 2005 Ada.Calendar.Formatting.Image
procedure Main_Operations (Self : access Window;
time_Step : G3D.Real;
Extras : GLOBE_3D.Visual_array := GLOBE_3D.null_Visuals) is
use G3D, G3D.REF, Game_Control;
elaps, time_now : Integer;
gx, gy : GL.Double; -- mouse movement since last call
seconds : GL.Double; -- seconds since last image
alpha_correct : Boolean;
attenu_t, attenu_r : Real;
begin
if not Self.all.is_Visible or else Self.all.is_Closed then
return;
end if;
enable_Viewport_and_Perspective (Self.all); -- nb : must be done prior to setting frustum planes (when using GL.frustums.current_Planes)
-- Control of lighting
--
-- self.frontal_light.position := (GL.Float (self.Camera.Clipper.eye_Position (0)),
-- GL.Float (self.Camera.Clipper.eye_Position (1)),
-- GL.Float (self.Camera.Clipper.eye_Position (2)),
-- 1.0);
-- G3D.Define (1, self.frontal_light);
for c in n1 .. n8 loop
if Self.all.game_command (c) then
Reverse_light_switch (1 + Command'Pos (c) - Command'Pos (n1));
end if;
end loop;
-- Display screen
--
Fill_screen (Self.all, Extras);