NeHe OpenGL Lesson01 – Creating an OpenGL Window (Win32)

lesson01_screen_shot-300x238 I started learn NeHe OpenGL lessons in university, but I never went though all of his lessons. I wish this time my blog will go though all of content, and figure out all of the OpenGL technology points that NeHe tutorial used.

Creating an OpenGL Window : shows us how to set up the OpenGL rendering context on win32 windows. Those are fixed steps that nothing special to take care. One thing need to mention is the function “AdjustWindowRectEx“, this function will adjust the window to the requested size. Usually, when you create a size 800×600 window, the client area that could be used by the application is less than 800×600. Because this area (800×600) you requested includes the window borders, the caption item(the top most part of the window, that used to hold the window title, max/min/close button), and the client area. With this function, you could calculate the real window size given by specified client area size.

The full source code could be downloaded from here. And the PDF tutorial could be downloaded from here.

Note, there is no “glaux” library and header files any more on Visual Studio 2008. To make the vs2008 compile this project well, you need to grab this library back(you could grab it from vs2005 install directory). Or you could download a copy from here. You need to put glaux.h to folder “C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl\“, and put GlAux.Lib to folder “C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib\“.  If you use vs2005, there is no such problem.

转载于:https://www.cnblogs.com/open-coder/archive/2012/08/23/2653437.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值