Commit graph

78 commits

Author SHA1 Message Date
Lars Brinkhoff
1d613f1f50 VIDEO: Fix use of uninitialized variable. 2021-03-06 09:59:50 +01:00
Lars Brinkhoff
ed4b204584 VIDEO: Allow setting alpha blending mode. 2021-02-27 14:43:18 +01:00
Mark Emmer
10f3a9dea3 VIDEO: Initialize event structure to 0 before waiting for events
No clear reason to do this, given the SDL code path in the call to
SDL_WaitEvent, but initializing at startup adds no overhead and
was reported to help some debugging activities.
2021-02-25 13:30:34 -08:00
Mark Pizzolato
c6710ee054 VIDEO: Silence minor compiler warning 2020-12-02 14:45:41 -08:00
Lars Brinkhoff
970fb8ec95 PDP10, ETHER, VIDEO, VAX: Fix set but unused variables. 2020-11-25 04:50:47 -08:00
Lars Brinkhoff
66a426c48e VIDEO: Add stubs for new APIs. 2020-11-25 09:17:14 +01:00
Lars Brinkhoff
3fc46f3b57 VIDEO: Allow more than one window.
New sim_video APIs have been added to make it possible for a simulator
to open multiple windows.  Two slightly updated functions are:

t_stat vid_open_window (VID_DISPLAY **vptr, DEVICE *dptr, const char *title, uint32 width, uint32 height, int flags);

Like vid_open, but return a dynamically allocated VID_DISPLAY struct
and return it in *vptr.

t_stat vid_close_all (void);

Close all currently opened windows.

In addition, these new functions correspond completely to the old set
of sim_video functions, except the first argument is a VID_DISPLAY
pointer: vid_close_window, vid_map_rgb_window, vid_draw_window,
vid_refresh_window, vid_set_cursor_window, vid_show_video_window,
vid_is_fullscreen_window, vid_set_fullscreen_window,
vid_set_cursor_position_window.
2020-11-24 13:24:43 +01:00
Lars Brinkhoff
6ca7a938ad VIDEO: Stretch frame buffer to accomodate output window. 2020-07-08 08:28:38 +02:00
Lars Brinkhoff
d93bfe62de VIDEO: Add API for querying and setting fullscreen mode. 2020-07-08 08:28:35 +02:00
Mark Pizzolato
337062fcf0 VIDEO: Always raise priority of thread consuming SDL Events 2020-06-13 05:05:11 -07:00
Mark Pizzolato
be117a33bd VIDEO: Move beep and joystick/gamepad init & cleanup into SDL event thread 2020-06-12 22:00:25 -07:00
Mark Pizzolato
973ee4cecb VIDEO: Assure proper initialization sequence in both operating modes
There are two separate running contexts that provide video capabilities:
1) Video event processing threads created on the fly as needed
2) Video events must be run in the context of the initial thread in
    a process.  In this context simulation and SCP runs in a created
    thread and when video activities are enabled needed activities
    are passed back to the primary thread to be handled.
2020-06-12 05:29:36 -07:00
Mark Pizzolato
737f31fea0 VIDEO: Move gamecontroller/joystick cleanup to the right place. 2020-06-11 12:53:28 -07:00
Mark Pizzolato
ebb327bff6 VIDEO: Protect all accesses to last draw buffers
- Cleanup order of gamepad/joystick shutdown to avoid unwinding these
  things while the rendering thread may still reference them.
2020-06-11 07:00:54 -07:00
Mark Pizzolato
9331d14e30 VIDEO: Avoid queuing draw events for identical unprocessed regions 2020-06-10 23:05:54 -07:00
Mark Pizzolato
6c6f66914d VIDEO: Explicitly initialize and cleanup SDL Audio subsystem
As mentioned in #873, there didn't appear to be a problem at runtime,
but the formal definition suggests SDL_InitSubSystem and its cleanup
should be called.  It is likely that, as a vestige of SDL 1.2,
SDL_OpenAudio is doing this under the covers.  No harm adding it.
2020-06-10 07:30:36 -07:00
Mark Pizzolato
0f992e1db7 VIDEO: Remove support for libSDL (prior to libSDL2)
All interesting simh host platforms have long supported libSDL2
functionality which wasn't the case when sim_video was initially
implemented.  The mixed API set significantly complicates maintaining
and extending sim_video, hence this explicit effort to remove
the vestiges  of the old libSDL API.
2020-05-28 11:40:35 -07:00
Lars Brinkhoff
8b64e5df1a VIDEO: SDL init/quit gamecontroller subsystem implies joystick. 2020-02-25 06:38:19 +01:00
Lars Brinkhoff
a562c8727b video: SDL_ControllerButtonEvent button conversion.
Uint8 needs casting to SDL_GameControllerButton.
2020-02-09 13:15:21 -08:00
Lars Brinkhoff
72b89054da video: Add support for SDL joysticks and game controllers. 2020-02-07 16:58:24 +01:00
Lars Brinkhoff
05e4babe24 video: Take address of SDL event union member rather than casting pointer. 2020-02-07 16:58:19 +01:00
Mark Pizzolato
9777e8fa36 VIDEO: Add zlib version to version string (zlib used by png) 2019-12-16 11:21:23 -08:00
Mark Pizzolato
354a1e42ea VIDEO: Add display of versions of dependent libraries (libpng, zlib)
Add specific makefile check for zlib being available
2019-07-30 22:30:03 -07:00
Mark Pizzolato
24ed486222 VIDEO: Fix coverity identified memory allocation failure error check 2019-07-05 09:59:08 -07:00
Matt Burke
4babf7f529 MicroVAX2: Added new video device (VCB02) 2019-04-10 22:01:52 -07:00
Mark Pizzolato
c7b0928b33 SCP: Avoid potential buffer overruns by using strlcpy() and strlcat() 2019-03-08 12:31:01 -08:00
Mark Pizzolato
627c7e3e25 VIDEO: Issue reasonable failure message when SDL can't initialize 2018-07-03 13:58:40 -07:00
Mark Pizzolato
e522daf906 SCP: Replace stray TAB and fix sprintf format specifier 2017-04-23 23:43:14 -07:00
Matt Burke
c94edb6b2d VAXStations: Improvements and bug fixes to keyboard and mouse devices
Whilst working on a new video device I ran into a few problems with the
LKxxx keyboard and I noticed there are already some open issues against
the keyboard and mouse devices. These changes should resolve #320 and
may help with #272 (although I think that is an SDL issue). I've tested these
changes with VWS, UWS and DECwindows with both captured and
uncaptured input modes.
2017-04-23 10:40:00 -07:00
Mark Pizzolato
d741bdc375 VIDEO: Allow SCREENSHOT command to optionally specify bitmap file extension
When PNG support is available, both .png and .bmp screenshots can be
generated based on the file extension specified by the user on the SCREENSHOT
command.  If no extension is specified, then a PNG format screenshot will be
produced.
2016-06-15 00:27:07 -07:00
Mark Pizzolato
a24aba69ae VIDEO: Added priority boost to thread performing SDL processing and updates
Reworked all priority adjustment code to leverage a new
sim_os_set_thread_priority API which is coded to use pthreads or OS
priority adjustment APIs as necessary.
2016-06-11 09:52:33 -07:00
Mark Pizzolato
3743d3d68a VIDEO: Avoid losing mouse button state when coalescing motion events
Identified by @shattered in #321

Added better debug output for keyboard events.
2016-06-11 08:39:25 -07:00
Mark Pizzolato
5531ccb175 ALL: Massive 'const' cleanup
These changes facilitate more robust parameter type checking and helps
to identify unexpected coding errors.

Most simulators can now also be compiled with a C++ compiler without
warnings.

Additionally, these changes have also been configured to facilitate easier
backporting of simulator and device simulation modules to run under the
simh v3.9+ SCP framework.
2016-05-15 15:25:33 -07:00
Mark Pizzolato
717f3820b9 VIDEO: cleanup SHOW VERSION output when video support isn't available. 2016-04-26 20:58:05 -07:00
Mark Pizzolato
aadd66c7c7 VIDEO: Fix uninitialized pointer reference under libSDL
This change fixes issue #276
2016-02-15 12:53:30 -08:00
Mark Pizzolato
51419a2e4b VIDEO: Add ability for a video window Quit event to optionally propagate back to SCP. 2016-01-29 00:30:02 -08:00
Mark Pizzolato
4f3dd08314 VIDEO: Add window title to vid_open. 2016-01-28 11:29:53 -08:00
Mark Pizzolato
21b31fc3a8 VIDEO: Add hot location functionality to cursor support.
Also sanely report memory allocation errors.
2016-01-28 07:58:02 -08:00
Mark Pizzolato
dce0aa2935 VIDEO: Add SDL audio support to generate a beep. Add absolute pointer position to mouse events. 2016-01-25 17:14:08 -08:00
Mark Pizzolato
33b88a3e83 VIDEO: Act on potential libSDL error return values 2015-12-06 18:02:45 -08:00
Mark Pizzolato
2029c3eb7f VIDEO: Restore direct update of video bitmap data when using libSDL (vs libSDL2). 2015-12-01 08:42:12 -08:00
Mark Pizzolato
b64401cbdd VIDEO: Fix crash using libSDL on hosts which display using X11. 2015-12-01 08:04:01 -08:00
Mark Pizzolato
4921d92650 VIDEO: Produce SCREENSHOT images in PNG format if libpng is available in the host build environment 2015-09-27 16:14:55 -07:00
Mark Pizzolato
13bb3356f5 VIDEO: Fix vid_draw to copy drawing data before returning when drawing is deferred.
Using SDL2 the draw operations are performed in a separate thread and thus the data must be cached while the request is passed to the separate thread while control returns to the caller.
2015-09-20 13:38:11 -07:00
Mark Pizzolato
42403efd1f VIDEO: Avoid compiler warning when building without video support 2015-09-17 14:52:49 -07:00
Mark Pizzolato
78399f10cb SCP: Added a SCREENSHOT command to record the video display window. 2015-09-17 11:49:01 -07:00
Mark Pizzolato
1348a1fbaa VIDEO: Fix building of video capable simulators on host systems which don't have libsdl available. 2015-04-13 06:22:11 -07:00
Mark Pizzolato
a7d0b0e3f3 VIDEO: Fix video capable simulator builds on platforms which don't have libSDL available at all by enabling stub code 2015-04-11 05:53:01 -07:00
Mark Pizzolato
66dba79418 ALPHA, ALTAIR, AltairZ80, I7094, NOVA, PDP1, PDP10, PDP11, PDP18B, PDP8, SAGE, sigma, swtp6800, TX-0, VAX: Change tabs to spaces which had crept in over time 2015-03-30 10:24:24 -07:00
Mark Pizzolato
ef9d1adce1 PDP10, PDP11, VAX: const cleanup 2015-02-13 06:18:24 -08:00