|
|
On 4/25/21 7:54 AM, Ian MacArthur wrote:
On 25 Apr 2021, at 11:50, holm.haavard wrote:
I am to load and draw a jpeg image in OpenGL.
Does any have routines for loading the jpeg ? Do fltk have
code for that ?
Check Greg’s examples - probably starting with this one:
Should be easy to go from there to something that works as
you want.
Yes, good call to use texture mapped rectangles.
Also, I think openGL still has a "bit blit" function that lets
one slap a rectangle
of pixels directly from Fl_JPEG_Image's RGB
buffer to the openGL screen using
glDrawPixels(). Be sure to get the pixel format
right when using that, to ensure
RGB byte ordering of glDrawPixels() is set to match the jpeg
image buffer's
data format.
The nice thing about texturemapping the image is you get image
zoom for
free; just move the rectangle around as needed. It even will
integrate into
your openGL scene properly in 3D. Just keep the texture
rectangle pointed
at the camera.
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/0531c580-fd7b-f1ba-74ab-c5eb2595a3e9%40seriss.com.
[ Direct Link to Message ] | |
|
| |