Re: Last about glDrawPixel

New Message Reply Date view Thread view Subject view Author view

Tom McReynolds (tomcat++at++proxima.asd.sgi.com)
Mon, 10 Feb 1997 15:40:10 -0800


On Feb 10, 5:45pm, ceti wrote:
> Subject: Last about glDrawPixel
> This morning I had time to try what I received las week.
>
> to sum up:
> I ned to display a bitmap in a navigation app but when the lower left
> corner of the bitmap was outside the window glRasterPos was out with
> negatives values.
>
> So I got two ways to do this:
>
> first was :
>
> "glDrawPixels() can get an address which is inside the image, not only the
> corner itself. In your case, you can calculate the pixel that should be drawn
> to the lower left corner of the viewport, and send its address within the
image
> to glDrawPixels. You should specify what is the row length of the image, so
> that OpenGL can skip to the next row of pixels, to the same x position. You
> specify the row length with glPixelStorei (GL_PACK_ROW_LENGTH, row_length)."
>
> this is ok but needs a few tests to be safe.
> In Some cases you have the bitmap repeated ( when you play at the upper
> right corner)
>
> Second was :
>
> "static GLubyte pseudoBitmap[] = { 0 };
> glRasterPos3f( 0.0, 0.0, 0.0 );
> glBitmap(1, 1, 0.0, 0.0, xoffset, yoffset, pseudoBitmap);
> glDrawPixel(sizex,sizey,....)"

It is even easier than that:

        glBitmap(0, 0, 0.f, 0.f, xoffset, yoffset, NULL);

will let you place the raster position where you want. This is not a hack;
glBitmap was designed to let you do a call like the one above.

                -Tom

>
> I was really septic about the succes of this method, but I tried:
> conclusion: Oh god, it works! and not only for glbitmap but also for
glimages.
> No tests if offset is <0 or >0, don't care about RGB or RGBA !!
>
> well done benedikt !
> ( all my apologies for doubting )
> ==================================================================
> _/_/ _/ _/_/_/ _/ _/ _/_/_/ _/_/_/ _/_/_/
> _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
> _/ _/ _/ _/ _/ _/ _/ _/_/_/ _/_/_/
> _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
> _/_/ _/_/_/ _/_/_/ _/ _/_/_/ _/_/_/ _/ _/
>
> BILLARD Olivier - Engineer R&D - C&I Software
> 1 avenue de la mer - 44380 PORNICHET - FRANCE
> Tel: +33 2 40 11 68 72 Fax: +33 2 40 61 68 14
> Email: ceti++at++worldnet.net URL:http://www.worldnet.net/~ceti
> =================================================================
> \\\|||///
> \\ - - //
> ( ++at++ ++at++ )
> +----------------oOOo-(_)-oOOo----------------------+
> | " We don't inherit the world from our ancestors, |
> | it's only a loan from our children ." |
> | Antoine de Saint Exupery. |
> +-------------------------Oooo----------------------+
> oooO ( )
> ( ) ) /
> \ ( (_/
> \_)
>
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-- End of excerpt from ceti

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:37 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.