Re: printing with MFC/OpenGL
Varun Bansal <[email protected]>
| Newsgroups | gmane.games.devel.opengl |
|---|---|
| Organization | Fat City Network Services, San Diego, California |
| Message-ID | <[email protected]> |
Hi, In the If() part you are doing rendering for printer, but in the else part you are drawing on the screen, but I don't know why have you set the DrawBuffer to GL_BACK in the else part. I think you have to set it to GL_FRONT then you will see a different background color. Varun. On Sun, 27 Mar 2005 11:08:24 -0800, Rhadamés Carmona <[email protected]> wrote: > Hey Guys > > The problem is only in print preview.... might be I am doing something > wrong. It prints in the printer good. > > Regards > Rix > > ----- Original Message ----- > To: "Multiple recipients of list OPENGL-GAMEDEV-L" > <[email protected]> > Sent: Sunday, March 27, 2005 1:58 PM > > > Hi Guys > > > > I do not want to print with background color = black. Because of that, I > > change background color (to white), in the last rendering for printing. > > > > OnDraw > > > > if (pDC->IsPrinting()) > > { > > glDrawBuffer(GL_BACK); > > glClearColor(1,1,1,1); > > glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); > > RenderScene(); > > glFlush(); > > glReadBuffer(GL_BACK); > > glReadPixels(0,0,vpWidth,vpHeight,GL_RGB, GL_UNSIGNED_BYTE, > > buffer); > > //... > > // swapbuffers here > > } > > else > > { > > glDrawBuffer(GL_BACK); > > glClearColor(1,0,1,1); > > glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); > > //... > > } > > > > > > I do not know, why the print preview has black background... I have not > > printed the image yet, but I think if the print preview has black > > background, the printed image will. > > > > I am using CG fragment program for rendering. > > > > THX > > Rix > > > > ----- > > FAQ and OpenGL Resources at: > > http://www.geocities.com/SiliconValley/Hills/9956/OpenGL > > > > -- > > Author: =?iso-8859-1?Q?Rhadam=E9s_Carmona?= > > INET: [email protected] > > > > Fat City Hosting, San Diego, California -- http://www.fatcity.com > > --------------------------------------------------------------------- > > To REMOVE yourself from this mailing list, send an E-Mail message > > to: [email protected] (note EXACT spelling of 'ListGuru') and in > > the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L > > (or the name of mailing list you want to be removed from). You may > > also send the HELP command for other information (like subscribing). > > ----- > FAQ and OpenGL Resources at: > http://www.geocities.com/SiliconValley/Hills/9956/OpenGL > > -- > Author: =?iso-8859-1?Q?Rhadam=E9s_Carmona?= > INET: [email protected] > > Fat City Hosting, San Diego, California -- http://www.fatcity.com > --------------------------------------------------------------------- > To REMOVE yourself from this mailing list, send an E-Mail message > to: [email protected] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). > ----- FAQ and OpenGL Resources at: http://www.geocities.com/SiliconValley/Hills/9956/OpenGL -- Author: Varun Bansal INET: [email protected] Fat City Hosting, San Diego, California -- http://www.fatcity.com --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [email protected] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).