comp.lang.ada
 help / color / mirror / Atom feed
* OpenGL Texture mapping
@ 2004-12-16 18:45 Alfredo Macias
  2004-12-16 20:15 ` tmoran
  2004-12-16 21:33 ` Martin Krischik
  0 siblings, 2 replies; 5+ messages in thread
From: Alfredo Macias @ 2004-12-16 18:45 UTC (permalink / 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.






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

end of thread, other threads:[~2004-12-17  8:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-16 18:45 OpenGL Texture mapping Alfredo Macias
2004-12-16 20:15 ` tmoran
2004-12-16 21:33 ` Martin Krischik
2004-12-17  1:09   ` Alfredo Macias
2004-12-17  8:32     ` Martin Krischik

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