#include "stdafx.h"
#include <glut.h>
void display(void);
void myreshape(GLsizei w, GLsizei h);//窗口改变函数
void mykeyboard(unsigned char key, int x, int y);
float x1=100,y1=100,x2=300,y2=300;
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
char *argv[] = {"hello ", " "};
int argc = 2; // must/should match the number of strings in argv
glutInit(&argc, argv); //初始化GLUT库;
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); //设置显示模式;(缓冲,颜色类型)
glutInitWindowSize(800, 800);
glutInitWindowPosition(1024 / 2 - 250, 768 / 2 - 250);
glutCreateWindow("Hello"); //创建窗口,标题为“hello”;
glutDisplayFunc(display); //用于绘制当前窗口;
glutKeyboardFunc(mykeyboard);
glutReshapeFunc(myreshape);
glutMainLoop(); //表示开始运行程序,用于程序的结尾;
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载