andykorth / Pencil.Gaming

An open-source, cross-platform gaming library for C# with bindings for OpenGL, OpenAL, and GLFW.
136 stars 35 forks source link

Mouse over window causing crash. #20

Closed delaneyj closed 10 years ago

delaneyj commented 11 years ago

On a mouse move over a window during a call to Glfw.PollEvents(); this exception is occurring.

System.AccessViolationException was unhandled HResult=-2147467261 Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Source=Pencil.Gaming StackTrace: at GameBox.Program.Main(String[] args) in c:\data\test\Program.cs:line 52 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:

Is there some state that has to be initialized before inputs are valid and Glfw.PollEvents();can take place?

antonijn commented 11 years ago

You need to call Glfw.Init() first, and depending on the GLFW version, either Glfw.OpenWindow or Glfw.CreateWindow.

antonijn commented 10 years ago

Since you seem to show no further interest in resolving the problem and I haven't been able to reproduce, I'll close it...