lace_opengl_0.1.0_672a6415/applet/demo/core/launch_core_test.adb

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
with
     openGL.Tasks,
     openGL.Server,

     sdl.Video.Windows.Makers,
     sdl.Video.gl,

     ada.Task_identification,
     ada.Text_IO;


procedure launch_core_Test
--
--  Exercise basic subprograms common to all GL profiles.
--
--  TODO: Complete this.
--
is
   use ada.Text_IO;
   use type sdl.Video.Windows.window_Flags;

   Error : exception;

   Window     : sdl.Video.Windows.Window;
   gl_Context : sdl.Video.gl.Contexts;

begin
   ---------
   --- Setup
   --

   if not SDL.initialise
   then
      raise Error with "Unable to initialise SDL.";
   end if;

   sdl.Video.Windows.Makers.create (Win    => Window,
                                    Title  => "openGL Demo",
                                    X      => 100,
                                    Y      => 100,
                                    Width  => 200,
                                    Height => 200,
                                    Flags  =>    sdl.Video.Windows.openGL
                                              or sdl.Video.Windows.Resizable);

   sdl.Video.gl.create      (gl_Context, From => Window);
   sdl.Video.gl.set_Current (gl_Context, To   => Window);

   openGL.Tasks.renderer_Task := ada.Task_identification.current_Task;

   ---------
   --- Tests
   --

   put_Line ("openGL Server: " & openGL.Server.Version);
   delay 2.0;
end launch_core_Test;