Merge complete

master
sigonasr2 1 year ago
commit 1650bc0726
  1. 6
      sample/PGEX_SMX.h
  2. 5
      sample/PGEX_SMX_Example.cpp
  3. 2
      sample/SMXSample.vcxproj
  4. 2
      sample/SMXSample.vcxproj.filters

@ -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;

@ -18,16 +18,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;
if (GetKey(RIGHT).bPressed) { if (GetKey(RIGHT).bPressed) {
mode = (mode + 1) % 3; mode = (mode + 1) % 3;
} }

@ -92,7 +92,7 @@
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="SMXSample.cpp" /> <ClCompile Include="PGEX_SMX_Example.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\sdk\Windows\SMX.vcxproj"> <ProjectReference Include="..\sdk\Windows\SMX.vcxproj">

@ -10,7 +10,7 @@
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="SMXSample.cpp"> <ClCompile Include="PGEX_SMX_Example.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>

Loading…
Cancel
Save