PDA

View Full Version : image got cut off in window



whiack
05-31-2016, 01:07 PM
I am using cygwin on windows 7.
When I draw a grid on the screen. each element is a rectangle with a text above it.
The result will cut of the first line of the text. only show starting of the first line of rectangle.

I have moved the whole grid down and found out, the grid is too big, if I move it down to show the text, the bottom of the grid will be cut off.

Can I fix this by some set ups in my pfd or render context?( make it bigger to hold the whole image.), it seems the window is missing the top part of it. everything start on positin x = -1, y = 1; if I change y = 0.5 the beginning of the image will start from the middle-ish of the window

Here is how I set up my pfd.

static PIXELFORMATDESCRIPTOR pfd = {
sizeof (PIXELFORMATDESCRIPTOR), // strcut size
1, // Version number
PFD_DRAW_TO_WINDOW | // Flags, draw to a window,
PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, // use OpenGL
PFD_TYPE_RGBA, // RGBA pixel values
36, // 32-bit color
0, 0, 0, // RGB bits & shift sizes.
0, 0, 0, // Don't care about them
0, 0, // No alpha buffer info
0, 0, 0, 0, 0, // No accumulation buffer
24, // 24-bit depth buffer
8, // No stencil buffer
0, // No auxiliary buffers
PFD_MAIN_PLANE, // Layer type
0, // Reserved (must be 0)
0, // No layer mask
0, // No visible mask
0 // No damage mask
};