forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

opengl_printer, opengl_printer

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
sefiroths



Joined: 17 Nov 2009
Posts: 10

PostPosted: Fri Oct 28, 2011 2:13 pm    Post subject: opengl_printer, opengl_printer Reply with quote

i have lines drawn with a %og opengl window.
i'd like to print the image displayed, so i have found these functions:
opengl_printer@(1,'GL_somebits',iw,ih)
opengl_printer@(1,.false.)
this sequence of functions prints a all black image...
any ideas?
Back to top
View user's profile Send private message
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Fri Oct 28, 2011 3:10 pm    Post subject: Reply with quote

I never had any success with opengl_printer@ either.

I use a work around. I convert the OpenGL graphics into a bitmap file. I can then either print the bitmap file using OPEN_PRINTER@ and DIB_PRINT@ or it is simple to create pcx, jpg files or place the graphics in the clipboard.

This is a cut down of my routine to create a bitmap file of the OpenGL display:-

Code:

      include <clearwin.ins>,nolist
      include <opengl.ins>,nolist

      CHARACTER*(*) bit_map_file
      CHARACTER*1   ImageData(3*(kw_ogl+3)*kh_ogl),
     *              ImageDib(3,kw_ogl,kh_ogl)

      ImageData=' '
      ImageDib =' '

      call glReadPixels(0,0,kw_ogl,kh_ogl,GL_RGB,
     *GL_UNSIGNED_BYTE,ImageData)

      koff=mod(kw_ogl,4)

      kount=0

        do j=1,kh_ogl

            do i=1,kw_ogl

                do k=1,3
                  kount=kount+1

                  ImageDib(k,i,kh_ogl-j+1)=ImageData(kount)
                end do

            end do

          kount=kount+koff
        end do

      call put_dib_block@(bit_map_file,ImageDib,
     *kw_ogl,kh_ogl,0,0,kw_ogl,kh_ogl,24,ierr)

_________________
John Horspool
Roshaz Software Ltd.
Gloucestershire
Back to top
View user's profile Send private message Visit poster's website
sefiroths



Joined: 17 Nov 2009
Posts: 10

PostPosted: Fri Oct 28, 2011 5:01 pm    Post subject: Reply with quote

thanks for the answer, but i have a opengl window of 800x600, the image will be 800x600...right?
if i want i very high definition image?
say 4000x3000?
Back to top
View user's profile Send private message
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Fri Oct 28, 2011 6:23 pm    Post subject: Reply with quote

Get a very high definition monitor, or use GDI graphics ?
_________________
John Horspool
Roshaz Software Ltd.
Gloucestershire
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Fri Oct 28, 2011 10:42 pm    Post subject: Reply with quote

MSDN has a big section on printing OpenGL, and windows extensions, but I can't make head nor tail of it. Just Google OpenGL printing ...

E
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Mon Oct 31, 2011 12:50 am    Post subject: Reply with quote

To achieve a 4000x3000 screen resolution, I define a virtual screen and then use it as the active screen, using:
i = create_graphics_region@ (hd_handle, w_width, w_depth)
i = select_graphics_object@ (hd_handle)
I then dump the virtual screen to a .gif file for later printing.

I recall some testing that there are some practical limits to increasing the size beyond this (5000x3800 might not work), although even moderately higher resolution does look very good.

This is all done in a %gr graphics environment.
There may be an equivalent for OPENGL

John
Back to top
View user's profile Send private message
JohnHorspool



Joined: 26 Sep 2005
Posts: 270
Location: Gloucestershire UK

PostPosted: Mon Oct 31, 2011 11:55 am    Post subject: Reply with quote

A quick google search came up with this:-

http://www.ucancode.net/Visual_C_Control/OpenGL-tutorial-print-preview-vc.htm

which appears to be the OpenGL equivalent for off screen (virtual) rendering. Although getting this up and running in FTN95 is beyond my capability.

Anyone else care to show how it's done?
_________________
John Horspool
Roshaz Software Ltd.
Gloucestershire
Back to top
View user's profile Send private message Visit poster's website
sefiroths



Joined: 17 Nov 2009
Posts: 10

PostPosted: Fri Nov 04, 2011 4:49 pm    Post subject: Reply with quote

thanks for answers, i'll post results of my trying
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group