Page 2 of 2

Re: SDL2

PostPosted: Mon Nov 13, 2017 3:03 am
by Spindizzi
Re,
making a rapid build with only sdl_quit message (normal way from sdl2)
closing window works if rawinput not activated but if rawinput activated, keys and mouse don't work (hard to quit, must use task manager to kill task, lol)

no go with my option of mixing windows and sdl2 events

Re: SDL2

PostPosted: Mon Nov 13, 2017 11:49 am
by Bart
I just looked over the diff. It'll need some work to remove the SDL references bleeding into Model3/. All SDL stuff should be abstracted into the SDL sub-system only (OSD/ subdirectory). Most of it looks straightforward. I don't know anything about RawInput. Doesn't sound like fun :oops:

Re: SDL2

PostPosted: Sun Dec 03, 2017 5:26 pm
by Bart
Sorry for the radio silence but I've been very busy with my HoloLens projects. They're much more time consuming than I thought and I need to get them wrapped up this month. I built SDL2 on my machine the other day and will hopefully be able to look at this in the coming week or two. I'm unsure about how to handle the RawInput stuff. That may take a while to figure out. I'd hate to lose RawInput mode as it seems several people do use it for dual lightgun play.

Re: SDL2

PostPosted: Wed Jan 03, 2018 4:42 am
by luisfcorreia
Hey peeps!

I'm back for a little more digging into this very fine emulator.

What's the current status regarding migration to SDL2?

I can try and apply that large patch into current SVN trunk.

Cheers!

Happy new year

Re: SDL2

PostPosted: Fri Jan 05, 2018 6:21 pm
by Bart
Haven't had time to look at it again but I would really like to get this integrated. It seems that one obstacle was making sure RawInput still works as before. That is essential to dual mouse and keyboard support, which some people actually do use to play games like Lost World with friends.

Re: SDL2

PostPosted: Wed Apr 04, 2018 2:50 am
by Spindizzi
Hello,
Bart, if you have a little time to look at this...

So after applying sdl2 diff from Jason on svn722
As explained before, this leads to have a choice in DirectInputSystem.cpp (CDirectInputSystem::Poll())
either we use polling windows message method (PeekMessage)
->window closing cross box doesn't work (Supermodel.exe lostwsga.zip)
->rawinput works (Supermodel.exe -input-system=rawinput lostwsga.zip)
or we use polling sdl message method (SDL_PollEvent)
->window closing cross box works (Supermodel.exe lostwsga.zip)
->rawinput doesn't work (Supermodel.exe -input-system=rawinput lostwsga.zip)

I may have found a way to have all working normally
if we did that in the polling sdl message and by removing the window message process:

Code: Select all
SDL_Event e;
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); //disabled by default
while (SDL_PollEvent(&e))
   {
      if (e.type == SDL_QUIT)
         return false;    
      else if (e.type == SDL_SYSWMEVENT)
      {
         //SDL_SysWMmsg *wmMsg = e.syswm.msg;
         if (m_useRawInput)   ProcessRawInput((HRAWINPUT)e.syswm.msg->msg.win.lParam);
      }
   }


I've got that
->window closing cross box works (but not working in rawinput mode. I guess this is because mouses are captured in raw mode) (Supermodel.exe lostwsga.zip)
->rawinput works (Supermodel.exe -input-system=rawinput lostwsga.zip)

Does that sound right for you ?
++

-----------------------

Edit:

Re,
Ian, a question for you
what do you think of this video ?
look at shadow and light brakes
1st part is svn 722 with sdl1 (normal), 2nd part is svn 722 with sdl2
https://yadi.sk/i/TY7Z256F3U6Fxy
I got the same symptom when I tried sdl2, years ago. So when Jason posted the sdl2 diff, I checked the shadows and if I remember well, I didn't get this trouble. but now, problem returns
Very strange...
++

Re: SDL2

PostPosted: Wed Apr 04, 2018 8:07 am
by Ian
try peekmessage with PM_NOREMOVE

Re: SDL2

PostPosted: Wed Apr 04, 2018 8:47 am
by Spindizzi
I reverted my change to peekmessage instead of SDL_PollEvent but it's the same

Re: SDL2

PostPosted: Wed Apr 04, 2018 9:08 am
by Ian
I'll have a look when I have a bit
Been spending a bit of time trying to work out the crazy timing problems with supermodel, think I've made some progress. Well with the 2d layer anyway, not looked at the 3d layer yet

Re: SDL2

PostPosted: Wed Apr 04, 2018 10:16 am
by Spindizzi
Do not worry anymore about that
I restart the VC project from scratch, adding sdl2.0.0.8 to the project, adding mod from Jason and my mod from above, and all is ok now :P
I may have selected a wrong option in the old project (optimisation or other....)
++