I'm using a SimpleOpenGLControl (found in the Tao framework), with C#, and it's attached to a Windows Form. Pixel format seems to be normal:
Gdi.PIXELFORMATDESCRIPTOR pfd = new Gdi.PIXELFORMATDESCRIPTOR();// The pixel format descriptor
pfd.nSize = (short) Marshal.SizeOf(pfd); // Size of the pixel format descriptor
pfd.nVersion = 1; // Version number (always 1)
pfd.dwFlags = Gdi.PFD_DRAW_TO_WINDOW | // Format must support windowed mode
Gdi.PFD_SUPPORT_OPENGL | // Format must support OpenGL
Gdi.PFD_DOUBLEBUFFER; // Must support double buffering
pfd.iPixelType = (byte) Gdi.PFD_TYPE_RGBA; // Request an RGBA format
pfd.cColorBits = (byte) colorBits; // Select our color depth
pfd.cRedBits = 0; // Individual color bits ignored
pfd.cRedShift = 0;
pfd.cGreenBits = 0;
pfd.cGreenShift = 0;
pfd.cBlueBits = 0;
pfd.cBlueShift = 0;
pfd.cAlphaBits = 0; // No alpha buffer
pfd.cAlphaShift = 0; // Alpha shift bit ignored
pfd.cAccumBits = accumBits; // Accumulation buffer
pfd.cAccumRedBits = 0; // Individual accumulation bits ignored
pfd.cAccumGreenBits = 0;
pfd.cAccumBlueBits = 0;
pfd.cAccumAlphaBits = 0;
pfd.cDepthBits = depthBits; // Z-buffer (depth buffer)
pfd.cStencilBits = stencilBits; // No stencil buffer
pfd.cAuxBuffers = 0; // No auxiliary buffer
pfd.iLayerType = (byte) Gdi.PFD_MAIN_PLANE; // Main drawing layer
pfd.bReserved = 0; // Reserved
pfd.dwLayerMask = 0; // Layer masks ignored
pfd.dwVisibleMask = 0;
pfd.dwDamageMask = 0;
Complete window code, if needed.
windowForm = new Form();
windowForm.ClientSize = new Size( ScreenWidth, ScreenHeight );
windowWidth = windowForm.Width;
windowHeight = windowForm.Height;
windowForm.Icon = null;
windowForm.Text = windowTitle;
windowForm.FormClosing += new FormClosingEventHandler( windowForm_FormClosing );
windowForm.Resize += new EventHandler( windowForm_Resize );
// Window mode specific settings
// Changes borders/control boxes/etc
switch( mode )
{
case WindowMode.Windowed:
windowForm.FormBorderStyle = FormBorderStyle.FixedSingle;
windowForm.MaximizeBox = false;
windowForm.MinimizeBox = false;
break;
case WindowMode.Fullscreen:
Resolution.CResolution changeRes = new Resolution.CResolution( screenWidth, screenHeight );
windowForm.FormBorderStyle = FormBorderStyle.None;
windowForm.WindowState = FormWindowState.Maximized;
windowForm.TopMost = true;
break;
case WindowMode.WindowScalable:
windowForm.FormBorderStyle = FormBorderStyle.Sizable;
break;
case WindowMode.BorderlessWindow:
windowForm.FormBorderStyle = FormBorderStyle.None;
break;
}
// Initialize the OpenGL graphics device
glDevice = new SimpleOpenGlControl();
glDevice.Location = new Point( 0, 0 );
glDevice.Size = new Size( screenWidth, screenHeight );
glDevice.InitializeContexts();
windowForm.Controls.Add( glDevice );
// Set up OpenGL
Gl.glMatrixMode( Gl.GL_PROJECTION );
Gl.glOrtho( 0, screenWidth, screenHeight, 0, -1, 1 );
Gl.glMatrixMode( Gl.GL_MODELVIEW );
Gl.glClearColor( 1, 1, 1, 1 );
// Enable transparency
Gl.glBlendFunc( Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA );
Gl.glEnable( Gl.GL_BLEND );
// We're done setting up, so the program is running
running = true;
// Show the created window
windowForm.Show();