comp.lang.ada
 help / color / mirror / Atom feed
* GNAT and OPENGL in windows NT
@ 1997-12-02  0:00 Redmond Urbino
  1997-12-03  0:00 ` Pascal Obry
  0 siblings, 1 reply; 3+ messages in thread
From: Redmond Urbino @ 1997-12-02  0:00 UTC (permalink / raw)



Does anybody know of a way to get opengl working with gnat in windows
NT?

Yes, the SGI version of gnat did have support for opengl, but it's 
not there in the NT version.  

I do have visual C++, and opengl there works fine.

Is there a way to get gnat working with the microsoft .libs and 
.dlls ?

Please reply by email.

Thanks in advance.




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

* Re: GNAT and OPENGL in windows NT
  1997-12-03  0:00 ` Pascal Obry
@ 1997-12-03  0:00   ` Redmond Urbino
  0 siblings, 0 replies; 3+ messages in thread
From: Redmond Urbino @ 1997-12-03  0:00 UTC (permalink / raw)
  To: Pascal Obry


Please help.  I am trying to get a simple openg gl program to run using
gnat on windows nt.
I'm using gnat 3.10, the latest win32ada, vc++ 5.0, and  nt 4.0

I tried adding the option to gnatmake
   -largs \vc\include\opengl32.lib \vc\include\glu32.lib
\vc\lib\glaux.lib
I get lots of linker warnings like:
  ld: r:\vc\lib\opengl32.lib(OPENGL32.dll): warning: ignoring duplicate
section `.text'
  ld: r:\vc\lib\opengl32.lib(OPENGL32.dll): warning: ignoring duplicate
section `.idata$5'
  ld: r:\vc\lib\opengl32.lib(OPENGL32.dll): warning: ignoring duplicate
section `.text'
  ld: r:\vc\lib\opengl32.lib(OPENGL32.dll): warning: ignoring duplicate
section `.idata$5'
I get an executable, but it wont run and I get an error that it has not
been initialized properly


If I don't include those libraries, I get linker errors like:
  ./cube.o(.text+0xfb):cube.adb: undefined reference to `glFlush@0'
  ./cube.o(.text+0x196):cube.adb: undefined reference to
`auxInitDisplayMode@4'

Thanks in advance.
   

--------------------------------------------------------------------------------------------------
--  
-- Author : Pascal Obry
--
-- This is a sample program to show some OpenGL features.
--
-- It compile fine under GNAT 3.04a. You must add the following
-- libraries : OPENGL32.LIB GLU32.LIB GLAUX.LIB
--

with win32.Gl;

with win32.Glaux;
with Interfaces.C;
with Interfaces.C.Strings;
with System;
with Unchecked_Conversion;

procedure Cube is

   use win32.Gl;

   use win32.Glaux;
   use Interfaces;
                                       
   function Conv is new Unchecked_Conversion (System.Address,
AUXRESHAPEPROC);
   function Conv is new Unchecked_Conversion (System.Address,
AUXMAINPROC);
   function conv is new unchecked_conversion (system.address, 
win32.lpcstr);

   --Window_Name : aliased Interfaces.C.Char_Array := Interfaces.C.To_C
("Perspective 3-D Cube");
   Window_Name : array (1..21) of aliased character := "Perspective 3-D
Cube" & ascii.nul;
   Res : Glenum;

   --  callbacks must be defined with the Stdcall Convention
   procedure MyReshape (W, H : in Glsizei);
   pragma Convention (Stdcall, MyReshape);

   procedure Display;
   pragma Convention (Stdcall, Display);

   --  here start the definition of the gl scene.
   procedure MyInit is
   begin
      GlShadeModel (GL_FLAT);
   end MyInit;

   procedure MyReshape (W, H : in Glsizei) is
   begin
      GlMatrixMode (GL_PROJECTION);
      GlLoadIdentity;
      GlFrustum (-1.0, 1.0, -1.0, 1.0, 1.5, 20.0);
      GlMatrixMode (GL_MODELVIEW);
      GlViewPort (0, 0, W, H);
   end MyReshape;

   procedure Display is
   begin
      GlClear (GL_COLOR_BUFFER_BIT);
      GlColor3f (1.0, 1.0, 1.0);
      GlLoadIdentity;
      GlTranslatef (0.0, 0.0, -5.0);
      GlScalef (1.0, 2.0, 1.0);
      AuxWireCube (1.0);
      GlFlush;
   end Display;

begin
   AuxInitDisplayMode (AUX_SINGLE + AUX_RGB);
   AuxInitPosition (0, 0, 500, 500);
   Res := AuxInitWindow (conv(Window_Name (Window_Name'First)'address));
   MyInit;
   AuxReshapeFunc (Conv(MyReshape'Address));
   Auxmainloop (Conv(Display'Address));
end Cube;




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

* Re: GNAT and OPENGL in windows NT
  1997-12-02  0:00 GNAT and OPENGL in windows NT Redmond Urbino
@ 1997-12-03  0:00 ` Pascal Obry
  1997-12-03  0:00   ` Redmond Urbino
  0 siblings, 1 reply; 3+ messages in thread
From: Pascal Obry @ 1997-12-03  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]


Look at my homepage, you'll find your answer.

My homepage is in french so just follow the links ;
(Ada -> voir la page suivante)

--

--|------------------------------------------------------------
--| Pascal Obry                               Team-Ada Member |
--|                                                           |
--| EDF-DER-IPN-SID- Ing�nierie des Syst�mes d'Informations   |
--|                                                           |
--| Bureau G1-010           e-mail: pascal.obry@der.edfgdf.fr |
--| 1 Av G�n�ral de Gaulle  voice : +33-1-47.65.50.91         |
--| 92141 Clamart CEDEX     fax   : +33-1-47.65.50.07         |
--| FRANCE                                                    |
--|------------------------------------------------------------
--|
--|   http://ourworld.compuserve.com/homepages/pascal_obry
--|
--|   "The best way to travel is by means of imagination"

Redmond Urbino a �crit dans le message <3484A903.3943@bigfoot.com>...
>Does anybody know of a way to get opengl working with gnat in windows
>NT?
>
>Yes, the SGI version of gnat did have support for opengl, but it's
>not there in the NT version.
>
>I do have visual C++, and opengl there works fine.
>
>Is there a way to get gnat working with the microsoft .libs and
>.dlls ?
>
>Please reply by email.
>
>Thanks in advance.






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

end of thread, other threads:[~1997-12-03  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-12-02  0:00 GNAT and OPENGL in windows NT Redmond Urbino
1997-12-03  0:00 ` Pascal Obry
1997-12-03  0:00   ` Redmond Urbino

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