FLTK logo

Re: [fltk.general] Loading jpeg images in OpenGL

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Loading jpeg images in OpenGL Greg Ercolano Apr 25, 2021  
 

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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.