1
| | #ifdef _WIN32
#pragma comment(lib, "glu32.lib")
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#include "SDL.h"
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstddef>
#include <iostream>
const float PI = 3.1415926535897932384626433832795f;
struct Point2f
{
float x;
float y;
};
struct Triangle
{
Point2f points[3];
Triangle operator = (const Triangle &rhs)
{
std::copy(rhs.points, rhs.points+3, points);
return (*this);
}
void translate(float x, float y)
{
points[0].x += x;
points[0].y += y;
points[1].x += x;
points[1].y += y;
points[2].x += x;
points[2].y += y;
}
void rotate(float radianAngle)
{
|