ceti (ceti++at++worldnet.net)
Mon, 10 Feb 1997 17:45:33 +0000
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,....)"
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
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:37 PDT