comp.lang.ada
 help / color / mirror / Atom feed
* Ada OpenGL bindings, how to use them with gnat ?
@ 2003-07-15 16:01 Karim
  2003-07-16 23:03 ` David Holm
  0 siblings, 1 reply; 14+ messages in thread
From: Karim @ 2003-07-15 16:01 UTC (permalink / raw)


Hello 

I`m very new to Ada and I know that I first have to improve my ada
programming skills, but I want to know how to use the opengl ADA
bindings with gnat.
I looked on the web, but couldn find much ressources. 
There is the ada opengl project page on sourceforge, but  no manual
"how to use it" or how to programm a first simple glut window. There
isn`t also an example on the nehe page .None
Question : 

1. Does anybody used the bindings with gnat ? How, and on which OS ? 
I use FreeBSD and X Window. 

2. I simple source would be nice, to build a first simple app.

3. Are there ressources for ADA opengl (Howto`s , Tutorials) ??? 

Greetings 
fab



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-15 16:01 Ada OpenGL bindings, how to use them with gnat ? Karim
@ 2003-07-16 23:03 ` David Holm
  2003-07-17 16:37   ` chris.danx
  2003-07-17 20:42   ` Karim
  0 siblings, 2 replies; 14+ messages in thread
From: David Holm @ 2003-07-16 23:03 UTC (permalink / raw)


Hi,
I'm developing that binding.

> 
> 1. Does anybody used the bindings with gnat ? How, and on which OS ? 
> I use FreeBSD and X Window. 
I've successfully used it with Linux, FreeBSD and MacOS X

> 
> 2. I simple source would be nice, to build a first simple app.
Try the examples that come with the code.

> 3. Are there ressources for ADA opengl (Howto`s , Tutorials) ??? 
No, I hate writing documentation =(.
But it doesn't work any different from your standard OpenGL in C so it should be fairly easy to
figure out. There will be some form of documentation with the 1.0 release.

//David Holm



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-16 23:03 ` David Holm
@ 2003-07-17 16:37   ` chris.danx
  2003-07-17 18:45     ` David Holm
  2003-07-17 20:42   ` Karim
  1 sibling, 1 reply; 14+ messages in thread
From: chris.danx @ 2003-07-17 16:37 UTC (permalink / raw)


Can you post the link for the bindings please?




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-17 16:37   ` chris.danx
@ 2003-07-17 18:45     ` David Holm
  0 siblings, 0 replies; 14+ messages in thread
From: David Holm @ 2003-07-17 18:45 UTC (permalink / raw)


http://adaopengl.sourceforge.net/

On Thu, 17 Jul 2003 17:37:51 +0100
"chris.danx" <spamoff.danx@ntlworld.com> wrote:

> Can you post the link for the bindings please?
> 



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-16 23:03 ` David Holm
  2003-07-17 16:37   ` chris.danx
@ 2003-07-17 20:42   ` Karim
  2003-07-17 21:23     ` David Holm
  1 sibling, 1 reply; 14+ messages in thread
From: Karim @ 2003-07-17 20:42 UTC (permalink / raw)


Hello 

Thanks for the hints. I downloaded the newest version of adaopengl and
installed it into /usr/home/karim/ada/adaopengl-0.10
I have read the README text file, and there is written to change the
Make.conf and to adapt it to the system. I changed nothing, because I
thought it was o.k, and I don`t have enough experience to understand
each parameter.
I tried to run the make file in the examples/adaglut dir, but got an
error :

gnatmake: error, unable to locate gnatgcc 
*** Error code 4 

1.There exist no command for gnatgcc on my system , but I  have
installed the gnatport for FreeBSD  on it. Can you help me with this ?

2.I cannot imagine how to use the bindings, does they works like
libraries ?

3.You are right. It seems that it is not that hard to write a simple
ada opengl application to open a window, but how can I compile it with
gnat ??  (What is the exact console command to compile a basic opengl
or glut source ??)

4. Is there a lib to load images (textures) with ada ?? (I don`t think
that mesa/GL are shipping one.)

greetings 

Karim



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-17 20:42   ` Karim
@ 2003-07-17 21:23     ` David Holm
  2003-07-18 10:39       ` Karim
  0 siblings, 1 reply; 14+ messages in thread
From: David Holm @ 2003-07-17 21:23 UTC (permalink / raw)


On 17 Jul 2003 13:42:22 -0700
fab102@bluemail.ch (Karim) wrote:

> Hello 
> 
> 1.There exist no command for gnatgcc on my system , but I  have
> installed the gnatport for FreeBSD  on it. Can you help me with this ?

Change ADA_CC in Make.conf to adagcc, gnatgcc is the name used by gentoo linux. FreeBSD for some
reason chose adagcc.

> 2.I cannot imagine how to use the bindings, does they works like
> libraries ?

All you really have to do is "with" whatever you need (i.e. OpenGL and OpenGL.GLUT) and then add
adaopengl-0.10/adaopengl to your includepath (-I/usr/home/karim/ada/adaopengl-0.10/adaopengl)

> 3.You are right. It seems that it is not that hard to write a simple
> ada opengl application to open a window, but how can I compile it with
> gnat ??  (What is the exact console command to compile a basic opengl
> or glut source ??)

gnatmake your_main_procedure -I/usr/home/karim/ada/adaopengl-0.10/adaopengl \
        -largs -L/usr/X11R6/lib -lX11-lXext-lGL-lGLU -lglut

> 4. Is there a lib to load images (textures) with ada ?? (I don`t think
> that mesa/GL are shipping one.)

I haven't really looked. But loading tga (targa) is very easy, check www.wotsit.org for the
specification.

I'm considering going through the whole mess of using auto* or maybe pmk (pmk.sf.net) for the
next release or the release after to make it easier for new users and windiots (who don't seem
to have a clue about using a console) to compile the thing.

//David Holm



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-17 21:23     ` David Holm
@ 2003-07-18 10:39       ` Karim
  2003-07-18 13:32         ` David Holm
  0 siblings, 1 reply; 14+ messages in thread
From: Karim @ 2003-07-18 10:39 UTC (permalink / raw)


Hello David 

It still doesn`t work. I tried to compile the adaglut example in the
adaopengl-0.10/examples/adaglut dir.
The command was like this :
gnatmake adaglut.adb -I/usr/home/karim/ada/adaopengl-0.10/adaopengl
-largs
-L/usr/X11R6/lib -lX11 -lXext -lGL -lGLU -lglut 

Get this msg: 
/usr/local/lib/gcc-lib/i386-unknown-freebsd5.1/2.8.1/adalib/libgnat.so:
warning: mktemp() possibly used unsafely; consider using mkstemp()
/usr/X11R6/lib/libglut.so: undefined reference to
'glXBindChannelToWindowSGIX'
/usr/X11R6/lib/libglut.so: undefined reference to
'glXQueryChannelDeltasSGIX'
/usr/X11R6/lib/libglut.so: undefined reference to
'glXChannelRectSyncSGIX'
/usr/X11R6/lib/libglut.so: undefined reference to 'glXChannelRectSGIX'
/usr/X11R6/lib/libglut.so: undefined reference to
'glXQueryChannelRectSGIX'

gnatlink cannot call /usr/local/bin/adagcc 
gnatmake *** link failed. 

When I try to run the make file for (Make.conf , line 4 changed to
ADA_CC ?= adagcc) , I get the same error .

1. It seems that gnatmake has problem to find glx lib . Is this,
because I don`t installed adabinx ? I looked on the adabinx page, and
there is written this is for Linux. Does it also work on FreeBSD ?
Should I install the adabindx.

2. I also tried to locate my glx module, lib or whatever. I found only
this libs installed in /usr/X11R6/lib :
libGL.so / libGL.so.1 / libGLU.a / libGLU.so / libGLU.so.1 /
libGLcore.so /
libGLcore.so.1 /lbGLw.a   but none glx lib .  Are the libs o.k ? 
Where is the glx stuff ?

(I have installed the last FreeBSD nvidia driver and mesa)


3. General. I get the message "mktemp probaly unsafed..." each time I
compile code with gnatmake. What`s this all about ? It doesn`t matter,
but perhaps I can fix it .

much thank for your help 

Greetings  
Karim



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-18 10:39       ` Karim
@ 2003-07-18 13:32         ` David Holm
  2003-07-18 16:26           ` chris.danx
  0 siblings, 1 reply; 14+ messages in thread
From: David Holm @ 2003-07-18 13:32 UTC (permalink / raw)


On 18 Jul 2003 03:39:57 -0700
fab102@bluemail.ch (Karim) wrote:

> Hello David 
> 
> It still doesn`t work. I tried to compile the adaglut example in the
> adaopengl-0.10/examples/adaglut dir.
> The command was like this :
> gnatmake adaglut.adb -I/usr/home/karim/ada/adaopengl-0.10/adaopengl
> -largs
> -L/usr/X11R6/lib -lX11 -lXext -lGL -lGLU -lglut 
> 
> Get this msg: 
> /usr/local/lib/gcc-lib/i386-unknown-freebsd5.1/2.8.1/adalib/libgnat.so:
> warning: mktemp() possibly used unsafely; consider using mkstemp()
> /usr/X11R6/lib/libglut.so: undefined reference to
> 'glXBindChannelToWindowSGIX'
> /usr/X11R6/lib/libglut.so: undefined reference to
> 'glXQueryChannelDeltasSGIX'
> /usr/X11R6/lib/libglut.so: undefined reference to
> 'glXChannelRectSyncSGIX'
> /usr/X11R6/lib/libglut.so: undefined reference to 'glXChannelRectSGIX'
> /usr/X11R6/lib/libglut.so: undefined reference to
> 'glXQueryChannelRectSGIX'

Seems some symbols are missing in your libGL.so.
Try "nm /usr/X11R6/lib/libGL.so|grep glXQueryChannelRectSGIX" and "nm
/usr/X11R6/lib/libGL.a|grep glXQueryChannelRectSGIX" it should say something like:
0004b8dc T glXQueryChannelRectSGIX

(the number at the beginning may vary depending on your OpenGL lib). I'm using nVidias OpenGL
library, both on linux and FreeBSD.

> 1. It seems that gnatmake has problem to find glx lib . Is this,
> because I don`t installed adabinx ? I looked on the adabinx page, and
> there is written this is for Linux. Does it also work on FreeBSD ?
> Should I install the adabindx.

AdaBindX is only necessary in case you want to use glX directly. If you use glut you won't need
it.

> 2. I also tried to locate my glx module, lib or whatever. I found only
> this libs installed in /usr/X11R6/lib :
> libGL.so / libGL.so.1 / libGLU.a / libGLU.so / libGLU.so.1 /
> libGLcore.so /
> libGLcore.so.1 /lbGLw.a   but none glx lib .  Are the libs o.k ? 
> Where is the glx stuff ?

It should be in libGL.so

> (I have installed the last FreeBSD nvidia driver and mesa)

If you have both installed it is quite possible that Mesa overwrote your nVidia OpenGL libs.
Make sure you have no conflicting libGL* in /usr/local/lib
 
> 
> 3. General. I get the message "mktemp probaly unsafed..." each time I
> compile code with gnatmake. What`s this all about ? It doesn`t matter,
> but perhaps I can fix it .

gnat 3.15p in FreeBSD uses mktemp and not mkstemp. If you want to fix it you need to modify the
gnat source and submit a patch (the source is very clean so it shouldn't be difficult).

//David Holm



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-18 13:32         ` David Holm
@ 2003-07-18 16:26           ` chris.danx
  2003-07-18 17:24             ` David Holm
  0 siblings, 1 reply; 14+ messages in thread
From: chris.danx @ 2003-07-18 16:26 UTC (permalink / raw)


David Holm wrote:
> 
> It should be in libGL.so
> 
>>(I have installed the last FreeBSD nvidia driver and mesa)
> 
> 
> If you have both installed it is quite possible that Mesa overwrote your nVidia OpenGL libs.
> Make sure you have no conflicting libGL* in /usr/local/lib
>  

Is you're lib limited to nvidia then?  Or have I misunderstood?


Chris




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-18 16:26           ` chris.danx
@ 2003-07-18 17:24             ` David Holm
  2003-07-18 21:46               ` Karim
  0 siblings, 1 reply; 14+ messages in thread
From: David Holm @ 2003-07-18 17:24 UTC (permalink / raw)


On Fri, 18 Jul 2003 17:26:43 +0100
"chris.danx" <spamoff.danx@ntlworld.com> wrote:

> David Holm wrote:
> > 
> > It should be in libGL.so
> > 
> >>(I have installed the last FreeBSD nvidia driver and mesa)
> > 
> > 
> > If you have both installed it is quite possible that Mesa overwrote your nVidia OpenGL libs.
> > Make sure you have no conflicting libGL* in /usr/local/lib
> >  
> 
> Is you're lib limited to nvidia then?  Or have I misunderstood?

You have misunderstood. How could you limit it to nVidia when nVidia uses OpenGL which is a
standard?



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-18 17:24             ` David Holm
@ 2003-07-18 21:46               ` Karim
  2003-07-19 10:00                 ` David Holm
  0 siblings, 1 reply; 14+ messages in thread
From: Karim @ 2003-07-18 21:46 UTC (permalink / raw)


Hello once again 

The output from the command 
nm /usr/X11R6/lib/libGL.so | grep glXQueryChannelRectSGIX   ..is : 

"nm: /usr/X11R6/lib/libGL.so: no symbols" 

the second nm command don`t work because there is no libGL.a in this dir. 
I also checked the dir /usr/lib , there are no mesa or gl files installed. 
Howq can I fix the problem with the symbols ?



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-18 21:46               ` Karim
@ 2003-07-19 10:00                 ` David Holm
  2003-07-22 14:28                   ` Karim
  0 siblings, 1 reply; 14+ messages in thread
From: David Holm @ 2003-07-19 10:00 UTC (permalink / raw)


Try reinstalling nvidia-driver. According to the pkg-plist it should have installed libGL.so and
libGL.a for you so something must be wrong. Also, check /usr/local/lib, /usr/lib is only for
system files so you won't find it there.
If you run glxinfo does it say you are using nvidias drivers and that direct rendering is
enabled? If you run glxgears does it run accelerated? (On my gf2 I get about 1200 fps in linux
and 1500 fps in freebsd 5).

//David Holm

On 18 Jul 2003 14:46:28 -0700
fab102@bluemail.ch (Karim) wrote:

> Hello once again 
> 
> The output from the command 
> nm /usr/X11R6/lib/libGL.so | grep glXQueryChannelRectSGIX   ..is : 
> 
> "nm: /usr/X11R6/lib/libGL.so: no symbols" 
> 
> the second nm command don`t work because there is no libGL.a in this dir. 
> I also checked the dir /usr/lib , there are no mesa or gl files installed. 
> Howq can I fix the problem with the symbols ?



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-19 10:00                 ` David Holm
@ 2003-07-22 14:28                   ` Karim
  2003-07-22 14:59                     ` David Holm
  0 siblings, 1 reply; 14+ messages in thread
From: Karim @ 2003-07-22 14:28 UTC (permalink / raw)


Hello   

I`m back. After looked in a lot of mailing lists and irc. It seems
that Nvidia and mesa don`t work nice on the same system. There are
some tools for linux to switch between the mesa and nvidia libs, but I
couldn`t find anything for FreeBSD. I never had this problem with my
old 3dfx Banshee Card.

David: Which card do you have installed on your FreeBSD system ? 

Somebody told me to install mesa and Nvidia in diffrent directories
and switch between it with LD_LIBRARY_PATH. But I don`t know, how that
 work nor how to install mesa (as port package) in a diffrent
directory. I tried to re-insatll Nvidia but got some errors from it.
Now, I have setup a new FreeBSD system, and have both installed. I
even didn`t found libGL.a .. it seems that this library isn`t
installed on my system. Hell, I cannot through this library mess.

Karim



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Ada OpenGL bindings, how to use them with gnat ?
  2003-07-22 14:28                   ` Karim
@ 2003-07-22 14:59                     ` David Holm
  0 siblings, 0 replies; 14+ messages in thread
From: David Holm @ 2003-07-22 14:59 UTC (permalink / raw)


Hi,

On 22 Jul 2003 07:28:25 -0700
fab102@bluemail.ch (Karim) wrote:

> Hello   
> 
> I`m back. After looked in a lot of mailing lists and irc. It seems
> that Nvidia and mesa don`t work nice on the same system. There are
> some tools for linux to switch between the mesa and nvidia libs, but I
> couldn`t find anything for FreeBSD. I never had this problem with my
> old 3dfx Banshee Card.

Too bad 3dfx went belly up. I've never used glide but from what I hear you can do really nifty
stuff with it =).


> David: Which card do you have installed on your FreeBSD system ? 

A GeForce 2 GTS, but I switched to Gentoo GNU/Linux so at the moment I only have FreeBSD on my
server. Although I compile ada stuff on it some times and forward the output to my desktop =).
 
> Somebody told me to install mesa and Nvidia in diffrent directories
> and switch between it with LD_LIBRARY_PATH. But I don`t know, how that
>  work nor how to install mesa (as port package) in a diffrent
> directory. I tried to re-insatll Nvidia but got some errors from it.
> Now, I have setup a new FreeBSD system, and have both installed. I
> even didn`t found libGL.a .. it seems that this library isn`t
> installed on my system. Hell, I cannot through this library mess.

Why do you want both Mesa and nVidia? Look for files called /usr/X11R6/lib/XXX-*, this is what
nVidia renames the existing libGL libraries to. If you have an XXX-libGL.a.%%.orig-<date> rename
it to libGL.a and it should work.
I don't think you should have both Mesa and nVidia though. That is asking for trouble.

//David Holm



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2003-07-22 14:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-15 16:01 Ada OpenGL bindings, how to use them with gnat ? Karim
2003-07-16 23:03 ` David Holm
2003-07-17 16:37   ` chris.danx
2003-07-17 18:45     ` David Holm
2003-07-17 20:42   ` Karim
2003-07-17 21:23     ` David Holm
2003-07-18 10:39       ` Karim
2003-07-18 13:32         ` David Holm
2003-07-18 16:26           ` chris.danx
2003-07-18 17:24             ` David Holm
2003-07-18 21:46               ` Karim
2003-07-19 10:00                 ` David Holm
2003-07-22 14:28                   ` Karim
2003-07-22 14:59                     ` David Holm

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