Add GetPanel function
This commit is contained in:
parent
578ae644bd
commit
e4ae22e9e5
@ -9,6 +9,10 @@ class PGEX_SMX : public PGEX{
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
PGEX_SMX():PGEX(true){};
|
PGEX_SMX():PGEX(true){};
|
||||||
|
HWButton GetPanel(Key k,int pad)const{
|
||||||
|
std::cout<<SMX_GetInputState(pad);
|
||||||
|
};
|
||||||
|
private:
|
||||||
//SMX "screen" is 12x21
|
//SMX "screen" is 12x21
|
||||||
//Each panel is 4x7
|
//Each panel is 4x7
|
||||||
static void SMXStateChangedCallback(int pad, SMXUpdateCallbackReason reason, void *pUser)
|
static void SMXStateChangedCallback(int pad, SMXUpdateCallbackReason reason, void *pUser)
|
||||||
@ -34,6 +38,8 @@ public:
|
|||||||
|
|
||||||
virtual void OnAfterUserUpdate(float fElapsedTime)override{
|
virtual void OnAfterUserUpdate(float fElapsedTime)override{
|
||||||
std::string lightData;
|
std::string lightData;
|
||||||
|
//The light data for an SMX dance pad is outlined in the docs but the code used to transform the PGE's pixels to SMX pad's lights will be annotated here.
|
||||||
|
//Both pads receive data sequentially, and for now we can mimic the data on both ends.
|
||||||
for (int pad=0;pad<2;pad++){
|
for (int pad=0;pad<2;pad++){
|
||||||
for(int i=0;i<9;i++){
|
for(int i=0;i<9;i++){
|
||||||
int row=0;
|
int row=0;
|
||||||
|
@ -15,16 +15,13 @@ public:
|
|||||||
public:
|
public:
|
||||||
bool OnUserCreate() override
|
bool OnUserCreate() override
|
||||||
{
|
{
|
||||||
SetPixelMode([](const int x,const int y,const Pixel&col,const Pixel&prev){
|
|
||||||
|
|
||||||
return col;
|
|
||||||
});
|
|
||||||
// Called once at the start, so create things here
|
// Called once at the start, so create things here
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OnUserUpdate(float fElapsedTime) override
|
bool OnUserUpdate(float fElapsedTime) override
|
||||||
{
|
{
|
||||||
|
smx.GetPanel(RIGHT,0).bHeld;
|
||||||
// called once per frame
|
// called once per frame
|
||||||
for (int x = 0; x < ScreenWidth(); x++)
|
for (int x = 0; x < ScreenWidth(); x++)
|
||||||
for (int y = 0; y < ScreenHeight(); y++)
|
for (int y = 0; y < ScreenHeight(); y++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user