[brlcad-commits] SF.net SVN: brlcad: [30437] brlcad/trunk/src/libfb/if_ogl.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <bo...@us...> - 2008-02-28 14:43:46
|
Revision: 30437 http://brlcad.svn.sourceforge.net/brlcad/?rev=30437&view=rev Author: bob1961 Date: 2008-02-28 06:43:51 -0800 (Thu, 28 Feb 2008) Log Message: ----------- Finished the pixel selection feature. Modified Paths: -------------- brlcad/trunk/src/libfb/if_ogl.c Modified: brlcad/trunk/src/libfb/if_ogl.c =================================================================== --- brlcad/trunk/src/libfb/if_ogl.c 2008-02-28 08:49:55 UTC (rev 30436) +++ brlcad/trunk/src/libfb/if_ogl.c 2008-02-28 14:43:51 UTC (rev 30437) @@ -2184,19 +2184,23 @@ { int x, y; int ix, iy; - unsigned char cp[3] = {0}; + register struct ogl_pixel *oglp; x = event.xbutton.x; - y = event.xbutton.y; + y = ifp->if_height - event.xbutton.y; if (x < 0 || y < 0) { fb_log("No RGB (outside image viewport)\n"); break; } - fb_log("At image (%d, %d), real RGB=(%3d %3d %3d) UNIMPLEMENTED\n", - x, y, cp[RED], cp[GRN], cp[BLU]); + oglp = (struct ogl_pixel *)&ifp->if_mem[ + (y*SGI(ifp)->mi_memwidth)* + sizeof(struct ogl_pixel) ]; + fb_log("At image (%d, %d), real RGB=(%3d %3d %3d)\n", + x, y, (int)oglp[x].red, (int)oglp[x].green, (int)oglp[x].blue); + break; } case Button3: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |