PDA

View Full Version : glWindowPos does not change the position if rendering to dib (not to screen window)



amaltsev
02-13-2017, 07:51 AM
Hi,

to briefly describe: I use OpenGL in a MS MFC class (CWnd is a base class). For drawing a frame around my scene I use glWindowPos2i to directly specify the points in window coordinates. Anything works fine until I render the scene and the frame directly to the screen. For printing I use a dib section first and then transfer the dib section drawn to the printer device context. Unter Microsoft I am enforced to use GLEW to invoke glWindowPos2i.
It seems that glWindowPos2i works for screen renderiong only, not for rendering to dib section.

For example the following code:

int params[10];
glGetIntegerv(GL_CURRENT_RASTER_POSITION, params);
glWindowPos2i(0, 0);
glGetIntegerv(GL_CURRENT_RASTER_POSITION, params);


If I observe in the debugger watch (MS VS 2015) the values of params while Rendering directly to the screen the values params[0], params[1], params[2] are indeed all zero.
If I do it while rendering to dib section some other values remain unchanged.

Is it a problem of GLEW? Any suggestions?