Graphics 版 (精华区)
发信人: killest (victor), 信区: Graphics
标 题: [转载] VC 4.0中使用OpenGL(11)
发信站: 紫 丁 香 (Wed Apr 22 10:29:32 1998), 站内信件
【 以下文字转载自 Programming 讨论区 】
【 原文由 xiaojun 所发表 】
providing functions for handling several three-dimensional objects, also
provides functions to manage and run an OpenGL application. These functions
are most useful for quick porting OpenGL applications from other
environments. In particular, these functions provide basic window
management, implement a simple message loop, and provide a window procedure
for basic message handling. However, these library functions are not
intended for use in production applications.
Writing OpenGL Windows Applications in C
Now for a look at a very simple OpenGL application. This application, shown
in Listing 41.1, displays a cube. The cube is slightly rotated to show a
three-dimensional appearance, and is lit from the side. In its simplicity,
this application is the OpenGL version of a Windows Hello, World
application.
Listing 41.1. A simple OpenGL application.
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
HGLRC hglrc;
void DrawHello(HWND hwnd)
--
※ 来源:.紫 丁 香 bbs.hit.edu.cn.[FROM: hs6.hit.edu.cn]
--
※ 转载:.紫 丁 香 bbs.hit.edu.cn.[FROM: victor.hit.edu.c]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:4.204毫秒