Last active
June 21, 2020 07:10
-
-
Save mak1a/d9ced85a53235c06e759ef28cfe1608f to your computer and use it in GitHub Desktop.
This file contains 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 | |
#include <Siv3D.hpp> // OpenSiv3D v0.4.3 | |
#include <LoadBalancing-cpp/inc/Client.h> | |
namespace makia::Photon { | |
/// <summary> | |
/// ExitGames::Common::JStringからs3d::Stringに変換する | |
/// </summary> | |
/// <param name="str">変換したい文字列</param> | |
/// <returns>s3d::Stringに変換した文字列</returns> | |
[[nodiscard]] inline s3d::String ConvertJStringToString(const ExitGames::Common::JString& str) { | |
return s3d::Unicode::FromWString(str.cstr()); | |
} | |
/// <summary> | |
/// s3d::StringからExitGames::Common::JStringに変換する | |
/// </summary> | |
/// <param name="str">変換したい文字列</param> | |
/// <returns>ExitGames::Common::JStringに変換した文字列</returns> | |
[[nodiscard]] inline ExitGames::Common::JString ConvertStringToJString(const s3d::String& str) { | |
return ExitGames::Common::JString(str.toWstr().c_str()); | |
} | |
} // namespace makia::Photon | |
void Main() { | |
{ | |
ExitGames::Common::JString str = L"ほげ"; | |
s3d::Print(makia::Photon::ConvertJStringToString(str)); | |
s3d::Console(makia::Photon::ConvertJStringToString(L"ふが")); | |
} | |
{ | |
s3d::String name = U"mak1a"; | |
ExitGames::Common::JString str = makia::Photon::ConvertStringToJString(name); | |
str += makia::Photon::ConvertStringToJString(U"最強!"); | |
s3d::Print(makia::Photon::ConvertJStringToString(str)); | |
} | |
while (s3d::System::Update()) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment