From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,baa28c83dcb4b216 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: OpenGL Texture mapping Date: Fri, 17 Dec 2004 09:32:50 +0100 Organization: None Message-ID: <61297206.dXk3falXKh@linux1.krischik.com> References: <1243716.dEx2WVfu6a@linux1.krischik.com> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8Bit X-Trace: news.t-online.com 1103274256 04 3646 W-F+X0VOao1a9Kx 041217 09:04:16 X-Complaints-To: usenet-abuse@t-online.de X-ID: V909TTZLweWFvdUoGG7j8HaZbptM-o6+bZ7u153mHu7yoKRoJbESEL User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:7024 Date: 2004-12-17T09:32:50+01:00 List-Id: Alfredo Macias wrote: > Sorry for the confusion, I only included what I thought was the most > relevant code, but that is just a part of it. > > Data : Data_Buffer_Type; is actually an incoming parameter to this > procedure where I'm trying to do the texture mapping. > Which means that Data was originally instantiated by the caller and > initialized to values read from a bitmap file, so by the time Data is > received by my texture mapping procedure, Data actually contains 256*256 > bytes with the bitmap data. (I have output its contents as text and > manually verified it for correctness right before my call to > Gl.GlTexImage2D). > > So other than that, does anything else look incorrect? No! But tell you the truth: before I would post a statement like this to c.l.a I would break it up - one function call at a time - and store all intermediate result in temporary variables. declare: X0 : .... renames Data(1)(1); X1 : System.Address := X0'Address; X2 : .... := Gl_Pointer_Conversions.To_Pointer (X1) X3 : .... := Gl.Glpointer��(X2) begin ������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), ��������������.... => X3); end That way you get a more meaningfull errror message. Also better if you ever need to use the debugger. And no difference in perfomace once the optimizer found out that each variable is only used once. The GNAT optimizer will actually tell you that all variables are "constant". BTW: you should name the parameters when there are more then three - I you need to read your code in half a year you'll be gratefull for it ;-) . With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com