summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl/window.cpp
Commit message (Collapse)AuthorAgeFilesLines
* osd/windows, osd/sdl: Only check for hold/drag conversion on losing pointer ↵ Vas Crabb2024-11-181-1/+1
| | | | if it hasn't already happened.
* sdl/window.cpp: Remove assert(0 <= info->clickcnt) (#12951) ajrhacker2024-11-151-3/+1
|
* -osd: Update slider list on demand rather than on frame updated (fixes MT08857). Vas Crabb2024-04-271-24/+0
| | | | -konami/konamigq.cpp: No need to cancel a newly allocated timer.
* Initial touch input support: Vas Crabb2024-04-121-18/+354
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Feed mouse/pen/touch pointer events through UI input manager with Win32 and SDL. * Started migrating UI code to use new API and reworking mouse/touch interaction. * emu/render.cpp: Support pressing multiple clickable layout items simultaneously. * emu/render.cpp: Allow UI elements to be drawn in any window. * emu/rendlay.cpp, luaengine_render.cpp: Added layout view events for pointer input. * ui/ui.cpp: Allow the UI handler to control pointer display. * ui/analogipt.cpp: Added mouse/touch and more keys for navigating field state list. * ui/menu.cpp: Use vertical swipe to scroll and horizontal swipe to adjust. * ui/menu.cpp: Draw after processing input - greatly improves responsiveness. * ui/menu.cpp: Ignore keyboard/gamepad input during pointer actions. * ui/selmenu.cpp: Made left/right info pane arrows repeat when held. * ui/selmenu.cpp: Use middle click to move keyboard focus. * ui/selmenu.cpp: Let filter list scroll if it's too tall, and use a bit of horizontal padding. * ui/selmenu.cpp: Improved divider sizing. * ui/state.cpp: Don't allow clicks to pass through the confirm deletion prompt to the menu. * ui/simpleselgame.cpp: Fixed error message display and graphics/sound status not showing. * ui/simpleselgame.cpp: Allow tap/click to dismiss error message. * ui/utils.cpp: Show UI for choice filters when there are no choices - it's less confusing. * modules/input/input_sdl.cpp: Made scaling for mouse scroll better match RawInput and DirectInput. * modules/input/input_rawinput.cpp: Added support for horizontal scroll axis. * modules/input/input_win32.cpp: Added support for scroll axes and more buttons to mouse/lightgun. * modules/debugger/debugimgui.cpp: Don't fight over events with the UI manager - it breaks menus. * osd/windows/window.cpp: Translate mouse position to window cooridinates for scroll wheel events. * osd/sdl/window.cpp: Supply last mouse position for scroll wheel events if possible. * scripts/build/complay.py: Made zero input mask an error - it was only being used to block clicks.
* -osd/mac, osd/sdl: Show prescale popup when it hasn't changed due to hitting ↵ Vas Crabb2024-02-181-1/+1
| | | | | | | | | the limit. * This makes it easier to see that you’ve hit the limit and MAME isn't just ignoring your keystrokes. -emu/inpttype.ipp: Restored tabulation.
* sdl modify_prescale: don't indicate max value hap2024-02-171-1/+1
|
* osdsdl: move prescale keys from ctrl+f6/f7 to alt+f8/f9 hap2024-02-171-2/+2
|
* osd/sdl: Don't specify SDL_WINDOW_BORDERLESS for full-screen windows. (#11546) Davidian10242023-09-121-1/+1
| | | May address GitHub #7532 and #7922.
* osd: Cleaner way of dealing with input updates. Vas Crabb2023-02-231-2/+0
|
* osd: Removed support for SDL < 2.0.6; apple/apple2video.cpp: Code style ↵ Vas Crabb2023-02-211-22/+0
| | | | cleanups.
* osd: Turned video modules into actual modules, fixed various issues. Vas Crabb2023-02-011-118/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't ignore the return status of OSD module initialisation. Attempt to fall back to an alternate module if the selected module fails to initialise. Log more useful diagnostic information at verbose level. Fixed BGFX crash on exit after toggling fullscreen. Also persist more settings than just the selected chains across toggling fullscreen. Turned video modules into OSD modules in the same sense as all the other OSD modules. They now use the same selection/fallback mechanism as all the other modules without special extra code in the OSD implementations. Untangled some object ownership mess. Windows own renderers, OSD objects own windows. Fixed a refrence loop that caused the first window object to always leak. Don't create renderer object until after underlying window has been created. Fixed issues with order of creation/destruction when toggling fullscreen or changing prescale in fullscreen with -switchres in SDL builds. Use more smart pointers in BGFX and Direct3D render modules. Most of the code now reutrns a smart pointer when handing over ownership or a naked pointer when retaining ownership. Fixed a few leaks and simplified cleanup code. Encapsulated various OSD modules better.
* Various input and OSD refactoring: Vas Crabb2023-01-291-26/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | osd: Supply OSD object to modules on initialisation. Encapsulated some event handling in the OSD objects rather than leaving it in free functions. Put various stuff in namespaces. osd/modules/input: Enabled dinput, xinput and winhybrid modules for Windows SDL builds, and enabled background input for dinput and xinput (and by extension winhybrid) modules. Also fixed some COM and X11 resource leaks. osd/modules/input/input_sdl.cpp: Flipped SDL mouse button order to match Windows, and exposed vertical and horizontal scroll as Z and rZ axes. Moved SDL UI event handling out of input devices into OSD object. osd/modules/input_rawinput.cpp: Changed lightgun Z axis token so it's correctly identified as a relative axis (it maps to the scroll wheel equivalent). osd: Added an option to choose the network provider module. Mostly useful if you build with both TUN/TAP and pcap support included, or if you want to disable emulated networking completely. emu/input.cpp: Use a better strategy for assembling input code names that uses fewer temporary strings and doesn't require use of the non-Unicode-aware space trimming function (fixes MT08552). osd/modules/input_dinput.cpp: Improved polling logic. osd: Made various parts of the input code less dependent on concrete emu objects, and reduced inappropriately passing around the machine object. Made input modules less dependent on OSD implementation. Encapsulated some stuff and got rid of some vestigial newui and SDL1 support code. Cleaned up some interfaces. Moved OSD options classes to their own files. Prepare to remove main.h from emu.h - it's mostly used to get the application name, which the vast majority of emulated devices don't need to do.
* srcclean and manual tidying up in preparation for 0.242 release Vas Crabb2022-03-271-6/+6
|
* sdl/window: add error retval check for bgfx on fallback hap2022-03-251-3/+3
|
* sdl/window: fix possible compile problem with init fallbacks hap2022-03-171-3/+5
|
* Updated BGFX fixes; verified as working on Linux and Windows. (#9420) MooglyGuy2022-03-151-13/+41
| | | | | | | * -bgfx: Improved stability when encountering missing files, and improved multi-window stability. [Ryan Holtz] * -osd: Added video-init fallback functionality to other OSDs. [Ryan Holtz] * -bgfx: Fixed issues from the previous batch of changes. [Ryan Holtz] * -osdwindow: Remove no-longer-needed addition of post_create(). [Ryan Holtz]
* Revert "More BGFX stability improvements (missing files + multi-window) (#9410)" Vas Crabb2022-03-161-41/+13
| | | | This reverts commit f5b75b74393646d1dc082ec807279451dc481854.
* More BGFX stability improvements (missing files + multi-window) (#9410) MooglyGuy2022-03-141-13/+41
| | | | | * -bgfx: Improved stability when encountering missing files, and improved multi-window stability. [Ryan Holtz] * -osd: Added video-init fallback functionality to other OSDs. [Ryan Holtz]
* Correctly adjust window size based on the computed visible area for ↵ antonioginer2022-01-211-0/+10
| | | | different stretching cases. (#9140)
* Render-related cleanup AJR2021-12-301-0/+1
| | | | | | | - Undo inclusion of screen.h within render.h and update many source files that were stealth-including the former - Move texture_format enum to rendertypes.h - rendlay.h: Make a few methods static - ui/info.cpp: Use C++11-style iteration for render targets
* Correctly apply -keepaspect with -unevenstretchx/y. (#8209) antonioginer2021-07-021-6/+2
| | | | * Correctly apply -keepaspect with -unevenstretchx/y. Initialize window at the correct size when -intscalex/y is used. * Get correct window size upon maximizing/minimizing with integer scaling.
* -attach_window support for SDLMAME (#8070) npwoods2021-05-201-2/+60
|
* -A few incremental UI code improvements: Vas Crabb2021-03-121-11/+8
| | | | | | | | | * Simplified message when toggling UI controls. * Show actual configured UI toggle key, not misleading hard-coded text. * Push window activated/deactivated events to UI manager. * Simplified SDL window event handling code - events are pretty precise. -Miscellaneous code cleanup.
* -osd/windows: Minimise full-screen windows on losing focus (#2997). Vas Crabb2021-01-211-7/+1
| | | | | | | | -osd/modules/osdwindow.cpp: Clean up window title formatting. * Show data type model in window title. * Moved window title formatting to a single place. -tools/chdman.cpp: Removed some unnecessary .c_str() calls.
* osdwindow.cpp: Centralize basic functions; de-virtualize various getters AJR2021-01-041-84/+30
|
* Remove keepaspect and fullstretch members of osd_video_config AJR2020-12-161-3/+7
|
* Fairly significant overhaul of Lua engine and some cleanup. Vas Crabb2020-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The things that were previously called device iterators are not iterators in the C++ sense of the word. This is confusing for newcomers. These have been renamed to be device enumerators. Several Lua methods and properties that previously returned tables now return lightweight wrappers for the underlying objects. This means creating them is a lot faster, but you can't modify them, and the performance characteristics of different operations varies. The render manager's target list uses 1-based indexing to be more like idiomatic Lua. It's now possible to create a device enumerator on any device, and then get subdevices (or sibling devices) using a relative tag. Much more render/layout functionality has been exposed to Lua. Layout scripts now have access to the layout file and can directly set the state of an item with no bindings, or register callbacks to obtain state. Some things that were previously methods are now read-only properties. Layout files are no longer required to supply a "name". This was problematic because the same layout file could be loaded for multiple instances of the same device, and each instance of the layout file should use the correct inputs (and in the future outputs) for the device instance it's associated with. This should also fix video output with MSVC builds by avoiding delegates that return things that don't fit in a register.
* Got rid of global_alloc/global_free. Vas Crabb2020-10-031-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The global_alloc/global_free functions have outlived their usefulness. They don't allow consistently overriding the default memory allocation behaviour because they aren't used consistently, and we don't have standard library allocator wrappers for them that we'd need to use them consistently with all the standard library containers we're using. If you need to change the default allocator behaviour, you can override the new/delete operators, and there are ways to get more fine-grained control that way. We're already doing that to pre-fill memory in debug builds. Code was already starting to depend on global_alloc/global_free wrapping new/delete. For example some parts of the code (including the UI and Windows debugger) was putting the result of global_alloc in a std::unique_ptr wrappers without custom deleters, and the SPU sound device was assuming it could use global_free to release memory allocated with operator new. There was also code misunderstanding the behaviour of global_alloc, for example the GROM port cartridge code was checking for nullptr when a failure will actually throw std::bad_alloc. As well as substituting new/delete, I've made several things use smart pointers to reduce the chance of leaks, and fixed a couple of leaks, too.
* use C++ library includes (nw) firewave2020-01-221-1/+1
|
* osd/sdl/window.cpp: Remove misleading comments. (nw) couriersud2019-11-271-14/+0
|
* netlist: Revert development code committed by accident. (nw) couriersud2019-11-261-3/+0
|
* netlist: move nl_examples to src/lib/netlist/examples. (nw) couriersud2019-11-251-0/+3
| | | One folder less in the top-level.
* Remove up to one frame of input latency. (#5901) antonioginer2019-11-161-3/+0
| | | | | | | | | | * Remove up to one frame of input latency. Makes MAME virtually lagless on VRR monitors. * Use empty parentheses and clean interface member calls * Add new option -instant_blit to make this feature optional * Rename new option to -lowlatency, -ll
* Make osd_printf_* use util/strformat semantics. Vas Crabb2019-09-261-1/+4
| | | | | | | | | | | | | | | | | (nw) This has been a long time coming but it's here at last. It should be easier now that logerror, popmessage and osd_printf_* behave like string_format and stream_format. Remember the differences from printf: * Any object with a stream out operator works with %s * %d, %i, %o, %x, %X, etc. work out the size by magic * No sign extending promotion to int for short/char * No widening/narrowing conversions for characters/strings * Same rules on all platforms, insulated from C runtime library * No format warnings from compiler * Assert in debug builds if number of arguments doesn't match format (nw) Also removed a pile of redundant c_str and string_format, and some workarounds for not being able to portably format 64-bit integers or long long.
* Creating an -attach_window command line parameter on Windows to attach to an ↵ npwoods2019-08-041-0/+10
| | | | | | | | | | | | | | existing window (#5381) * Creating an -attach_window command line parameter on Windows to attach to an existing window * Moved -attach_window option to Windows-specific code * Created an osd_set_aggressive_input_focus() function and exposed to LUA * Created a dummy implementation of osd_set_aggressive_input_focus() for SDL
* Disable WII Lightgun hack by default (#5056) Kiall Mac Innes2019-05-141-1/+1
|
* Disable setting the SDL_WINDOW_OPENGL extra flag if -video none is set. ↵ Dustin Stahlback2018-10-091-1/+1
| | | | This allows a true headless run when the environment variable SDL_VIDEODRIVER=dummy is set prior to mame/mess execution.
* Fix debug assert failure when using SDL fullscreen toggle (nw) AJR2018-08-061-1/+1
|
* sdl: Add SDL_WINDOW_BORDERLESS for fullscreen, required by some window ↵ Olivier Galibert2017-06-251-1/+1
| | | | | | | | | | | managers on linux [O. Galibert] Breakage was in 8338e0d7a490c8d33f924b55582223e70015c195 (march 2015), and yes, fullscreen didn't work correctly for me since then. Shows how much I use it, I guess. FWTW my window manage is the venerable fvwm2. CourierSud, if you happen to remember why you changed that (in the middle of a lot of other changes), let me know, and we'll see how to make it work for everybody.
* Move static data out of devices into the device types. This is a ↵ Vas Crabb2017-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | significant change, so please pay attention. The core changes are: * Short name, full name and source file are no longer members of device_t, they are part of the device type * MACHINE_COFIG_START no longer needs a driver class * MACHINE_CONFIG_DERIVED_CLASS is no longer necessary * Specify the state class you want in the GAME/COMP/CONS line * The compiler will work out the base class where the driver init member is declared * There is one static device type object per driver rather than one per machine configuration Use DECLARE_DEVICE_TYPE or DECLARE_DEVICE_TYPE_NS to declare device type. * DECLARE_DEVICE_TYPE forward-declares teh device type and class, and declares extern object finders. * DECLARE_DEVICE_TYPE_NS is for devices classes in namespaces - it doesn't forward-declare the device type. Use DEFINE_DEVICE_TYPE or DEFINE_DEVICE_TYPE_NS to define device types. * These macros declare storage for the static data, and instantiate the device type and device finder templates. The rest of the changes are mostly just moving stuff out of headers that shouldn't be there, renaming stuff for consistency, and scoping stuff down where appropriate. Things I've actually messed with substantially: * More descriptive names for a lot of devices * Untangled the fantasy sound from the driver state, which necessitates breaking up sound/flip writes * Changed DECO BSMT2000 ready callback into a device delegate * Untangled Microprose 3D noise from driver state * Used object finders for CoCo multipak, KC85 D002, and Irem sound subdevices * Started to get TI-99 stuff out of the TI-990 directory and arrange bus devices properly * Started to break out common parts of Samsung ARM SoC devices * Turned some of FM, SID, SCSP DSP, EPIC12 and Voodoo cores into something resmbling C++ * Tried to make Z180 table allocation/setup a bit safer * Converted generic keyboard/terminal to not use WRITE8 - space/offset aren't relevant * Dynamically allocate generic terminal buffer so derived devices (e.g. teleprinter) can specify size * Imporved encapsulation of Z80DART channels * Refactored the SPC7110 bit table generator loop to make it more readable * Added wrappers for SNES PPU operations so members can be made protected * Factored out some boilerplate for YM chips with PSG * toaplan2 gfx * stic/intv resolution * Video System video * Out Run/Y-board sprite alignment * GIC video hookup * Amstrad CPC ROM box members * IQ151 ROM cart region * MSX cart IRQ callback resolution time * SMS passthrough control devices starting subslots I've smoke-tested several drivers, but I've probably missed something. Things I've missed will likely blow up spectacularly with failure to bind errors and the like. Let me know if there's more subtle breakage (could have happened in FM or Voodoo). And can everyone please, please try to keep stuff clean. In particular, please stop polluting the global namespace. Keep things out of headers that don't need to be there, and use things that can be scoped down rather than macros. It feels like an uphill battle trying to get this stuff under control while more of it's added.
* Move special windows.h include directives to build defines (nw) Brad Hughes2016-12-281-1/+0
|
* Change window handle storage to template instead of void* (nw) (#1725) Brad Hughes2016-11-171-19/+19
| | | | * Change window handle storage to template instead of void* (nw)
* final srccleanmame0179 Vas Crabb2016-10-261-1/+1
|
* SDL: fixed alt-tab from locking up the window system on Linux and Mac. [Hans ↵ Olivier Galibert2016-10-241-1/+1
| | | | Ostermeyer]
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-10/+10
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* Convert OSD monitor info to modules plus add DXGI implementation Brad Hughes2016-09-141-2/+3
|
* Warp mode for relative mouse on OSX SDL 2.0.4 Brad Hughes2016-08-271-0/+20
| | | | Fixes #1232
* Attempt to fix mouse state on startup in SDL builds by initialising members Vas Crabb2016-08-141-6/+17
|
* std::min and std:max instead of MIN and MAX, also some more macros converted ↵ Miodrag Milanovic2016-07-311-10/+10
| | | | to inline functions (nw)
* Make monitor list a list of shared_ptr like window_list (nw) Brad Hughes2016-07-011-2/+2
|