(続き)
void String(float x0, float y0, float x1, float y1) {
Point pt = {x, y};
g(pt);
DrawString(pt.x, pt.y, 0xFFFFFF);
}
INT WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT) {
SetGraphMode(WIDTH, HEIGHT, 32);
ChangeWindowMode(TRUE);
DxLib_Init();
while (!ScreenFlip() && !ProcessMessage() && !ClearDrawScreen()) {
float x0 = -WIDTH/2, x1 = WIDTH/2;
float y0 = -HEIGHT/2, y1 = HEIGHT/2;
String(0,0,"O"); //原点
Line(x0,0,x1,0); String(x1-16,0,"x"); //X軸
Line(0,y0,0,y1); String(8,y1,"y"); //Y軸

Line(x0, f(x0), x1, f(x1));
DrawString(0,0, "y = x/2 - 50", 0xFFFFFF);
}
DxLib_End(); return 0;
}