Add initial prototype.
This commit is contained in:
17
3-mid/opengl/applet/demo/core/core_test.gpr
Normal file
17
3-mid/opengl/applet/demo/core/core_test.gpr
Normal file
@@ -0,0 +1,17 @@
|
||||
with
|
||||
"opengl_demo",
|
||||
"sdlada",
|
||||
"lace_shared";
|
||||
|
||||
project Core_Test
|
||||
is
|
||||
for Object_Dir use "build";
|
||||
for Exec_Dir use ".";
|
||||
for Main use ("launch_core_test.adb");
|
||||
|
||||
package Ide renames Lace_shared.Ide;
|
||||
package Builder renames Lace_shared.Builder;
|
||||
package Compiler renames Lace_shared.Compiler;
|
||||
package Binder renames Lace_shared.Binder;
|
||||
|
||||
end Core_Test;
|
||||
57
3-mid/opengl/applet/demo/core/launch_core_test.adb
Normal file
57
3-mid/opengl/applet/demo/core/launch_core_test.adb
Normal file
@@ -0,0 +1,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;
|
||||
Reference in New Issue
Block a user