45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#include <switch.h>
|
|
#include "type.h"
|
|
|
|
namespace threads {
|
|
|
|
//pad data cause i don't know where else to put it
|
|
extern PadState pad;
|
|
extern HidTouchScreenState touchState;
|
|
|
|
static inline void updateInput() {
|
|
touchState = {0};
|
|
padUpdate(&pad);
|
|
hidGetTouchScreenStates(&touchState, 1);
|
|
}
|
|
|
|
inline uint64_t padKeysDown() { return padGetButtonsDown(&pad); }
|
|
|
|
inline uint64_t padKeysHeld() { return padGetButtons(&pad); }
|
|
|
|
inline uint64_t padKeysUp() { return padGetButtonsUp(&pad); }
|
|
|
|
threadInfo *newThread(ThreadFunc func, void *args, funcPtr _drawFunc);
|
|
|
|
class threadProcMngr {
|
|
public:
|
|
~threadProcMngr();
|
|
|
|
//Draw function is used and called to draw on overlay
|
|
threadInfo *newThread(ThreadFunc func, void *args, funcPtr _drawFunc);
|
|
|
|
void update();
|
|
|
|
void draw();
|
|
|
|
bool empty() { return threads.empty(); }
|
|
|
|
private:
|
|
std::vector<threadInfo *> threads;
|
|
uint8_t lgFrame = 0, clrShft = 0;
|
|
bool clrAdd = true;
|
|
unsigned frameCount = 0;
|
|
Mutex threadLock = 0;
|
|
};
|
|
}
|