打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Advanced Graphics Using OpenGL

OpenGL is a library of graphic functions that create sophisticated graphic displays such as 3-D images and animation. OpenGL is commonly available on workstations. Writing to this standard allows your program to be ported easily to other platforms.

OpenGL windows are used independently of and in addition to any console, QuickWin and regular Windows windows your application uses. Every window in OpenGL uses a pixel format, and the pixels carry, among other things, RGB values, opacity values, and depth values so that pixels with a small depth (shallow) overwrite deeper pixels. The basic steps in creating OpenGL applications are:

  • Specify the pixel format

  • Specify how the pixels will be rendered on the video device

  • Call OpenGL commands

OpenGL programming is straightforward, but requires a particular initialization and order, like other software tools. References to get you started are:

  • The OpenGL Reference Manual, Addison-Wesley, ISBN 0-201-46140-4.

  • The OpenGL Programming Guide, Addison-Wesley, ISBN 0-201-46138-2.

  • OpenGL SuperBible: The Complete Guide to OpenGL Programming on Windows NT and Windows 95, Richard Wright and Michael Sweet, Waite Group Press (Division of Sams Publishing), 1996, ISBN 1-57169-073-5.

  • OpenGL documentation in the Platform SDK title in HTML Help Viewer.

  • The OpenGL description from the Microsoft Visual C++ manuals.

NOTE:

Microsoft no longer provides the glAux procedures.

Intel Visual Fortran provides an OpenGL module, IFOPNGL.MOD, invoked with the USE statement line:

USE IFOPNGL

When you use this module, all constants and interfaces that bind Fortran to the OpenGL routines become available. Any link libraries required to link with an OpenGL program are automatically searched if USE IFOPNGL is present in your Fortran program.

An OpenGL window can be opened from a console, Windows, or QuickWin application. The OpenGL window uses OpenGL calls exclusively, not normal Graphic Device Interface (GDI) calls. Likewise, OpenGL calls cannot be made within an ordinary Windows window or QuickWin child window, because special initialization is required for OpenGL calls.

The Fortran OpenGL identifiers are the same as the C identifiers (such as using a GL_ prefix for constants), except that the gl prefix is changed to fgl for routines and identifier lengths are limited to 31 characters . The data types in the OpenGL C binding are translated to Fortran types as shown in the following table:

OpenGL/C Type

Fortran Data Type

GLbyte

INTEGER(1)

GLshort

INTEGER(2)

GLint, GLsizei

INTEGER(4)

GLfloat, GLclampf

REAL(4)

GLdouble, GLclampd

REAL(8)

GLubyte

INTEGER(1)

GLboolean

INTEGER(1)

GLushort

INTEGER(2)

GLuint, GLenum, GLbitfield

INTEGER(4)

GLvoid

INTEGER(INT_PTR_KIND())

pointers

INTEGER(INT_PTR_KIND())

If you include (USE) the parameter constant definitions from IFOPNGLT.F90 (such as by USE IFOPNGL), you can use the constants to specify the kind type, such as INTEGER(K_GLint) instead of INTEGER(4).

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
[整理] File Extensions [ F ]
AndroidGraphic:apkandSkia/OpenGL|ES
Fortran百科
How to enable OpenGL hardware accelerator | pcDuino: mini PC+Arduino
OpenGL 纹理入门
installShield
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服