comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: is getting OpenGL to work with Ada a lost cause?
Date: Sun, 3 Aug 2014 13:56:19 +0200
Date: 2014-08-03T13:56:19+02:00	[thread overview]
Message-ID: <1lvqvd5q7gxl0.1ezs9o63cnam4$.dlg@40tude.net> (raw)
In-Reply-To: d3e094b7-ba90-4723-a0d7-bbeccad6c909@googlegroups.com

On Sun, 3 Aug 2014 03:27:28 -0700 (PDT), jsquirek@gmail.com wrote:

> Yes, I was referring to the fact that although bindings are easy to come
> across, finding a project that links to the proper dlls in Windows can be
> difficult if you are not familiar with how Windows works.

Yes, but that is not Ada stuff. All the mess with OpenGL libraries was
created by OpenGL providers and maintainers. Ada cannot heal all wounds of
the world.

> Especially since
> the Glut and SDL libraries will have to be the right bit size and
> generally downloaded and linked to separately.
> 
> e.g. This is not straight forward.
> project My_Project is
>   --...
>   Switch_Linker :=(
>     External("WinDir") & "\System32\opengl32.dll",
>     ".\SDL32.dll" -- Must be downloaded from https://www.libsdl.org/download-2.0.php
>   package Linker is
>     for Default_Switches("Ada") use Switch_Linker;
>   end Linker;
> end My_Project;

When you are working with bindings it is better to create a library project
for the bindings.

There are basically two proper ways (and many IMO wrong ones) to reference
an external library:

1. An external library project to "with" in the bindings project:

project opengl32 is
   for Externally_Built use "true";
   for Source_Files use ();
   for Library_Dir use ".";
   for Library_Name use "opengl32";
   for Library_Kind use "dynamic";
end opengl32;

with "opengl32.gpr";
project My_Bindings is
   ...
end My_Bindings;

2. Linker_Options in the bindings project:

project My_Bindings is
   ...
   package Linker is
      for Linker_Options use ("-lopengl32"); 
   end Linker;
end My_Bindings;

Any application project would simply with "my_bindings.gpr"; this will
adjust the linker options as necessary.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2014-08-03 11:56 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-02 20:54 is getting OpenGL to work with Ada a lost cause? pincerfae
2014-08-03  9:35 ` jsquirek
2014-08-03  9:54   ` Dmitry A. Kazakov
2014-08-03 10:27     ` jsquirek
2014-08-03 11:56       ` Dmitry A. Kazakov [this message]
2014-08-03 12:40         ` jsquirek
2014-08-04 12:52           ` Dmitry A. Kazakov
2014-08-04 19:14             ` Björn Lundin
2014-08-03 16:46     ` Shark8
2014-08-04  1:38       ` Nasser M. Abbasi
2014-08-03 16:43   ` Shark8
2014-08-03 12:12 ` francois_fabien
2014-08-05 16:24 ` leonid.dulman
2014-08-13 23:23   ` pincerfae
2014-08-14  1:47     ` Shark8
2014-08-15 14:53       ` Stephen Leake
2014-08-15 16:50         ` Shark8
2014-08-15 13:28     ` jsquirek
2014-08-16 19:33       ` Nasser M. Abbasi
2014-08-16 22:13         ` pincerfae
2014-08-17 11:32           ` Luke A. Guest
2014-08-18 16:35             ` Shark8
2014-08-18 20:26               ` Luke A. Guest
2014-08-18 21:01                 ` Shark8
2014-08-18 21:44                   ` Luke A. Guest
2014-08-18 21:49                   ` Nasser M. Abbasi
2014-08-18 22:21                     ` Robert A Duff
2014-08-19  9:39                       ` Simon Wright
2014-08-19  1:25                     ` Shark8
2014-08-19  9:45                       ` Simon Wright
2014-08-19 21:59                         ` Shark8
2014-08-20 20:09                         ` erlo
2014-08-19  7:42                     ` Dmitry A. Kazakov
2014-08-19 11:36                     ` Björn Lundin
2014-08-25  5:27                     ` Tero Koskinen
2014-08-19  0:57           ` Nasser M. Abbasi
2014-08-19  1:29             ` Luke A. Guest
2014-08-24 22:35               ` pincerfae
2014-08-25  4:21                 ` jsquirek
2014-08-25 15:58                   ` Lucretia
2014-08-24 17:16 ` gdotone
2014-08-24 18:49   ` gautier_niouzes
2014-09-02 16:39 ` Quentin Ochem
2014-09-12  8:14   ` reinkor
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox