Skip to content

Instantly share code, notes, and snippets.

@plasma-effect
Created August 14, 2014 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plasma-effect/16269ba18c25bff26ede to your computer and use it in GitHub Desktop.
Save plasma-effect/16269ba18c25bff26ede to your computer and use it in GitHub Desktop.
#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