open GL开篇

这篇博客介绍了重新学习图形学的起点,通过OpenGL创建一个空白窗口。内容涉及设置Rendering Context、Device Context,以及如何响应键盘事件和处理窗口大小调整。在窗口模式下,使用45度视角创建透视效果,实现远近物体大小变化,为后续的OpenGL场景奠定基础。
摘要由CSDN通过智能技术生成

本来以为再也不会和图形产生任何联系了,现在又开始学习图形相关的内容。

今天开贴为证,好好学习图形学。

The first 4 lines include the header files for each library we are using. The lines look like this:

?

1

2

3

4

#include <windows.h>                              // Header File For Windows

#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

Next you need to set up all the variables you plan to use in your program. This program will create a blank OpenGL window, so we won't need to set up a lot of variables just yet. The few variables that we do set up are very important, and will be used in just about every OpenGL program you write using this code.

The first line sets up a Rendering Context. Every OpenGL program is linked to a Rendering Context. A Rendering Context is what links OpenGL calls to the Device Context. The OpenGL Rendering Context is defined as hRC. In order for your program to draw to a Window you need to create a Device Context, this is done i

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值