MonoGame.Forms - Create your Editor Environment!

I tried the demo latest version from github. but why it’s flickering? (Solved with latest version)

Hey @11110 and thanks for reporting this issue!

Fortunately this bug was only in the test project of MonoGame.Forms and I already fixed it.

Just download the new version from GitHub and you are good to go.

All the NuGet packages and the core libraries are still working as before.

Cheers! :slight_smile:

PS: Can you please delete the flickering image from your last post? Because some people have problems with seeing flickering images. This would be very polite :wink: Thank you very much!

2 Likes

Thanks for update :slight_smile:

1 Like

anyway to increase draw interval in directx? current is only 60fps

There is no built-in solution.

Currently the game loop of MonoGame.Forms is simply attached to the Application.Idle event (See explanation on StackOverflow).

will it possible to have built-in interval control in the future?

There is a built-in intervall for the OpenGL version. But even if you set it to 1ms the fps are around 60fps.

It would be the same for the WindowsDX version of the library, because the content already renders as soon as the application enters the idle state. This at least leads to a smooth editing experience.

But i’m always open to see different approaches, when they are practical enough.

But without it, it will be hard to measure the potential framerate. Is there any other option without using idle state

Hello Sir sqrMin1^_^y may I ask how do you set GraphicsProfile to HiDef when in winform where there is no Game instance and can’t create a GameDeviceManager ?

Heyya @DexterZ :wink:

Take a look at this post (expand it to see a picture):

In MonoGame.Forms this is a property since v1.5.7. You can set it during design time.

2 Likes

Cool that was fast… I’ll take a look… many thanks Sir ^_^y

Early Celebration - 10k views!

Despite the fact that MonoGame.Forms birthday is in November, we have already reached 10.000 views here in the MonoGame community!

I want to thank you all for your support and great suggestions / ideas to make this library more awesome by doing a recap with some important milestones and stats we’ve achieved.

So… Let’s start!


MonoGame.Forms library recapitulation

  • Age: 11 Months
  • Support: 11 Months

Stats:

MonoGame Community:

  • 10.000 Views
  • 62 Likes on:
  • 142 Replies with:
  • 36 Minutes estimated read time and:
  • 95 Links posted

GitHub:

  • 270 Commits
  • 51 Stars
  • 155 Wiki Pages
  • 18 Releases
  • ~840 Views (per month)
  • ~150 Unique Visitors (per month)

NuGet:

MonoGame.Forms (old Core):

  • 2014 Total Downloads
  • 6 Downloads Per Day (avg)

MonoGame.Forms.DX:

  • 204 Total Downloads
  • 2 Downloads Per Day (avg)

MonoGame.Forms.GL:

  • 161 Total Downloads
  • 2 Downloads Per Day (avg)

Most Important Milestones:

GitHub Releases:

  • Native Mouse & Keyboard Input [ 1.5 ]
  • Window Resizing [ 1.6 ]
  • Antialising (MSAA) [ 1.6.5.3 ]
  • Render Target Manager (DX) [ 1.6.7.1 ]
  • DirectX and OpenGL (Multi Platform Support) [ 2.0 ]
  • Audio Support [ 2.1 ]

I hope you enjoyed this little recap and that you raise a little glass or two! :beers: :coffee: :tea: :tropical_drink: :grin:

Have a nice day and take care! :heart:

Long live MonoGame.Forms! (hrhrhr)

7 Likes

Hi, sqrMin1. Here’s the situation I bumped into when following github’s README.md:
vs2017 complained that it can’t instantiate abstract class MonoGame.Forms.Controls.DrawWindow when adding DrawTest into toolbox.

Hey @Jack-Ji and thanks for your message!

I just tried the tutorial from the Readme with Visual Studio 2017 and for me it works.

Please try to delete any possible references from the designer class and close visual studio. Reopen it and clean & rebuild your solution. Then try again to place the generated DrawTest control directly onto the form.

Trying this with VS17 helped me to find a different (and interesting) bug by the way:

I don’t know why it is like that but when creating a MonoGame control the OnCreateControl() function is getting called 2 times instead of 1 time like in VS15, but the second time it getting called the ClientSize.Width and ClientSize.Height are both 0, which leads to a -> System.ArgumentOutOfRangeException: “Texture width must be greater than zero” in the SwapChainRenderTarget ctor.

For me this is a weired behavior of VS17. Does anyone know why VS17 is doing this? Would be nice to know.

Anyway, I will push a fix soon by checking that the ClientSize is greater than 0 before creating the control.

Edit: The fix is up! Corresponding nuget packages are updated accordingly.

Hey @BlizzCrafter, thanks for your response!

I’ve tried several things including what you said, it seems after close and reopen vs2017 and rebuild solution solves the problem.

And the vs2017 still complains about instantiation error of abstract class MonoGame.Forms.Controls.DrawWindow when double clicking DrawTest.cs. Looks like the instantiation error has nothing to do with toolbox adding, a little annoying though.

Edit: Another problem worth mentioning: vs2017 won’t stop debugging after window is closed.

Ah, I see what you did there :smiley: This is normal behavior, because you shouldn’t double click on that class to open it. Instead you should do a right click and choose “show code”, or click one time with the left mouse button and press “F7” to see the code of this control class.

For me it stops debugging instantly when closing the window. Maybe you have different tasks open or high cpu usage?

Ah, I see what you did there
This is normal behavior, because you shouldn’t double click on that
class to open it. Instead you should do a right click and choose “show
code”, or click one time with the left mouse button and press “F7” to
see the code of this control class.

@BlizzCrafter, there’s an actual convention to fix that - I have no idea WTF it is because I’ve never done that. It’s along the same lines as the other service stuff in a winform and I’m a WPF person myself (winforms is too inferior to MFC in performance to bother with - beyond just 2 orders of magnitude … as I call it, the land of flicker).

It does exist however.

Thanks for the hint, I will seach for it.

Oh, this sound really bad. You mean when rendering stuff, right? I experienced the same with WinForms and some smaller applications. There are also techniques to avoid flickering like double buffering and such.

At least with the MonoGame.Forms library you don’t need wory about flickerin, but as an interesting fun fact: When you use the double buffering technique in a MonoGame.Forms project then you are again in the land of flicker :smiley:

I wish I remembered what it was, I know it’s there because it was covered when I did MCAD ages ago. I’ll have to see if I have the textbooks around still - though I suspect I chucked them for being ancient and no longer relevant.

That’s the problem with winforms, a constant ping-pong fight with flickering. I absolutely loved Sony’s ATF library, hands down the best WinForms library/app-skeleton out there, but buddha does it flicker something fierce.

1 Like

Forgive my ignorance, how can I create a new SpriteFont for use with MonoGame.Forms?

I understand the code however I am not clear on
how to properly add the SpriteFont so it is recognized by the project.

DrawFont = Editor.Content.Load(“DrawFont”);

Is the Pipeline tool still useful?