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?
opengl_printer, opengl_printer
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:-
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)
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?
Get a very high definition monitor, or use GDI graphics ?
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
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
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?
thanks for answers, i'll post results of my trying