GLUT + Printer

Started by
3 comments, last by MatrixCubed 20 years, 9 months ago
Hey all, I''ve got kind of a weird question. I am developing a Windows OpenGL application for someone, and it will be necessary to be able to send the contents of the screen to a printer. Right now, I am using GLUT, because the application will have to eventually be ported to other OSes, thus I am trying to cut down on some of the coding. I have some code (thanks MSDN!) that I can use to send HDC data to the printer. So far so good, except that GLUT does not expose Windows HWNDs (which are required for the HDC code, above). I know I can enumerate available desktop windows and get the HWND from that, but is there a more elegant way to get the active HWND? Thanks, MatrixCubed
http://MatrixCubed.cjb.net
Advertisement
you could save the "printout" into a file on the harddisk and use another windows program to print that file
our new version has many new and good features. sadly, the good ones are not new and the new ones are not good
The difficulty is in obtaining that "printout" for the file, which is done through GetDC and related GDI functions, which initially require a valid HWND.




MatrixCubed
http://MatrixCubed.cjb.net

Perhaps you could use glReadPixels?
To get the hwnd to the current window you can use ::GetForegroundWindow I think.

This topic is closed to new replies.

Advertisement