ChatGPTが生成したトーンカーブの描画プログラムを修正,改善: https://chatgpt.com/share/6784f821-f064-8009-93bb-a07882318f27
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
#include <Siv3D.hpp> // Siv3D v0.6.15 | |
#include <sw/redis++/redis++.h> | |
void Main() | |
{ | |
Window::Resize(400, 300); | |
// Redisサーバーに接続 | |
sw::redis::ConnectionOptions options; | |
options.type = sw::redis::ConnectionType::TCP; |
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
#include <Siv3D.hpp> | |
void DrawStripe(const Rect& rect, double angle, double barWidth, const Array<ColorF>& pattern = { Palette::Yellow, Palette::Black }) | |
{ | |
// 傾けたときの描画範囲を計算 | |
const auto renderRect = | |
RectF{ 0, 0, rect.size }.asQuad() | |
.rotatedAt(0, 0, -angle) | |
.boundingRect(); |
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
#include <Siv3D.hpp> | |
#include <FlexLayout.hpp> | |
struct Item | |
{ | |
String emoji; | |
int level; | |
}; |
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
FROM ubuntu:22.04 | |
ARG SIV3D_VERSION="main" | |
ARG GCC_OPTIONS="-j4" | |
RUN apt-get update \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \ | |
git \ | |
build-essential \ | |
cmake \ |
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
# include <Siv3D.hpp> | |
namespace SasaGUI | |
{ | |
namespace Config | |
{ | |
struct ScrollBar | |
{ | |
// | ______________ | | |
// | =======|______________|== | |
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
# include <Siv3D.hpp> // OpenSiv3D v0.6.6 | |
class Delay | |
{ | |
public: | |
constexpr Delay(Duration duration) noexcept | |
: m_duration(duration.count()) | |
{ | |
assert(duration >= 0s); |
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
#include "Builder.hpp" | |
namespace GUI | |
{ | |
BuilderContext::BuilderContext(Widget& root) | |
: m_root(root) | |
{ | |
reset(); | |
} |
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
#include <Siv3D.hpp> // OpenSiv3D v0.6.4 | |
void DrawAngleText(const Font& font, const Circle& circle, double angle, ColorF color) | |
{ | |
const auto degText = font(U"{:.1f}"_fmt(ToDegrees(angle))); | |
degText.region(Arg::topCenter = circle.center + Vec2{ 0, circle.r + 2 }).draw(ColorF(Scene::GetBackground(), 0.8)); | |
degText.draw(Arg::topCenter = circle.center + Vec2{ 0, circle.r + 2 }, color); | |
} | |
void Main() |
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
# include <Siv3D.hpp> // OpenSiv3D v0.6.3 | |
struct Arc | |
{ | |
Vec2 center; | |
double r; | |
double startAngle; |
NewerOlder