Results 1 to 7 of 7

Thread: beginner's question

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    3

    beginner's question

    Hello, i am a biginner, am just starting OpenGL. i saw examples of the 2-d and 3-d pictures using OpenGL. I would appreciate if someone let know whether it is possible to save such pictures, that are seen on the screen, into the graphical files (eps, png, jpeg etc.)? thanks.

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    592

    Re: beginner's question

    You can write your own snapshot code, or you can use an external snapshot program. What you choose to do is up to you.

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    3

    Re: beginner's question

    Hi, does anybody know how to write the snapshot code from within c++, that is what kind of libraries should one should use, or may be there are other ways of writing snapshot codes ? i would appreciate if you let know, may be, the references and the web-sites. thanks.

  4. #4
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: beginner's question

    Use glReadPixels to get the rendered data, then any image I/O library to write this as a file.
    This one can do many formats : http://freeimage.sourceforge.net/
    If you are fine with only one format, you can directly use libs such as libpng, libjpeg, etc.

  5. #5
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    3

    Re: beginner's question

    freeimage looks interesting and promising.
    Does anybody know how to save rendered data in EPS format ? what kind of libraries one has to use ? or may be to write eps-file by your own ? thanks.

  6. #6
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: beginner's question

    GraphicsMagick can read/write any file format.

  7. #7
    Senior Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    592

    Re: beginner's question

    This is easiest and the best, there's also a stb_image_write.h file on the same site:

    http://nothings.org/stb_image.c

    I always use a screen capture program btw. If you are a noob and don't have much to show anyhow, why bother with the additional workload of writing snapshot code.

Similar Threads

  1. Beginner question
    By grsabourin in forum OpenCL
    Replies: 1
    Last Post: 01-04-2016, 03:18 AM
  2. A very beginner's question
    By hayden in forum OpenGL: General
    Replies: 5
    Last Post: 01-28-2013, 09:23 AM
  3. Beginner's question - using DLL
    By rys in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-25-2005, 05:35 PM
  4. Replies: 1
    Last Post: 03-18-2004, 05:10 PM
  5. Beginner's question, please, please, help me
    By in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 07-10-2000, 02:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean