shorowit's picture

bitsPerPixel: Must be greater than zero.

Project:The Open Toolkit library
Version:1.1-2014-01-02
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

We have a user of our .NET application that hits the following error whenever he launches our app.

How can we fix/diagnose the problem? I am happy to provide any additional information that will help.

Thanks,
Scott

--------------------------------

The type initializer for 'OpenTK.DisplayDevice' threw an exception.

Stack Trace:
at OpenTK.DisplayDevice.get_Default()
at OpenTK.Graphics.GraphicsMode.get_Default()
at OpenTK.GLControl..ctor()
at NREL.BEopt.BEoptUIVB.GeometryControl.InitializeComponent()
at NREL.BEopt.BEoptUIVB.GeometryControl..ctor(BEoptCase& aCase, Boolean reset)
at NREL.BEopt.BEoptUIVB.CaseTabPage..ctor(BEoptCase aCase, Boolean CaseForNewProject, Int32 CaseTabNum, Int32 width, Int32 height)

Inner Exception:

Source:
OpenTK

TargetSite:
Void .ctor()

Message:
The type initializer for 'OpenTK.Platform.Windows.WinDisplayDeviceDriver' threw an exception.

Stack Trace:
at OpenTK.Platform.Windows.WinDisplayDeviceDriver..ctor()
at OpenTK.Platform.Windows.WinFactory.CreateDisplayDeviceDriver()
at OpenTK.DisplayDevice..cctor()

Inner Exception:

Source:
OpenTK

TargetSite:
Void .ctor(Int32, Int32, Int32, Int32, Int32, Single)

Message:
Must be greater than zero.
Parameter name: bitsPerPixel

Stack Trace:
at OpenTK.DisplayResolution..ctor(Int32 x, Int32 y, Int32 width, Int32 height, Int32 bitsPerPixel, Single refreshRate)
at OpenTK.Platform.Windows.WinDisplayDeviceDriver..cctor()


Comments

Comment viewing options

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

#1

Status:open» closed (invalid)

Don't know what changed, but the user no longer gets this error.

shorowit's picture

#2

Version:1.0.0-rc1» 1.x-dev
Status:closed (invalid)» open

Just had another user report this problem. I'm using the latest nightly build now, so the error still occurs in the svn code.

the Fiddler's picture

#3

Version:1.x-dev» 1.1-dev
Status:open» fixed

This issue appears to affect dual-GPU systems ("Optimus")

A workaround has been committed to https://github.com/thefiddler/opentk/commit/03c04fd308556cf4a5aa5660f44f...

Please reopen if this can be still reproduced.

the Fiddler's picture

#4

Version:1.1-dev» 1.1-2014-01-02
Status:fixed» closed

Closing bugs fixed in OpenTK 1.1.

If this is still an issue, please file a new bug report at https://github.com/opentk/opentk/issues