From 9c2fd75b02f2310b2c462c78afdee0b6025019fb Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sun, 19 Apr 2015 10:16:50 -1000 Subject: [PATCH 1/2] Added input device stubs --- include/CInputDeferredRelay.hpp | 6 ++++ include/CInputRelay.hpp | 11 +++++++ include/CQtOpenGLWindow.hpp | 36 +++++++++++++++++++++++ include/IInputWaiter.hpp | 9 ++++++ include/inputdev/CCafeProPad.hpp | 5 ++++ include/inputdev/CDeviceFinder.hpp | 5 ++++ include/inputdev/CDolphinSmashAdapter.hpp | 5 ++++ include/inputdev/CDualshockPad.hpp | 5 ++++ include/inputdev/CGenericPad.hpp | 5 ++++ include/inputdev/CRevolutionPad.hpp | 5 ++++ libBoo.pri | 31 +++++++++++++++---- src/CInputDeferredRelay.cpp | 1 + src/CInputRelay.cpp | 1 + src/CQtOpenGLWindow.cpp | 3 ++ src/inputdev/CCafeProPad.cpp | 1 + src/inputdev/CDeviceFinder.cpp | 9 ++++++ src/inputdev/CDolphinSmashAdapter.cpp | 1 + src/inputdev/CDualshockPad.cpp | 1 + src/inputdev/CGenericPad.cpp | 1 + src/inputdev/CHIDDeviceIOKit.mm | 1 + src/inputdev/CHIDDeviceUdev.cpp | 1 + src/inputdev/CHIDDeviceWin32.cpp | 1 + src/inputdev/CRevolutionPad.cpp | 1 + src/inputdev/IHIDDevice.hpp | 5 ++++ src/mac/CCGLContext.cpp | 5 ++-- 25 files changed, 148 insertions(+), 7 deletions(-) create mode 100644 include/CInputDeferredRelay.hpp create mode 100644 include/CInputRelay.hpp create mode 100644 include/CQtOpenGLWindow.hpp create mode 100644 include/IInputWaiter.hpp create mode 100644 include/inputdev/CCafeProPad.hpp create mode 100644 include/inputdev/CDeviceFinder.hpp create mode 100644 include/inputdev/CDolphinSmashAdapter.hpp create mode 100644 include/inputdev/CDualshockPad.hpp create mode 100644 include/inputdev/CGenericPad.hpp create mode 100644 include/inputdev/CRevolutionPad.hpp create mode 100644 src/CInputDeferredRelay.cpp create mode 100644 src/CInputRelay.cpp create mode 100644 src/CQtOpenGLWindow.cpp create mode 100644 src/inputdev/CCafeProPad.cpp create mode 100644 src/inputdev/CDeviceFinder.cpp create mode 100644 src/inputdev/CDolphinSmashAdapter.cpp create mode 100644 src/inputdev/CDualshockPad.cpp create mode 100644 src/inputdev/CGenericPad.cpp create mode 100644 src/inputdev/CHIDDeviceIOKit.mm create mode 100644 src/inputdev/CHIDDeviceUdev.cpp create mode 100644 src/inputdev/CHIDDeviceWin32.cpp create mode 100644 src/inputdev/CRevolutionPad.cpp create mode 100644 src/inputdev/IHIDDevice.hpp diff --git a/include/CInputDeferredRelay.hpp b/include/CInputDeferredRelay.hpp new file mode 100644 index 0000000..d4a0982 --- /dev/null +++ b/include/CInputDeferredRelay.hpp @@ -0,0 +1,6 @@ +#ifndef CINPUTDEFERREDRELAY_HPP +#define CINPUTDEFERREDRELAY_HPP + +#include "IInputWaiter.hpp" + +#endif // CINPUTDEFERREDRELAY_HPP diff --git a/include/CInputRelay.hpp b/include/CInputRelay.hpp new file mode 100644 index 0000000..eb126ac --- /dev/null +++ b/include/CInputRelay.hpp @@ -0,0 +1,11 @@ +#ifndef CINPUTRELAY_HPP +#define CINPUTRELAY_HPP + +#include "IInputWaiter.hpp" + +class CInputRelay : IInputWaiter +{ + +}; + +#endif // CINPUTRELAY_HPP diff --git a/include/CQtOpenGLWindow.hpp b/include/CQtOpenGLWindow.hpp new file mode 100644 index 0000000..650513c --- /dev/null +++ b/include/CQtOpenGLWindow.hpp @@ -0,0 +1,36 @@ +#ifndef CQTOPENGLWINDOW_HPP +#define CQTOPENGLWINDOW_HPP + +#include +#include +#include + +class CQtOpenGLWindow : public QWindow, ISurface +{ + Q_OBJECT +public: + explicit CQtOpenGLWindow(QWindow *parent = 0); + CQtOpenGLWindow(); + + virtual void render(); + + virtual void initialize(); + + + public slots: + void renderLater(); + void renderNow(); + +protected: + bool event(QEvent *event) Q_DECL_OVERRIDE; + + void exposeEvent(QExposeEvent *event) Q_DECL_OVERRIDE; + +private: + bool m_update_pending; + bool m_animating; + + QOpenGLContext *m_context; +}; + +#endif // CQTOPENGLWINDOW_HPP diff --git a/include/IInputWaiter.hpp b/include/IInputWaiter.hpp new file mode 100644 index 0000000..e7f0048 --- /dev/null +++ b/include/IInputWaiter.hpp @@ -0,0 +1,9 @@ +#ifndef IINPUTWAITER_HPP +#define IINPUTWAITER_HPP + +class IInputWaiter +{ + +}; + +#endif // IINPUTWAITER_HPP diff --git a/include/inputdev/CCafeProPad.hpp b/include/inputdev/CCafeProPad.hpp new file mode 100644 index 0000000..b82a55b --- /dev/null +++ b/include/inputdev/CCafeProPad.hpp @@ -0,0 +1,5 @@ +#ifndef CCAFEPROPAD_HPP +#define CCAFEPROPAD_HPP + + +#endif // CCAFEPROPAD_HPP diff --git a/include/inputdev/CDeviceFinder.hpp b/include/inputdev/CDeviceFinder.hpp new file mode 100644 index 0000000..f096170 --- /dev/null +++ b/include/inputdev/CDeviceFinder.hpp @@ -0,0 +1,5 @@ +#ifndef CDEVICEFINDER_HPP +#define CDEVICEFINDER_HPP + + +#endif // CDEVICEFINDER_HPP diff --git a/include/inputdev/CDolphinSmashAdapter.hpp b/include/inputdev/CDolphinSmashAdapter.hpp new file mode 100644 index 0000000..94fd679 --- /dev/null +++ b/include/inputdev/CDolphinSmashAdapter.hpp @@ -0,0 +1,5 @@ +#ifndef CDOLPHINSMASHADAPTER_HPP +#define CDOLPHINSMASHADAPTER_HPP + + +#endif // CDOLPHINSMASHADAPTER_HPP diff --git a/include/inputdev/CDualshockPad.hpp b/include/inputdev/CDualshockPad.hpp new file mode 100644 index 0000000..8b07a78 --- /dev/null +++ b/include/inputdev/CDualshockPad.hpp @@ -0,0 +1,5 @@ +#ifndef CDUALSHOCKPAD_HPP +#define CDUALSHOCKPAD_HPP + + +#endif // CDUALSHOCKPAD_HPP diff --git a/include/inputdev/CGenericPad.hpp b/include/inputdev/CGenericPad.hpp new file mode 100644 index 0000000..93c7191 --- /dev/null +++ b/include/inputdev/CGenericPad.hpp @@ -0,0 +1,5 @@ +#ifndef CGENERICPAD_HPP +#define CGENERICPAD_HPP + + +#endif // CGENERICPAD_HPP diff --git a/include/inputdev/CRevolutionPad.hpp b/include/inputdev/CRevolutionPad.hpp new file mode 100644 index 0000000..f87113d --- /dev/null +++ b/include/inputdev/CRevolutionPad.hpp @@ -0,0 +1,5 @@ +#ifndef CREVOLUTIONPAD_HPP +#define CREVOLUTIONPAD_HPP + + +#endif // CREVOLUTIONPAD_HPP diff --git a/libBoo.pri b/libBoo.pri index 57b83e4..03b3c0b 100644 --- a/libBoo.pri +++ b/libBoo.pri @@ -4,7 +4,17 @@ HEADERS += \ $$PWD/include/boo.hpp \ $$PWD/include/IGraphicsContext.hpp \ $$PWD/include/ISurface.hpp \ - $$PWD/include/IRetraceWaiter.hpp + $$PWD/include/CSurface.hpp \ + $$PWD/include/IRetraceWaiter.hpp \ + $$PWD/include/IInputWaiter.hpp \ + $$PWD/include/CInputRelay.hpp \ + $$PWD/include/CInputDeferredRelay.hpp \ + $$PWD/include/inputdev/CDolphinSmashAdapter.hpp \ + $$PWD/include/inputdev/CRevolutionPad.hpp \ + $$PWD/include/inputdev/CCafeProPad.hpp \ + $$PWD/include/inputdev/CDualshockPad.hpp \ + $$PWD/include/inputdev/CGenericPad.hpp \ + $$PWD/include/inputdev/CDeviceFinder.hpp unix:!macx:HEADERS += \ $$PWD/include/x11/CGLXContext.hpp @@ -17,18 +27,29 @@ win32:HEADERS += \ SOURCES += \ $$PWD/src/CSurface.cpp \ - $$PWD/src/CRetraceWaiter.cpp + $$PWD/src/CRetraceWaiter.cpp \ + $$PWD/src/CInputRelay.cpp \ + $$PWD/src/CInputDeferredRelay.cpp \ + $$PWD/src/inputdev/CDolphinSmashAdapter.cpp \ + $$PWD/src/inputdev/CRevolutionPad.cpp \ + $$PWD/src/inputdev/CCafeProPad.cpp \ + $$PWD/src/inputdev/CDualshockPad.cpp \ + $$PWD/src/inputdev/CGenericPad.cpp \ + $$PWD/src/inputdev/CDeviceFinder.cpp unix:!macx:SOURCES += \ - $$PWD/src/x11/CGLXContext.cpp + $$PWD/src/x11/CGLXContext.cpp \ + $$PWD/src/inputdev/CHIDDeviceUdev.cpp macx:SOURCES += \ $$PWD/src/mac/CCGLContext.cpp macx:OBJECTIVE_SOURCES += \ - $$PWD/src/mac/CCGLCocoaView.mm + $$PWD/src/mac/CCGLCocoaView.mm \ + $$PWD/src/inputdev/CHIDDeviceIOKit.mm win32:SOURCES += \ - $$PWD/src/win/CWGLContext.cpp + $$PWD/src/win/CWGLContext.cpp \ + $$PWD/src/inputdev/CHIDDeviceWin32.cpp INCLUDEPATH += $$PWD/include diff --git a/src/CInputDeferredRelay.cpp b/src/CInputDeferredRelay.cpp new file mode 100644 index 0000000..7fed569 --- /dev/null +++ b/src/CInputDeferredRelay.cpp @@ -0,0 +1 @@ +#include "CInputDeferredRelay.hpp" \ No newline at end of file diff --git a/src/CInputRelay.cpp b/src/CInputRelay.cpp new file mode 100644 index 0000000..2d38700 --- /dev/null +++ b/src/CInputRelay.cpp @@ -0,0 +1 @@ +#include "CInputRelay.hpp" \ No newline at end of file diff --git a/src/CQtOpenGLWindow.cpp b/src/CQtOpenGLWindow.cpp new file mode 100644 index 0000000..07d3ba2 --- /dev/null +++ b/src/CQtOpenGLWindow.cpp @@ -0,0 +1,3 @@ +#include "CQtOpenGLWindow.hpp" + + diff --git a/src/inputdev/CCafeProPad.cpp b/src/inputdev/CCafeProPad.cpp new file mode 100644 index 0000000..2888b5b --- /dev/null +++ b/src/inputdev/CCafeProPad.cpp @@ -0,0 +1 @@ +#include "IHIDDevice.hpp" diff --git a/src/inputdev/CDeviceFinder.cpp b/src/inputdev/CDeviceFinder.cpp new file mode 100644 index 0000000..e2fa4a9 --- /dev/null +++ b/src/inputdev/CDeviceFinder.cpp @@ -0,0 +1,9 @@ +/* + * CDeviceFinder.cpp + * libBoo + * + * Created on 04/19/2015. + * + */ + +#include diff --git a/src/inputdev/CDolphinSmashAdapter.cpp b/src/inputdev/CDolphinSmashAdapter.cpp new file mode 100644 index 0000000..2888b5b --- /dev/null +++ b/src/inputdev/CDolphinSmashAdapter.cpp @@ -0,0 +1 @@ +#include "IHIDDevice.hpp" diff --git a/src/inputdev/CDualshockPad.cpp b/src/inputdev/CDualshockPad.cpp new file mode 100644 index 0000000..2888b5b --- /dev/null +++ b/src/inputdev/CDualshockPad.cpp @@ -0,0 +1 @@ +#include "IHIDDevice.hpp" diff --git a/src/inputdev/CGenericPad.cpp b/src/inputdev/CGenericPad.cpp new file mode 100644 index 0000000..2888b5b --- /dev/null +++ b/src/inputdev/CGenericPad.cpp @@ -0,0 +1 @@ +#include "IHIDDevice.hpp" diff --git a/src/inputdev/CHIDDeviceIOKit.mm b/src/inputdev/CHIDDeviceIOKit.mm new file mode 100644 index 0000000..2888b5b --- /dev/null +++ b/src/inputdev/CHIDDeviceIOKit.mm @@ -0,0 +1 @@ +#include "IHIDDevice.hpp" diff --git a/src/inputdev/CHIDDeviceUdev.cpp b/src/inputdev/CHIDDeviceUdev.cpp new file mode 100644 index 0000000..2888b5b --- /dev/null +++ b/src/inputdev/CHIDDeviceUdev.cpp @@ -0,0 +1 @@ +#include "IHIDDevice.hpp" diff --git a/src/inputdev/CHIDDeviceWin32.cpp b/src/inputdev/CHIDDeviceWin32.cpp new file mode 100644 index 0000000..2888b5b --- /dev/null +++ b/src/inputdev/CHIDDeviceWin32.cpp @@ -0,0 +1 @@ +#include "IHIDDevice.hpp" diff --git a/src/inputdev/CRevolutionPad.cpp b/src/inputdev/CRevolutionPad.cpp new file mode 100644 index 0000000..2888b5b --- /dev/null +++ b/src/inputdev/CRevolutionPad.cpp @@ -0,0 +1 @@ +#include "IHIDDevice.hpp" diff --git a/src/inputdev/IHIDDevice.hpp b/src/inputdev/IHIDDevice.hpp new file mode 100644 index 0000000..187a813 --- /dev/null +++ b/src/inputdev/IHIDDevice.hpp @@ -0,0 +1,5 @@ +#ifndef IHIDDEVICE_HPP +#define IHIDDEVICE_HPP + + +#endif // IHIDDEVICE_HPP diff --git a/src/mac/CCGLContext.cpp b/src/mac/CCGLContext.cpp index f4bbc0f..a7eeaf6 100644 --- a/src/mac/CCGLContext.cpp +++ b/src/mac/CCGLContext.cpp @@ -3,8 +3,8 @@ #include CCGLContext::CCGLContext() - : m_majVersion(3), - m_minVersion(3) + : m_minVersion(3), + m_majVersion(3) { std::cout << "Hello from CGL" << std::endl; } @@ -58,3 +58,4 @@ int CCGLContext::blueDepth() const { return -1; } +#endif \ No newline at end of file From e7368bfa048f82fb5843ca016be658120d196368 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Sun, 19 Apr 2015 10:21:44 -1000 Subject: [PATCH 2/2] Added HID interface header to qmake --- libBoo.pri | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libBoo.pri b/libBoo.pri index 03b3c0b..46ffa02 100644 --- a/libBoo.pri +++ b/libBoo.pri @@ -14,7 +14,8 @@ HEADERS += \ $$PWD/include/inputdev/CCafeProPad.hpp \ $$PWD/include/inputdev/CDualshockPad.hpp \ $$PWD/include/inputdev/CGenericPad.hpp \ - $$PWD/include/inputdev/CDeviceFinder.hpp + $$PWD/include/inputdev/CDeviceFinder.hpp \ + $$PWD/src/inputdev/IHIDDevice.hpp unix:!macx:HEADERS += \ $$PWD/include/x11/CGLXContext.hpp