comp.lang.ada
 help / color / mirror / Atom feed
* Setting up Opengl
@ 2010-11-17 18:10 Szymon Ząbkiewicz
  2010-11-17 20:39 ` Gautier write-only
  0 siblings, 1 reply; 14+ messages in thread
From: Szymon Ząbkiewicz @ 2010-11-17 18:10 UTC (permalink / raw)


Hello everyone. I'm new to Ada (coming from c++ background). I would
appreciate if someone could tell me step by step how to set up opengl
with Ada on windows. I have huge difficulties with those different
command line options. I'd really appreciate the help. Cheers!



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

* Re: Setting up Opengl
  2010-11-17 18:10 Setting up Opengl Szymon Ząbkiewicz
@ 2010-11-17 20:39 ` Gautier write-only
  2010-11-17 21:05   ` Szymon Ząbkiewicz
  0 siblings, 1 reply; 14+ messages in thread
From: Gautier write-only @ 2010-11-17 20:39 UTC (permalink / raw)


On Nov 17, 7:10 pm, Szymon Ząbkiewicz wrote:

> Hello everyone. I'm new to Ada (coming from c++ background). I would
> appreciate if someone could tell me step by step how to set up opengl
> with Ada on windows. I have huge difficulties with those different
> command line options. I'd really appreciate the help. Cheers!

It depends on what flavour of OpenGL-on-Ada you consider using.
For instance with that one: http://globe3d.sf.net/ there is no command
line option at all to make it work.
Cheers
______________________________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/search/label/Ada
NB: follow the above link for a working e-mail address



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

* Re: Setting up Opengl
  2010-11-17 20:39 ` Gautier write-only
@ 2010-11-17 21:05   ` Szymon Ząbkiewicz
  2010-11-17 22:41     ` Georg Bauhaus
  0 siblings, 1 reply; 14+ messages in thread
From: Szymon Ząbkiewicz @ 2010-11-17 21:05 UTC (permalink / raw)


So what files i have to copy/compile/include inproject/etc. to get
direct opengl binding to work using Globe3D?

On 17 Lis, 21:39, Gautier write-only <gautier_niou...@hotmail.com>
wrote:
> On Nov 17, 7:10 pm, Szymon Ząbkiewicz wrote:
>
> > Hello everyone. I'm new to Ada (coming from c++ background). I would
> > appreciate if someone could tell me step by step how to set up opengl
> > with Ada on windows. I have huge difficulties with those different
> > command line options. I'd really appreciate the help. Cheers!
>
> It depends on what flavour of OpenGL-on-Ada you consider using.
> For instance with that one:http://globe3d.sf.net/there is no command
> line option at all to make it work.
> Cheers
> ______________________________________________________________________________
> Gautier's Ada programming --http://gautiersblog.blogspot.com/search/label/Ada
> NB: follow the above link for a working e-mail address




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

* Re: Setting up Opengl
  2010-11-17 21:05   ` Szymon Ząbkiewicz
@ 2010-11-17 22:41     ` Georg Bauhaus
  2010-11-18  8:38       ` Gautier write-only
  0 siblings, 1 reply; 14+ messages in thread
From: Georg Bauhaus @ 2010-11-17 22:41 UTC (permalink / raw)


Read below for what to do to work with the binding.

On 11/17/10 10:05 PM, Szymon Ząbkiewicz wrote:
> So what files i have to copy/compile/include inproject/etc. to get
> direct opengl binding to work using Globe3D?
>
> On 17 Lis, 21:39, Gautier write-only<gautier_niou...@hotmail.com>
> wrote:
>> On Nov 17, 7:10 pm, Szymon Ząbkiewicz wrote:
>>
>>> Hello everyone. I'm new to Ada (coming from c++ background). I would
>>> appreciate if someone could tell me step by step how to set up opengl
>>> with Ada on windows. I have huge difficulties with those different
>>> command line options. I'd really appreciate the help. Cheers!
>>
>> It depends on what flavour of OpenGL-on-Ada you consider using.
>> For instance with that one:http://globe3d.sf.net/there is no command
>> line option at all to make it work.

- I downloaded via the address given.

- I unpacked the way the ZIP comments suggest.

- The file "readme.txt" from the archive says
"proceed to the intro doc", which is included.
So I did.

- The intro doc explains building: know your platform
and your compiler/IDE.  Then, pressing one key or running
make might be all you need to do.

So I did, choosing the GNAT project file option.

The good news:
Even ignoring that I have an Intel Mac, not a PPC Mac
supported by this source, I get a fine compile.
The linking stage fails, perhaps not surprisingly, because
the setup in my case is for Intel, not PowerPC.

So, if you want to know the details, just look into
your GNAT project file.  Copy one, modify it as needed.

HTH



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

* Re: Setting up Opengl
  2010-11-17 22:41     ` Georg Bauhaus
@ 2010-11-18  8:38       ` Gautier write-only
  2010-11-18 19:53         ` Simon Wright
  0 siblings, 1 reply; 14+ messages in thread
From: Gautier write-only @ 2010-11-18  8:38 UTC (permalink / raw)


On Nov 17, 11:41 pm, Georg Bauhaus <rm-
host.bauh...@maps.futureapps.de> wrote:

> The good news:
> Even ignoring that I have an Intel Mac, not a PPC Mac
> supported by this source, I get a fine compile.
> The linking stage fails, perhaps not surprisingly, because
> the setup in my case is for Intel, not PowerPC.

Hi Georg - unless I'm mistaken, the latest source revision deals with
building GLOBE_3D on Mac for both Intel and PPC processors (not tested
by myself).

http://globe3d.svn.sourceforge.net/viewvc/globe3d?revision=139&view=revision

The distribution (from the zip file) should build "out-of-the-box" on
Windows, and (provided you set all source file names lower case) on
Linux. I test and develop it on both systems.
Cheers
______________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/
NB: follow the above link for a working e-mail address



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

* Re: Setting up Opengl
  2010-11-18  8:38       ` Gautier write-only
@ 2010-11-18 19:53         ` Simon Wright
  2010-11-18 22:52           ` Georg Bauhaus
  2010-11-19  9:54           ` Gautier write-only
  0 siblings, 2 replies; 14+ messages in thread
From: Simon Wright @ 2010-11-18 19:53 UTC (permalink / raw)


Gautier write-only <gautier_niouzes@hotmail.com> writes:

> On Nov 17, 11:41 pm, Georg Bauhaus <rm-
> host.bauh...@maps.futureapps.de> wrote:
>
>> The good news:
>> Even ignoring that I have an Intel Mac, not a PPC Mac
>> supported by this source, I get a fine compile.
>> The linking stage fails, perhaps not surprisingly, because
>> the setup in my case is for Intel, not PowerPC.
>
> Hi Georg - unless I'm mistaken, the latest source revision deals with
> building GLOBE_3D on Mac for both Intel and PPC processors (not tested
> by myself).
>
> http://globe3d.svn.sourceforge.net/viewvc/globe3d?revision=139&view=revision
>
> The distribution (from the zip file) should build "out-of-the-box" on
> Windows, and (provided you set all source file names lower case) on
> Linux. I test and develop it on both systems.

The latest revision (139) built globe_3d_demo just fine, but not mini
(because there's no file [Mm]ini.adb, I guess!)

There was a constraint error eventually .. 

   Exception name: CONSTRAINT_ERROR
   Message: globe_3d-collision_detection.adb:101 index check failed




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

* Re: Setting up Opengl
  2010-11-18 19:53         ` Simon Wright
@ 2010-11-18 22:52           ` Georg Bauhaus
  2010-11-19  9:52             ` Gautier write-only
                               ` (2 more replies)
  2010-11-19  9:54           ` Gautier write-only
  1 sibling, 3 replies; 14+ messages in thread
From: Georg Bauhaus @ 2010-11-18 22:52 UTC (permalink / raw)


On 11/18/10 8:53 PM, Simon Wright wrote:
> Gautier write-only<gautier_niouzes@hotmail.com>  writes:

>> http://globe3d.svn.sourceforge.net/viewvc/globe3d?revision=139&view=revision
>>
>> The distribution (from the zip file) should build "out-of-the-box" on
>> Windows, and (provided you set all source file names lower case) on
>> Linux. I test and develop it on both systems.

I'm now seeing the metal sheets (Mac, Intel, 10.6, GNAT GPL 2010).

This demo thing looks like someone's brought stuff home
from DIY store, don't they have style in space? ;-)


> The latest revision (139) built globe_3d_demo just fine, but not mini
> (because there's no file [Mm]ini.adb, I guess!)

Mini.adb has been added a few minutes ago.
The compiler wants an additional keyboard parameter
for Strike_once. Guessing, then, I have added one and
mini works, now.  Nice.

*** mini.adb	Thu Nov 18 23:42:56 2010
--- mini.orig	Thu Nov 18 23:39:48 2010
***************
*** 235,240 ****
   
!     if GLUT.Devices.Strike_once(
!         Character'Val(27),
!         GLUT.Devices.default_Keyboard'Access)
!     then
         GLUT.LeaveMainLoop;
--- 235,237 ----
   
!     if GLUT.Devices.Strike_once( Character'Val(27) ) then
         GLUT.LeaveMainLoop;




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

* Re: Setting up Opengl
  2010-11-18 22:52           ` Georg Bauhaus
@ 2010-11-19  9:52             ` Gautier write-only
  2010-11-19 20:14             ` Simon Wright
  2010-11-20 12:07             ` Gautier write-only
  2 siblings, 0 replies; 14+ messages in thread
From: Gautier write-only @ 2010-11-19  9:52 UTC (permalink / raw)


On 18 nov, 23:52, Georg Bauhaus <rm-host.bauh...@maps.futureapps.de>
wrote:
> On 11/18/10 8:53 PM, Simon Wright wrote:
>
> > Gautier write-only<gautier_niou...@hotmail.com>  writes:
> >>http://globe3d.svn.sourceforge.net/viewvc/globe3d?revision=139&view=r...
>
> >> The distribution (from the zip file) should build "out-of-the-box" on
> >> Windows, and (provided you set all source file names lower case) on
> >> Linux. I test and develop it on both systems.
>
> I'm now seeing the metal sheets (Mac, Intel, 10.6, GNAT GPL 2010).
>
> This demo thing looks like someone's brought stuff home
> from DIY store, don't they have style in space? ;-)
>
> > The latest revision (139) built globe_3d_demo just fine, but not mini
> > (because there's no file [Mm]ini.adb, I guess!)
>
> Mini.adb has been added a few minutes ago.
> The compiler wants an additional keyboard parameter
> for Strike_once. Guessing, then, I have added one and
> mini works, now.  Nice.

Indeed the glut-* files were outdated in the svn sources.
This is fixed. Thanks!
______________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/
NB: follow the above link for a working e-mail address



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

* Re: Setting up Opengl
  2010-11-18 19:53         ` Simon Wright
  2010-11-18 22:52           ` Georg Bauhaus
@ 2010-11-19  9:54           ` Gautier write-only
  2010-11-19 12:02             ` sjw
  1 sibling, 1 reply; 14+ messages in thread
From: Gautier write-only @ 2010-11-19  9:54 UTC (permalink / raw)


On 18 nov, 20:53, Simon Wright wrote:

> There was a constraint error eventually ..
>
>    Exception name: CONSTRAINT_ERROR
>    Message: globe_3d-collision_detection.adb:101 index check failed

Oh, when does it happen (I kind of remember having seen that one,
though) ?...
______________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/
NB: follow the above link for a working e-mail address



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

* Re: Setting up Opengl
  2010-11-19  9:54           ` Gautier write-only
@ 2010-11-19 12:02             ` sjw
  2010-11-19 13:18               ` Gautier write-only
  0 siblings, 1 reply; 14+ messages in thread
From: sjw @ 2010-11-19 12:02 UTC (permalink / raw)


On Nov 19, 9:54 am, Gautier write-only <gautier_niou...@hotmail.com>
wrote:
> On 18 nov, 20:53, Simon Wright wrote:
>
> > There was a constraint error eventually ..
>
> >    Exception name: CONSTRAINT_ERROR
> >    Message: globe_3d-collision_detection.adb:101 index check failed
>
> Oh, when does it happen (I kind of remember having seen that one,
> though) ?...

I'd been waving the pointer about wildly (!) so that the viewpoint was
moving all over the place, it crashed when I moved to the first image
with the (9?) squares with '3'.

Only the once (afterwards I wasn't so energetic with the pointer).

I'd have posted a traceback but atos (this is on a Mac) only gave me
the line numbers for the main file (where it calls the main loop) and
the one in the exception message. Maybe the library wasn't built with -
g?

Any Mac users know why I have to say "atos -arch x86_64"? You'd have
thought something capable of analysing an executable could have worked
out whether it was 32- or 64-bits!



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

* Re: Setting up Opengl
  2010-11-19 12:02             ` sjw
@ 2010-11-19 13:18               ` Gautier write-only
  2010-11-19 20:24                 ` Simon Wright
  0 siblings, 1 reply; 14+ messages in thread
From: Gautier write-only @ 2010-11-19 13:18 UTC (permalink / raw)


On 19 nov, 13:02, sjw:

> I'd been waving the pointer about wildly (!) so that the viewpoint was
> moving all over the place, it crashed when I moved to the first image
> with the (9?) squares with '3'.

OK, I guess I have a clue then: this object is manually built,
probably with a wrong vertex numbering on one face.

> I'd have posted a traceback but atos (this is on a Mac) only gave me
> the line numbers for the main file (where it calls the main loop) and
> the one in the exception message. Maybe the library wasn't built with -
> g?

There is -g in the "Debug" mode, but probably it doesn't help because
the main display operations are called from the GLUT framework.

You give the routines' addresses to GLUT:
    ReshapeFunc(      Window_Resize'Address        );
    DisplayFunc(      Main_operations'Address      );
    IdleFunc(         Main_operations'Address      );
    GLUT.Devices.Initialize;

Then, you start the game:
  GLUT.MainLoop;  -- Let's rock !

With all that, the traceback probably cannot go further than the
latter instruction.
______________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/
NB: follow the above link for a working e-mail address




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

* Re: Setting up Opengl
  2010-11-18 22:52           ` Georg Bauhaus
  2010-11-19  9:52             ` Gautier write-only
@ 2010-11-19 20:14             ` Simon Wright
  2010-11-20 12:07             ` Gautier write-only
  2 siblings, 0 replies; 14+ messages in thread
From: Simon Wright @ 2010-11-19 20:14 UTC (permalink / raw)


Georg Bauhaus <rm-host.bauhaus@maps.futureapps.de> writes:

> On 11/18/10 8:53 PM, Simon Wright wrote:

> Mini.adb has been added a few minutes ago.
> The compiler wants an additional keyboard parameter
> for Strike_once. Guessing, then, I have added one and
> mini works, now.  Nice.
>
> *** mini.adb	Thu Nov 18 23:42:56 2010
> --- mini.orig	Thu Nov 18 23:39:48 2010
> ***************
> *** 235,240 ****
>   !     if GLUT.Devices.Strike_once(
> !         Character'Val(27),
> !         GLUT.Devices.default_Keyboard'Access)
> !     then
>         GLUT.LeaveMainLoop;
> --- 235,237 ----
>   !     if GLUT.Devices.Strike_once( Character'Val(27) ) then
>         GLUT.LeaveMainLoop;

You might add this ... builds fine now.

--- globe_3d_gps_darwin.gpr	(revision 141)
+++ globe_3d_gps_darwin.gpr	(working copy)
@@ -2,7 +2,7 @@
 
    for Object_Dir use "../obj/gnatdebg";
    for Source_Dirs use (".", "../bindings", "../bindings/linux", "../src//**");
-   for Main use ("globe_3d_demo.adb", "Mini.adb");
+   for Main use ("globe_3d_demo.adb", "mini.adb");
    for Exec_Dir use ".";
 
    package Binder is



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

* Re: Setting up Opengl
  2010-11-19 13:18               ` Gautier write-only
@ 2010-11-19 20:24                 ` Simon Wright
  0 siblings, 0 replies; 14+ messages in thread
From: Simon Wright @ 2010-11-19 20:24 UTC (permalink / raw)


Gautier write-only <gautier_niouzes@hotmail.com> writes:

>> I'd have posted a traceback but atos (this is on a Mac) only gave me
>> the line numbers for the main file (where it calls the main loop) and
>> the one in the exception message. Maybe the library wasn't built with -
>> g?

> Then, you start the game:
>   GLUT.MainLoop;  -- Let's rock !
>
> With all that, the traceback probably cannot go further than the
> latter instruction.

Another one: moving the first screen of globe_3d_demo way off screen,

Exception name: CONSTRAINT_ERROR
Message: globe_3d_demo.adb:814 range check failed
Call stack traceback locations:
0x1001c2507 0x101076915 0x1001b6171 0x1000013a1

$ atos -arch x86_64 -o globe_3d_demo 0x1001c2507 0x101076915 0x1001b6171 0x1000013a1
globe_3d_demo__main_operations.3364 (in globe_3d_demo) + 738
0x101076915
_ada_globe_3d_demo (in globe_3d_demo) (globe_3d_demo.adb:1115)
main (in globe_3d_demo) (b~globe_3d_demo.adb:371)

I suppose that "globe_3d_demo__main_operations.3364 (in globe_3d_demo) +
738" is in fact globe_3d_demo.adb:814 ...



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

* Re: Setting up Opengl
  2010-11-18 22:52           ` Georg Bauhaus
  2010-11-19  9:52             ` Gautier write-only
  2010-11-19 20:14             ` Simon Wright
@ 2010-11-20 12:07             ` Gautier write-only
  2 siblings, 0 replies; 14+ messages in thread
From: Gautier write-only @ 2010-11-20 12:07 UTC (permalink / raw)


On 18 nov, 23:52, Georg Bauhaus wrote:

> This demo thing looks like someone's brought stuff home
> from DIY store, don't they have style in space? ;-)

When the 3D engine will improve to multitexturing, it should look a
lot better; indeed like this:

http://www.3dfx.ch/gallery/v/3dfx_collectors/collectors_goldleader/nvgear/GTX295/Delta+Labs+Level+4_s+Hellish+Bloody+Walls+a.png.html

Very stylish, isn't it ?...
______________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/
NB: follow the above link for a working e-mail address



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

end of thread, other threads:[~2010-11-20 12:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-17 18:10 Setting up Opengl Szymon Ząbkiewicz
2010-11-17 20:39 ` Gautier write-only
2010-11-17 21:05   ` Szymon Ząbkiewicz
2010-11-17 22:41     ` Georg Bauhaus
2010-11-18  8:38       ` Gautier write-only
2010-11-18 19:53         ` Simon Wright
2010-11-18 22:52           ` Georg Bauhaus
2010-11-19  9:52             ` Gautier write-only
2010-11-19 20:14             ` Simon Wright
2010-11-20 12:07             ` Gautier write-only
2010-11-19  9:54           ` Gautier write-only
2010-11-19 12:02             ` sjw
2010-11-19 13:18               ` Gautier write-only
2010-11-19 20:24                 ` Simon Wright

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