Frist OpenGl

类别:编程语言 点击:0 评论:0 推荐:
#include <windows.h>
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File For The GLu32 Library
#include <gl\glaux.h> // Header File For The GLaux Library

#pragma comment(lib, "OpenGL32.lib") 
#pragma comment(lib, "GLu32.lib")
#pragma comment(lib, "GLaux.lib")

void main(void)
{
    auxInitDisplayMode(AUX_SINGLE|AUX_RGBA);
    auxInitPosition(0,0,500,500);
    auxInitWindow("simple");

    glClearColor(0.0,0.0,0.0,0.0);
    glClear(GL_COLOR_BUFFER_BIT);

    glColor3f(1.0,0.0,0.0);
    glRectf(-0.5,-0.5,0.5,0.5);

    glFlush();
    _sleep(1000);
}

本文地址:http://com.8s8s.com/it/it25334.htm