Created
August 14, 2014 07:08
-
-
Save plasma-effect/16269ba18c25bff26ede to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define NO_S3D_USING | |
#define NO_MATH_USING | |
#include <Siv3D.hpp> | |
#include<boost/lexical_cast.hpp> | |
void Main() | |
{ | |
s3d::Font font(12); | |
while (s3d::System::Update()) | |
{ | |
auto joy = s3d::Joypad(0); | |
if (joy.connected) | |
{ | |
font.draw(boost::lexical_cast<std::wstring>(joy.xPos), { 0.0, 0.0 }); | |
font.draw(boost::lexical_cast<std::wstring>(joy.yPos), { 72.0, 0.0 }); | |
font.draw(boost::lexical_cast<std::wstring>(joy.uPos), { 0.0, 24.0 }); | |
font.draw(boost::lexical_cast<std::wstring>(joy.vPos), { 72.0, 24.0 }); | |
for (int i = 0; i < joy.numButtons; ++i) | |
{ | |
font.draw(boost::lexical_cast<std::wstring>(joy.button(i).pressed), { i*12.0, 48.0 }); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment