Coder Social home page Coder Social logo

Comments (10)

discosultan avatar discosultan commented on August 11, 2024

This has also been requested before so I will probably take a look at it sometime soon.

There shouldn't be any showstoppers since only the embedded effect needs to be recompiled for OpenGL. There's just the overhead of having to manage multiple projects/build configurations for multiple platforms.

from quake-console.

ianhattendorf avatar ianhattendorf commented on August 11, 2024

Sounds good, I might be able to take a look at it in the near future as well if I get some free time. I'm not sure how you're handling building and publishing to nuget right now, but there are ways you can automate your build and deploy that would certainly help.

from quake-console.

discosultan avatar discosultan commented on August 11, 2024

I've made available QuakeConsole and PythonInterpreter for DesktopGL through Nuget:
MonoGame.QuakeConsole.DesktopGL
MonoGame.QuakeConsole.PythonInterpreter.DesktopGL

Source code now contains separate solution and project files for WindowsDX and DesktopGL platforms.

Note that I have not tested this running on Mono!

from quake-console.

ianhattendorf avatar ianhattendorf commented on August 11, 2024

Great, I'll take a look later today.

One thing I noticed is that some of the projects are targeted for x86 instead of AnyCPU. Any particular reason for this? This locks anyone using these packages to x86 as well.

from quake-console.

discosultan avatar discosultan commented on August 11, 2024

Only because MonoGame project template defaulted to x86. I can't think of any reason why it can't be AnyCPU instead. Will change this at some point.

Edit: I've update all the build configurations to AnyCPU and cleaned up solution files.

from quake-console.

ianhattendorf avatar ianhattendorf commented on August 11, 2024

Awesome, everything is running great on Windows. I ran into 2 issues with the Python Interpreter while running on OS X, mono v4.2.3.4.

  1. Occasionally, ParamInfos are null here:
    https://github.com/discosultan/quake-console/blob/master/Interpreters/PythonInterpreter/TypeLoader.cs#L132
    Adding if (memberInfo.ParamInfos[i] == null) continue; fixes this, however I don't know if there's another issue this is ignoring.
  2. For some reason it's trying to from System import Int32& which is throwing an exception due to trying to import the type name with the '&' reference at the end. Adding .TrimEnd('&') after type.Name here:
    https://github.com/discosultan/quake-console/blob/master/Interpreters/PythonInterpreter/TypeLoader.cs#L154
    fixes this, however again this seams like it's just hiding another issue.

Any ideas? I could submit a PR with those fixes however I'm not sure that's the best course of action.

from quake-console.

discosultan avatar discosultan commented on August 11, 2024

Thanks for testing on Mono!

  1. Seems to be an interesting issue to do with the combination of using null propagation with extension method (a bug in Mono?). The code snippet memberInfo.ParamInfos[i]?.ForEach should fulfill the same purpose as if (memberInfo.ParamInfos[i] != null) memberInfo.ParamInfos[i].ForEach but that doesn't seem to be the case. I suspect due to the fact that ForEach is defined as an extension method here. It's a very minor syntactic sugar thing and the extension method should probably be removed altogether if it causes such issues.
  2. Seems to be a subtle difference in the type system. The & symbol most probably defines a reference type (in your case, a pass by ref int). Easiest course of action is to simply trim the symbol like you suggested. That should functionally behave as expected, it's just that the types might be loaded twice in that case (for example, once for regular Int32 and once for Int32&). That shouldn't be an issue, though.

I've also added the Python interpreter unit tests project for DesktopGL sln. I'll see if I can somehow use Visual Studio to build the tests using XBuild targeting Mono assemblies.


Edit: I managed to successfully run the tests on Mono and catch the first issue. I put a fix already in.

I am unable to reproduce the second issue, though. @ianhattendorf, do you know which Type was loaded which caused the Int32& Type to be loaded? Type loading is recursive, so it might have shown up many levels deep. I would love to write a test for this case.

from quake-console.

ianhattendorf avatar ianhattendorf commented on August 11, 2024

I ran into the issue when adding the GraphicsDeviceManager as a variable. I also ran into the issue with a class I created with the property public bool Enabled { get; set; } = true; trying to load a Boolean&.

It could be unique to OS X and possibly Linux, are you testing on Windows?

from quake-console.

discosultan avatar discosultan commented on August 11, 2024

I'm testing on Windows. I'll take another shot at it tomorrow and if am unable to reproduce then I'll simply trim the ampersand from type name as you suggested.


Edit: Could not reproduce. Added type name trimming.

from quake-console.

discosultan avatar discosultan commented on August 11, 2024

Closing since supported. Has not been tested on other platforms than Windows though.

from quake-console.

Related Issues (9)

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.