1
0
Fork 0
Commit graph

66 commits

Author SHA1 Message Date
0c6105e418 WIP 2020-10-21 12:59:55 +02:00
396f47cc22 Platform/Unix/X11Display: Implement showCursor() 2020-10-17 15:07:20 +02:00
10e1a9071e Platform/Unix/X11SharedDisplay: pass a pointer to the display to XReleaseDisplay() just to be sure client code has a valid pointer 2020-10-17 14:18:51 +02:00
cb5da64d10 Platform/Unix/UnixMisc.cpp: implement display mode lookups using xrandr extension. 2020-10-17 14:10:11 +02:00
b8ff8a1e46 Platform/Unix/X11EventQueue.cpp: pass ButtonPress/ButtonRelease/MotionNotify events to X11Mouse 2020-10-16 19:39:27 +02:00
dd8a4a0583 Platform/Unix/X11Mouse: adding a basic implementation to get things going. 2020-10-16 19:39:27 +02:00
6426679845 Platform/Unix/X11Keyboard: implement isKeyDown() 2020-10-16 19:39:27 +02:00
cdea7e238c Platform/Unix/X11EventQueue: Fix bug where messeges where not flushed to the event queue.
XEventsQueued(disp, QueuedAlready) only returns the number of events currently in the queue and
does not flush new events. So this must happen elsewhere and if it does not we
will never see any events. i noticed this bug when removing the call to glXSwapBuffers().

Fix this by using XPending() instead as this flushes new events
if the queue is empty before returning the length.

see https://tronche.com/gui/x/xlib/event-handling/XEventsQueued.html
and https://tronche.com/gui/x/xlib/event-handling/XPending.html
2020-10-16 19:39:27 +02:00
573d546961 Platform/Unix/X11EventQueue: send KeyPress and KeyRelease events to X11Keyboard::handleMessage() 2020-10-16 19:39:27 +02:00
eb0889470e Platform/Unix/X11Keyboard: Implement handleMessage() 2020-10-16 19:39:27 +02:00
12c0a962fc Platform/Unix/X11Display.h: Some documentation. 2020-10-16 19:39:27 +02:00
c020b5dcf6 Platform/Unix/X11EventQueue.cpp: Only process one event per call to poll(). Confirming to Platform API. 2020-10-16 19:39:27 +02:00
b21c62d98c Platform/Unix/X11EventQueue: get and release display handle in constructor/destructor instead of every call to poll()
Should be fine as the display should never change during runtime.
2020-10-16 19:39:27 +02:00
053511453f Platform/Unix/X11EventQueue: redirect unkown events to X11WindowEventHandler. 2020-10-16 19:39:27 +02:00
6dffb1619a source/Platform/Unix/X11Display.cpp: register with X11WindowEventHandler 2020-10-16 19:39:27 +02:00
2788424516 Adding Platform/Unix/X11WindowEventHandler 2020-10-16 19:39:27 +02:00
2ab5c7fc41 Platform/Unix/X11Display: Adding processEvent() to handle resize. 2020-10-16 19:39:27 +02:00
31970826a4 source/Platform/Unix/X11Display.cpp: Replace ResizeRedirectMask with StructureNotifyMask
ResizeRedirectMask is broken (will not update the window size). We use StrucutreNotifyMask instead and capture the window size from CaptureNotify event instead.
2020-10-16 19:39:27 +02:00
478cdaa8a1 source/Platform/Unix/X11Display.cpp: in create() call setSize() 2020-10-16 19:39:27 +02:00
b58a5fe9dd source/Platform/Unix/X11EventQueue.cpp: post quit event on "WM_DELETE_WINDOW". 2020-10-16 19:39:27 +02:00
34b78a7a4d source/Platform/Unix/X11EventQueue.cpp: log "WM_DESTROY_WINDOW" message. 2020-10-16 19:39:27 +02:00
62156a8685 source/Platform/Unix/X11Display.cpp: call XSetWMProtocols with "WM_DELETE_WINDOW" flag. 2020-10-16 19:39:27 +02:00
776904ee9a Platform/Unix/X11SharedDisplay: adding getAtom() 2020-10-16 19:39:27 +02:00
fa97552e23 source/Platform/Unix/UnixEventQueue.cpp: implement a poll method (only log events for now) 2020-10-16 19:39:27 +02:00
dd17868b89 source/Platform/Unix/X11Display.cpp: in create() set the attr.event_mask to include some interesting events. 2020-10-16 19:39:27 +02:00
9131aa2d2d source/Platform/Unix/GLXContext: Initial implementation 2020-10-16 19:39:27 +02:00
06f5ef5f86 source/Platform/Unix/X11Display.cpp: Initial implementation 2020-10-16 19:39:27 +02:00
389d75f3d8 Adding source/Platform/Unix/X11SharedDisplay.cpp 2020-10-16 19:39:27 +02:00
c35fd2e287 Adding glad GLX 2020-10-16 19:39:27 +02:00
38d333862a source/Platform/Unix: stub implementation 2020-10-16 19:39:26 +02:00
2c76d3bc87 source/Platform/Win32/Win32GLContext.cpp: no need to have our own wgl extension loader (fixed in latest glad2) 2020-09-21 18:00:08 +02:00
d8af100691 GLAD WGL: Update to new version. 2020-09-21 17:59:14 +02:00
a96e78bca5 source/Platform/Win32/Win32GLContext.cpp: in createGLContext() check return value from ensureExtensionsLoaded() 2020-09-20 16:46:51 +02:00
e3c01d4897 source/Platform/Win32/Win32GLContext.cpp: make ensureExtensionsLoaded() return bool. 2020-09-20 16:45:58 +02:00
6805e392a7 source/Platform/Win32/Win32GLContext.cpp: in createGLContext() delete temporary context as the last step. 2020-09-20 16:42:44 +02:00
92a561648e
Platform/Win32/Win32Input.cpp: remove Win32InputMsgBuffer 2020-02-15 15:41:53 +01:00
eef2690ada
source/Platform/Win32/Win32Mouse.cpp: in isButtonDown() use SM_SWAPBUTTON to determine if buttons are swapped or not. 2020-02-02 18:58:06 +01:00
24fa1e140e
source/Platform/Win32/Win32Keyboard.cpp: define LAlt and RAlt keys. 2020-02-02 00:42:00 +01:00
3364b921de
include/Spectre/Input/Keyboard.h: remove NumpadEnter (this is usually the same as regular enter). 2020-02-02 00:38:38 +01:00
7c6cf45d3c
include/Spectre/Input/Keyboard.h: Fix CamelCase for some enum values. 2020-02-02 00:34:13 +01:00
fa0fc72eb0
Platform/Win32/Win32Mouse: add getAbsPosition() and update the position variables in update() 2020-02-01 22:31:44 +01:00
290c6643f5
Platform/Win32/Win32Mouse: implement isButtonDown() using GetAsyncKeyState() and remove m_state and m_tracked. 2020-02-01 22:28:37 +01:00
c7c1ff68fd
Platform/Win32: remove Win32MsgBuffer 2020-02-01 16:43:10 +01:00
3c209ba01b
Platform/Win32/Win32Mouse: skip Win32MsgBuffer and handle event directly in handleMessage() 2020-02-01 15:50:09 +01:00
2e9701a15b
Platform/Win32/Win32Keyboard: implement isKeyDown() using GetAsyncKeyState() and remove m_bufState and m_focus. 2020-02-01 15:50:08 +01:00
390be8f740
Platform/Win32/Win32Keyboard: skip Win32MsgBuffer and handle event directly in handleMessage() 2020-02-01 15:50:06 +01:00
10198484e7
System/SystemEvent: Merge with Input/InputEvent into just Event. 2020-02-01 15:49:59 +01:00
858e721451
source/Platform/PlatformEventQueue.h: need to forward declare sp::SysEvent 2020-02-01 15:49:57 +01:00
ffb97d2b3a
source/Platform/Win32/Win32Display.cpp: No need to include Spectre/System/SystemEvent.h 2020-02-01 15:49:56 +01:00
24c3f14c8c
include/Spectre/Input/InputEvent.h: Move Key::Type to Keyboard class 2020-02-01 15:49:53 +01:00