Git Product home page Git Product logo

Comments (39)

Thraka avatar Thraka commented on May 18, 2024 1

The branch name is engine-rewrite

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

AFAIK there shouldn't be much to do to support UWP, it should just be new projects that build out UWP libraries that use the nuget package for monogame uwp. Possibly some of the file loading routines would need to change, unsure though.

However, I'm in the middle of a refactor (that is 90% complete) over in this branch https://github.com/Thraka/SadConsole/tree/engine-rewrite

This will actually be moving around projects and files to try and sort things better. If you could wait a few days, I'll have that structure locked down and committed to that branch, then if you wanted to contribute, you could take a crack at creating new libraries to support it 😄

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

And thanks for the praise 👍

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

Sounds great! I'll follow your progress.

BTW, I start porting trunk (i.e. "master") yesterday; got almost compiled but now have an issues with serializer and file loading, need to dig a little inside the issue.

BTW, most of the code is UWP-compatible except interface IDataContractSurrogate and a few methods and functions but it shouldn't be a problem.

P.S. I do have some plans to release a couple of funny apps for W10/WM10 (and maybe Xbox) :)

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

When I looked at porting to .NET Core, I noticed IDataContractSurrogate was missing and not coming anytime soon. So in the new branch that is removed. I was using it to make sure that when you serialized a type in SadConsole who used MonoGame, you could then load it into SadConsole using SFML. But I removed SFML support.

It would be neat to see something released with SadConsole.

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

My copy of Visual Studio is being dumb. Can you test something for me? Apparently..... unknown to me... I can actually just compile a single SadConsole no matter the specific graphics system MonoGame targets. Once you have the SadConsole.dll, you use SadConsole in your game, and choose whatever MonoGame version (like UWP) you want, and it will work....

I just tried locally with OpenGL, DirectX, and Android with the same SadConsole DLL and it was fine. However, UWP projects are complaining when I try to create them. Can you try without using your version of SadConosle?

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

Definitely will do! Can get my hands on code today (was busy) but yesterday I've got stuck on rendering issues :( Standard template creates SwapChainPanel and using it as a MonoGame "screen" (for rendering). But current MonoGame code have a bug (or I don't know how to properly use it) and SwapChainPanel component reference isn't available during graphics driver initialization. I made some "hardcoded" fixes but issue just moved from one code line to another.

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

Is this pre-sadconsole init?

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

So please send me your version for test, whole solution (zipped) to [email protected]

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

I'm just using the master branch for these tests

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

I've modified MonoGame :) Yeah, I know it's not good but it was done just for test purposes. Actually, MonoGame has some issues with W10 UWP. Actually, sources from master branch didn't work at all, from develop is working with some fixes. BTW, NuGet package is working fine with template-based W10 UWP.

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

BTW, Andy, you may contact me via instant messenger (if you want) or skype chat (sens.boston at gmail.com or sens_boston). Also, it's a midnight in Boston now ;)

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

I checkout both branches, master & develop. For some reasons, master branch don't work for me (by generating empty app by using template).

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

No worries, sync tomorrow

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

Updated the engine-rewrite branch. Folder structure is complete and there is a single DLL for each library. In the solution there are two starter projects, one targeting DX and another GL. Both work fine.

Few things I still need until this branch is merged and takes over master

  • Asset loading for fonts - Not totally sure how yet, I have an idea.
  • Automatic Window Centering needed to be removed, Need tutorial added on how you can do that per platform
  • sample games need updates
  • Rewrite mouse input (not related to this multiplatform effort
  • Add gamepad input system

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

I'm kinda get stuck :(

MonoGame standard XAML template creates instance of the XamlGame with the type of your descendant of Microsoft.Xna.Framework.Game, and point render device to the SwapChainPanel control surface, provided in the constructor.

public sealed partial class GamePage : Page
{
   readonly Game1 _game;
   public GamePage()
   {
   this.InitializeComponent();

   // Create the game.
   var launchArguments = string.Empty;
   _game = MonoGame.Framework.XamlGame<Game1>.Create(launchArguments, Window.Current.CoreWindow, swapChainPanel);
    }
}

But SadConsole.Engine creates own Microsoft.Xna.Framework.Game (SadConsoleGame); I can't re-use previously created GraphicsDevice & GraphicsDeviceManager in the SadConsoleGame. Tried many things but without success :(

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

Are you using the engine-rewrite branch?

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

No, I still working with master. Should I switch to engine-rewrite? Will try now...

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

I've done changes to how the Game class is loaded and how the GraphicsDevice/DeviceManager are created. this may be more compatible with these types of scenarios. Let me look at my code base and see if I have anything to upload to github

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

OK, I'll try and let you know.

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

If you look at src/SadConsole.Root/Graphics.MonoGame/Game.cs you can see that I sort of hide the constructor and use a static Create method. But, the way I've reimplemented the MonoGame stuff, all the logic for rendering/input/etc are all handled by the src/SadConsole.Root/Graphics.MonoGame/SadConsoleGameComponent.cs class. So it's easy for you to create your own Game class now. You can inherit from the game class provided by SadConsole instead, or just in your own game class, make sure you do what is done in the Initialize method.

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

I pushed a commit to engine-rewrite so make sure you sync

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

Hmm, the very first issue: I can't re-use your refactored libraries :( In the master branch, I created Windows Universal Class libraries and added shared code; here (at engine-rewrite) I should remove your libraries and create new UWP versions.

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

Oh yes, lol. I got rid of the shared system because it was overhead for 0 gain.

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

Yeah, but if I've got somehow W10 UWP working, it will be huge overhead :)

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

you should be able to reference my libraries without any problem

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

No, VS 2015 don't let me to add these libraries :(

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

let me try and repair my visual studio and see what i can figure out

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

These tags

<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier> 
<TargetPlatformVersion>10.0.14393.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.10586.0</TargetPlatformMinVersion>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />

are missing.

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

Actually, it's possible to do some "magic" with conditional defines in the .csproj files but I'm unsure...

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

visual studio is slow

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

Yeah, I know! Don't ask my why I know that :(

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

I got things fixed up. I see the odd issues now you're talking about with the projects.. arrggg why cant they make it easy! 👎 I guess there is no getting away from the shared library.

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

Yeah, but shared code isn't a problem; my patch for W10 UWP for master branch is perfectly fit your solution architecture (I've added new folder, Projects.UWP and added a few conditional defines to some source code), but real problem is incompatibility between MonoGame.Framework's UWP project template and your architecture.

MonoGame creates new game , descendant of XamlGame, which one correctly initializes GraphicsDeviceManager and GraphicsDevice for usage with SwapChainPanel.
Your solution unconditionally creates a new game (static SadConsoleGame MonoGameInstance), descendant of MonoGame.Framework.Game, and try to create new GraphicsDevice (without reference to SwapChainPanel). Of course, if we already have a GraphicsDevice initialized, second one will fail all the time.

Could you show me a sample, how to avoid re-creation of GraphicsDeviceManager & GraphicsDevice and have your nice console work with the current properly initialized descendant of MonoGame.Framework.Game?

Yes, probably, "Starter project" is too complicated for that refactoring; maybe I can get something very simplified (what I need for my goals, it's just an one console, in XAML UWP, with ANSI codes support etc.)

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

I'm working towards that 😁 I just did a push to the engine-rewrite branch that has the shared library back. I merged all 4 libraries (Core, Ansi, GameHelpers, Controls) into a single library. There are two built libraries now, One for non-universal apps, and one for universal apps. Check out src/DemoProject/UniversalApp for a working project. I don't have the "starter project" stuff integrated into that because I'm pretty busy at work right now. But I wanted to unblock you for sure.

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

Okey dokey, great, big thanks! Definitely will try tonight. And take your time, don't worry, it can wait definitely...
P.S. I'm thinking about "programmer's toy", simple app for W10/W10M with editor and console, where user can write C#, or VB, or JS code (i.e. any language supported by .NET runtime) and get immediate results on your console, with Esc-sequences, colors etc. Something like lightweight "Visual Studio" for enthusiasts...

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

yeah that would be cool!

from sadconsole.

sensboston avatar sensboston commented on May 18, 2024

Wow, you da man! Terrific work! Here is screenshot from my Lumia-950, arm build for W10M

wp_ss_20170207_0001

So, it's enough for me (at least to start my new app programming). Hope, you'll find a time in the future, to release new engine with NuGet UWP support.

Thanks one more time!

from sadconsole.

Thraka avatar Thraka commented on May 18, 2024

It will be within the next few weeks for sure 😁

from sadconsole.

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.