comp.lang.ada
 help / color / mirror / Atom feed
From: "Alfredo Macias" <alfredom@sbceo.org>
Subject: OpenGL Texture mapping
Date: Thu, 16 Dec 2004 10:45:14 -0800
Date: 2004-12-16T10:45:14-08:00	[thread overview]
Message-ID: <cpsl3q$s7b2@cui1.lmms.lmco.com> (raw)

Hi all,
I'm working on an Ada project that renders 3D graphics.
While I'm using openGl with no problems for 3D graphics, I'm trying to
implement texutre mapping.  I'm getting the code for texture mapping from a
working CPP project.  However, I'm having trouble getting the translated
code to compile in Ada.  Here is the code:
--------------------------------------
type Unsigned_Char_Type is new Interfaces.C.Unsigned_Char;
type Pix_Color_Type   is array (1 .. 3) of aliased Unsigned_Char_Type;
type Data_Buffer_Type is array (Positive range <>) of aliased
Pix_Color_Type;

Width : Integer := 256;
Height: Integer := 256;
Data :  Data_Buffer_Type;

------------------------------------
      Gl.GlTexImage2D(
              Gl.Gl_TEXTURE_2D,
              Gl.Glsizei(0),
                Gl.Pixelformatenm'(Gl.Gl_Rgb),
                Gl.Glsizei(Width),
                Gl.Glsizei(Height),
              Gl.Glsizei(0),
                Gl.Pixelformatenm'(Gl.Gl_Rgb),
                Gl.Pixeldatatypeenm'(Gl.Gl_Unsigned_Byte),
                Gl.Glpointer
                      (Gl_Pointer_Conversions.To_Pointer
                             (Data(1)(1)'Address)));
-----------------------------------------------------
This is the nasty message I recevie from the compiler; which tells me close
to nothing.
(A also tried without type casting, but got the same message)

1/2: COMP    graphics.platforms.renderers(body) rsd/adalib

  2498:       Gl.GlTexImage2D(
              ---------------- ...
  2509:                              (Data(1)(1)'Address)));
                                     ----------------------
>>> SEMANTIC: Unresolvable expression <8.3, 8.6:28> <RM83 8.3, 8.7:3>

Any ideas why this code is not compiling?
Any help would be greatly appreciated.






             reply	other threads:[~2004-12-16 18:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-16 18:45 Alfredo Macias [this message]
2004-12-16 20:15 ` OpenGL Texture mapping tmoran
2004-12-16 21:33 ` Martin Krischik
2004-12-17  1:09   ` Alfredo Macias
2004-12-17  8:32     ` Martin Krischik
replies disabled

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