Fix multisampling in DesktopGL#7338
Fix multisampling in DesktopGL#7338harry-cpp merged 3 commits intoMonoGame:developfrom sk-zk:desktopgl-enable-multisampling
Conversation
|
Couldn't you pass the |
|
You could, but then you'd have to store that in a member variable until CreateDevice is called. Idk if that's a good idea. |
|
Everything else in Constructor is the only thing that happens before the main window gets created and some other window related things need to be set from it. We were gonna implement the window recreation at some point, but that was/is too low on the priority list. |
|
I see. I've updated the PR |
|
Actually you have the |
|
Unless its a partial void with half of the method missing XD |
|
PreparingDeviceSettings happens after PlatformInitialize, that's the issue |
|
Yea, I now see why it was so problematic, modify CreateDevice in GDM to do the following, that should do the trick: var gdi = DoPreparingDeviceSettings();
if (!_initialized)
Initialize(gdi);
CreateDevice(gdi); |
|
That'll do it |
|
Big thanks @sk-zk ! Merging! |
This reverts commit 8fc0155.
* Apply Multisampling to the SDL window * Call DoPreparingDeviceSettings before Init in GDM
|
I've been testing Monogame 3.8.1.303 and I am not able to enable multi-sampling on Windows DesktopGL Cross platform project, the same code base works on DirectX Windows, is this really fixed in the latest version of Monogame? or I am missing something? |
|
Sorry for necrobumping, but I'm experiencing the exact same issue, also on version 3.8.1.303. Has there been any development on this? @OtherStuffThatSpam did you find a solution? |
|
Experiencing the same issue on 3.8.1.303 |
This is a quick and dirty fix to make multisampling work in DesktopGL.
The problem seems to be that OpenGL doesn't let you change the multisampling params after the window has been created, so they need to be passed to SDL before that point, in
PlatformInitialize(). There was no way for the user to do that though because setting params viagraphics.GraphicsDeviceor through thePreparingDeviceSettingsevent are too late sincePlatformInitialize()has already run. To deal with this, I added another event that is raised right beforePlatformInitialize()so the user can pass the multisample count at that point.The game code for enabling multisampling would look like this: