Coder Social home page Coder Social logo

Comments (13)

prime31 avatar prime31 commented on May 28, 2024

Thats a bit odd. I can't seem to repro this. Moreover I would expect the issue to happen in the TouchInput class.. If you stick a breakpoint in there is that method returning?

from nez.

brandc87 avatar brandc87 commented on May 28, 2024

Okay so it tries to run:
_isConnected = TouchPanel.GetCapabilities().IsConnected;
and fails because user32.dll is not found :/

screen shot 2016-06-29 at 23 51 40

I've tried to search for a similar problem but seems no-one has had this happen?

from nez.

brandc87 avatar brandc87 commented on May 28, 2024

Okay this fixes it, seems DesktopGL doesn't like TouchPanel on OS X not sure about windows? Although you are using OS X are you not?

#if !___IOS___ || !___ANDROID___ || !FNA
            _isConnected = false;
#else
            _isConnected = TouchPanel.GetCapabilities().IsConnected;
#endif

from nez.

prime31 avatar prime31 commented on May 28, 2024

I am indeed on OS X and it seems to work for me. Very odd. I'll wrap it up in the next commit just to be safe. The only downside is that it will end up requiring separate DLLs if not building from source for iOS/Android vs desktop. I think MonoGame's next release will finally have runtime platform check so that would solve it more gracefully.

from nez.

brandc87 avatar brandc87 commented on May 28, 2024

Possibly something different in Xamarin 6.0 to 6.0.1? That's the only thing that is different between our setups that I can think of.

from nez.

prime31 avatar prime31 commented on May 28, 2024

I just pushed a commit that does things a bit differently and requires manually enabling touch support. See if it solves it for you.

from nez.

brandc87 avatar brandc87 commented on May 28, 2024

Yeah working fine with that commit! Will test a touch device shortly but only had issue's on my mac regarding this. Thanks.

from nez.

prime31 avatar prime31 commented on May 28, 2024

It seems to work on Mac, Windows and iOS for me so hopefully this does the trick.

from nez.

DebugDax avatar DebugDax commented on May 28, 2024

Hello,

This issue is plaguing me. I'm new to Monogame and C#, but not Visual Studio so I know somewhat of what i'm doing.

I cloned the samples, built Nez/Nez.sln, then when I open Nez.Samples and attempt to run it I get:

An unhandled exception of type 'System.TypeInitializationException' occurred in Nez.dll
Additional information: The type initializer for 'Nez.Input' threw an exception.

It points to Scene.cs:656 which is
Input._resolutionScale = new Vector2( scaleX, scaleY );

OS: Windows 10 x64
IDE: Visual Studio Community 2015

I see that you mentioned a fix above, I applied that to enableTouchSupport() and it still throws the error. I've even just set _isConnected = false so it wouldn't do anything with it and it still throws the exception mentioned from the original submitter.

from nez.

prime31 avatar prime31 commented on May 28, 2024

A TypeInitializationException will hide the underlying problem. Put a breakpoint in the Input initializer and see what the real exception is and where it is occurring.

from nez.

DebugDax avatar DebugDax commented on May 28, 2024

Hi,

I'm not sure how to read the output of that breakpoint. It seems to be pointing all over the place.

nez_error

Is this an issue with something i've done, or the repo? I haven't done any modifications other than the previously mentioned fix, so this is an error straight out of the box.

MonoGame SDK 3.5.1
XNA Redist 4.0 Refresh

from nez.

prime31 avatar prime31 commented on May 28, 2024

There shouldn't be any need to change the base code at all. A fix was pushed in a recent commit that moves touch stuff into its own method until MonoGame gets a fix out.

It's impossible to say what is happening here without the actual Exception. Stick a breakpoint in the Input constructor and step through there. That will reveal the actual error that is occurring.

from nez.

prime31 avatar prime31 commented on May 28, 2024

Closing this one since it seems like it is all fixed up.

from nez.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.