mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-09 21:47:57 +00:00
better event handling
This commit is contained in:
@@ -3,11 +3,30 @@
|
||||
#include <stdio.h>
|
||||
#include <boo.hpp>
|
||||
|
||||
class CTestDeviceFinder : public CDeviceFinder
|
||||
{
|
||||
CDolphinSmashAdapter* smashAdapter = NULL;
|
||||
public:
|
||||
CTestDeviceFinder()
|
||||
: CDeviceFinder(DEV_DOL_SMASH_ADAPTER)
|
||||
{}
|
||||
void deviceConnected(CDeviceToken& tok)
|
||||
{
|
||||
printf("CONNECTED %s %s\n", tok.getVendorName().c_str(), tok.getProductName().c_str());
|
||||
smashAdapter = dynamic_cast<CDolphinSmashAdapter*>(tok.openAndGetDevice());
|
||||
}
|
||||
void deviceDisconnected(CDeviceToken& tok)
|
||||
{
|
||||
printf("DISCONNECTED %s %s\n", tok.getVendorName().c_str(), tok.getProductName().c_str());
|
||||
delete smashAdapter;
|
||||
smashAdapter = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
CDeviceFinder finder(DEV_DOL_SMASH_ADAPTER);
|
||||
CDeviceToken& smashToken = finder.getTokens().begin()->second;
|
||||
CDolphinSmashAdapter* smashAdapter = dynamic_cast<CDolphinSmashAdapter*>(smashToken.openAndGetDevice());
|
||||
CTestDeviceFinder finder;
|
||||
finder.startScanning();
|
||||
|
||||
IGraphicsContext* ctx = new CGraphicsContext;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user