jjgl's picture

OpenTK.Graphics.GraphicsContextException

Project:The Open Toolkit library
Version:1.0-2010-10-06
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

My software, which use OpenTK 1.0.0-rc1, can not start at some computers. The error messages are as following. Anyone know how to fix the problem? Kindly thanks ahead.

OpenTK.Graphics.GraphicsContextException: Requested GraphicsMode not available. SetPixelFormat error: 87

at OpenTK.Platform.Windows.WinGLContext.SetGraphicsModePFD(GraphicsMode mode, WinWindowInfo window)

at OpenTK.Platform.Windows.WinGLContext..ctor(GraphicsMode format, WinWindowInfo window, IGraphicsContext sharedContext, Int32 major, Int32 minor, GraphicsContextFlags flags)

at OpenTK.Platform.Windows.WinFactory.CreateGLContext(GraphicsMode mode, IWindowInfo window, IGraphicsContext shareContext, Boolean directRendering, Int32 major, Int32 minor, GraphicsContextFlags flags)

at OpenTK.Graphics.GraphicsContext..ctor(GraphicsMode mode, IWindowInfo window, Int32 major, Int32 minor, GraphicsContextFlags flags)

at OpenTK.WinGLControl.CreateContext(Int32 major, Int32 minor, GraphicsContextFlags flags)

at OpenTK.GLControl.OnHandleCreated(EventArgs e)

at System.Windows.Forms.Control.WmCreate(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ContainerControl.WndProc(Message& m)

at System.Windows.Forms.UserControl.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hannesh's picture

#1

Can it be that you are trying to do something on hardware that doens't support it?

jjgl's picture

#2

I am trying to find out if the problem is caused by hardware. The software run on a few computers. With the computer the software did not start, it runs window XP, using ATI 2400 graphics card. However, it runs on another computer with same ATI 2400 graphics card. So this may be not the source of problem. Any help will be surely appreciated. Thanks!

hannesh's picture

#3

According to X-Plane forums the SetPixelFormat error 87 is caused by the color depth of the computer itself being set to 16 bit.
Can you verify that the computer it's broken on is set to 32-bit colors (true color)?

jjgl's picture

#4

I checked. That computer is set to 32 bit colors. Any other possiblities?

jjgl's picture

#5

The problem has been solved in 1.0 branch. Cheers!!

the Fiddler's picture

#6

Status:open» fixed

Issue fixed in r2713.

texel's picture

#7

I have the same error( SetPixelFormat error: 87) with OpenTK 1.0 rc1 since last week
it worked perfectly before on the same PC. Maybe i have updated something on my PC, but OpenGL C++ applications and DirectX C++ applications continue to work very well.
Is the problem solved in the svn dev version only ?

the Fiddler's picture

#8

Yes. I'll be pushing out an update next week or so.

the Fiddler's picture

#9

Version:1.0.0-rc1» 1.0-2010-10-06
Status:fixed» closed

Closing issues fixed in opentk-1.0-2010-10-06 release.

anathema's picture

#10

One of my beta-testers is seeing a very similar error. The call-stack is identical to the one above, except that the error-code being reported by Marshal.GetLastWin32Error() is zero...which isn't terribly helpful of it :-)