text stringlengths 0 234 |
|---|
Clear_modes; |
Prepare_default_lighting (Self, 0.9); |
if Self.foggy then |
Enable (FOG); |
Fogfv (FOG_COLOR, fog_colour (0)'Unchecked_Access); |
Fogf (FOG_DENSITY, 0.02); |
end if; |
Reset_for_3D (Self); |
if Self.Smoothing = Hardware then |
Enable (MULTISAMPLE_ARB); |
Enable (SAMPLE_COVERAGE_ARB); -- Hope it helps switching on the AA .. . |
end if; |
end Start_GLs; |
procedure Initialize is |
begin |
GLUT.Init; |
GLUT.SetOption (GLUT.GLUT_RENDERING_CONTEXT, GLUT.GLUT_USE_CURRENT_CONTEXT); |
GLUT.SetOption (GLUT.ACTION_ON_WINDOW_CLOSE, ACTION_CONTINUE_EXECUTION); |
end Initialize; |
procedure Define (Self : in out Window) is |
begin |
Start_GLUTs (Self); -- Initialize the GLUT things |
Start_GLs (Self); -- Initialize the (Open)GL things |
Reset_eye (Self); |
Freshen (Self, 0.02); -- do an initial freshen, to initialise Camera, etc. |
end Define; |
procedure Destroy (Self : in out Window) is |
begin |
DestroyWindow (Self.glut_Window); |
end Destroy; |
overriding procedure Enable (Self : in out Window) is |
begin |
GLUT.SetWindow (Self.glut_Window); |
-- opengl.glx.glXMakeCurrent; |
end Enable; |
overriding procedure Freshen (Self : in out Window; |
time_Step : G3D.Real; |
Extras : GLOBE_3D.Visual_array := GLOBE_3D.null_Visuals) is |
begin |
Enable (Self); -- for multi - window operation. |
Main_Operations (Self'Access, time_Step, Extras); |
end Freshen; |
-- traits |
-- |
function Smoothing (Self : Window) return Smoothing_method is (Self.Smoothing); |
procedure Smoothing_is (Self : in out Window; |
Now : Smoothing_method) is |
begin |
Self.Smoothing := Now; |
end Smoothing_is; |
procedure Add (Self : in out Window; the_Object : GLOBE_3D.p_Visual) is |
begin |
Self.object_Count := Self.object_Count + 1; |
Self.Objects (Self.object_Count) := the_Object.all'Access; |
end Add; |
procedure Rid (Self : in out Window; the_Object : GLOBE_3D.p_Visual) is |
use G3D; |
begin |
for Each in 1 .. Self.object_Count loop |
if Self.Objects (Each) = the_Object then |
if Each /= Self.object_Count then |
Self.Objects (Each .. Self.object_Count - 1) := Self.Objects (Each + 1 .. Self.object_Count); |
end if; |
Self.object_Count := Self.object_Count - 1; |
return; |
end if; |
end loop; |
raise no_such_Object; |
end Rid; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.