GIDForums

Go Back   GIDForums > Computer Programming Forums > FLTK Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 05-May-2008, 04:01
ranjita ranjita is offline
New Member
 
Join Date: Apr 2008
Posts: 3
ranjita is on a distinguished road

To load jpeg or bitmap files using fltk & opengl


i am using gentoo flavour of linux and need to load jpeg fiile as textures using fltk.(preferably on a gl-window)

Have tried this simple example:

CPP / C++ / C Code:
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Shared_Image.H>
#include <FL/Fl_JPEG_Image.H>
#include <FL/Fl_Box.H>

int main() {
    fl_register_images();                       // initialize image lib
    Fl_Window     win(720,486);                 // make a window
    Fl_Box        box(10,10,720-20,486-20);     // widget that will contain image
    Fl_JPEG_Image jpg("/var/tmp/foo.jpg");      // load jpeg image into ram
    box.image(jpg);                             // attach jpg image to box
    win.show();
    return(Fl::run());
}


i downloaded the FL_JPEG_Image.H as the header file was not there on my pc i also found that this file in turn required Fl_Image.H file so downloaded that too.

i get the following error messages for the Fl_Image.H file:

'Fl_Widget' has a previous declaration here
and class FL_EXPORT Fl_Image ---->invalid function declaration

have included the fltk images also.
wondering what modifications should header files require?i am using fltk-2.0.x-r5750

any help on this one?
Last edited by cable_guy_67 : 05-May-2008 at 04:23. Reason: Please surround your C++ code with [cpp] your code [/cpp]
  #2  
Old 05-May-2008, 04:20
ranjita ranjita is offline
New Member
 
Join Date: Apr 2008
Posts: 3
ranjita is on a distinguished road

Re: To load jpeg or bitmap files using fltk & opengl


forgot to mention the other error message previous to the ones stated before :

for class Fl_Widget;

i get the error as using typedef-name 'Fl_Widget' after 'class'
  #3  
Old 05-May-2008, 04:26
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,102
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough

Re: To load jpeg or bitmap files using fltk & opengl


Hello and Welcome to GIDForums™ FLTK Forum ranjita.

You are using 1.1 code with 2.0. I use 1.3 myself (which is the future of 1.1) so can't give you an example off the top of my head.

If someone else doesn't help out I'll see what I can do later tonight.

Mark
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #4  
Old 06-May-2008, 07:27
ranjita ranjita is offline
New Member
 
Join Date: Apr 2008
Posts: 3
ranjita is on a distinguished road

Re: To load jpeg or bitmap files using fltk & opengl


counting on you:-)
 

Recent GIDBlogNon-US citizens serving in the military by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenGL in Normal FLTK Windows automatedreason FLTK Forum 2 25-Apr-2008 05:44
[Tutorial] GUI programming with FLTK dsmith FLTK Forum 10 03-Oct-2005 15:41
FLTK and OpenGL bgarisn FLTK Forum 2 27-Jun-2005 06:22
GIMcontacts - a gim fltk fluid venture cable_guy_67 FLTK Forum 0 14-Feb-2005 14:18

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 20:04.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.