comp.lang.ada
 help / color / mirror / Atom feed
From: "Maxim Reznik" <max1@mbank.com.ua>
Subject: Re: Ada and OpenGL
Date: Mon, 1 Oct 2001 08:56:59 +0300
Date: 2001-10-01T06:00:26+00:00	[thread overview]
Message-ID: <9p90ok$2l93$1@news.kiev.sovam.com> (raw)
In-Reply-To: 3BB4EB06.FCED0102@ida.his.se


"Michael Andersson" <a98mican@ida.his.se> wrote in message news:3BB4EB06.FCED0102@ida.his.se...
> Hi!
> Could somebody please show me how to use the glGetString function with
> Ada?
> I get Storage Error every time and I guess it has to do with illegal
> memory access.
>
> Thanks in advance!
> /Michael Andersson

I use this code:

with gl; use gl;
with glut; use glut;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Ada.Unchecked_Conversion;
with Text_IO; use Text_IO;

procedure GL_Test is

  function to_char_ptr
    is new Ada.Unchecked_Conversion( GLubytePtr, chars_ptr);

  procedure PrintInfo is
  begin
    Put("VENDOR=");
    put_Line( Value(
               to_char_ptr( glGetString( GL_VENDOR ) )));
  end;


  type chars_ptr_ptr is access Interfaces.C.Strings.chars_ptr;


  argc : aliased integer;
  pragma Import (C, argc, "gnat_argc");

  argv : chars_ptr_ptr;
  pragma Import (C, argv, "gnat_argv");


    win: Integer;
  begin

     glutInitDisplayMode(GLUT_RGB or GLUT_DEPTH or GLUT_DOUBLE);
     glutInit (argc'access, argv);
     win:=glutCreateWindow("test 1");
     PrintInfo;

end;






  parent reply	other threads:[~2001-10-01  5:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-28 15:22 Ada and OpenGL Michael Andersson
2001-09-28 18:59 ` Ted Dennison
2001-10-01  5:56 ` Maxim Reznik [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-10-14 16:31 Ada and OPenGL Alfredo Macias
2003-10-18 21:58 ` chris
2014-07-14  0:44 ada and opengl pincerfae
2014-07-14  4:03 ` Nasser M. Abbasi
2014-07-15 18:58   ` pincerfae
2014-07-14  8:18 ` Luke A. Guest
2014-07-14 18:56 ` pincerfae
2014-07-15 19:21 ` Marius Amado-Alves
2014-07-15 23:09   ` pincerfae
2014-07-15 23:15   ` pincerfae
2014-07-16  6:20     ` Niklas Holsti
2014-07-16 14:49     ` Stephen Leake
2014-07-16 16:52     ` Luke A. Guest
2014-07-16 19:37     ` gautier_niouzes
2014-07-20  0:31       ` pincerfae
2014-07-20 11:23         ` Stephen Leake
2014-07-20 19:46           ` pincerfae
2014-07-20 21:50             ` gautier_niouzes
2014-07-21 14:45             ` Stephen Leake
2014-07-21 18:42               ` pincerfae
2014-07-16 10:13 ` francois_fabien
replies disabled

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