|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
sefiroths
Joined: 17 Nov 2009 Posts: 10
|
Posted: Fri Oct 28, 2011 2:13 pm Post subject: opengl_printer, opengl_printer |
|
|
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 |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Fri Oct 28, 2011 3:10 pm Post subject: |
|
|
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 |
|
|
sefiroths
Joined: 17 Nov 2009 Posts: 10
|
Posted: Fri Oct 28, 2011 5:01 pm Post subject: |
|
|
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 |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Fri Oct 28, 2011 6:23 pm Post subject: |
|
|
Get a very high definition monitor, or use GDI graphics ? _________________ John Horspool
Roshaz Software Ltd.
Gloucestershire |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Fri Oct 28, 2011 10:42 pm Post subject: |
|
|
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 |
|
|
JohnCampbell
Joined: 16 Feb 2006 Posts: 2560 Location: Sydney
|
Posted: Mon Oct 31, 2011 12:50 am Post subject: |
|
|
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 |
|
|
JohnHorspool
Joined: 26 Sep 2005 Posts: 270 Location: Gloucestershire UK
|
Posted: Mon Oct 31, 2011 11:55 am Post subject: |
|
|
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 |
|
|
sefiroths
Joined: 17 Nov 2009 Posts: 10
|
Posted: Fri Nov 04, 2011 4:49 pm Post subject: |
|
|
thanks for answers, i'll post results of my trying |
|
Back to top |
|
|
|
|
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
|