从Cygwin下的OpenGL开始 [英] Starting off with OpenGL under Cygwin

查看:299
本文介绍了从Cygwin下的OpenGL开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从Cygwin下编译和运行OpenGL程序?如果是,如何?

Is it possible to compile and run OpenGL programs from under Cygwin? If yes, how?

推荐答案

可以在Cygwin下编译和运行OpenGL程序。我说明这里的基本步骤:

It is possible to compile and run OpenGL programs under Cygwin. I illustrate the basic steps here:


  1. 我假设你知道OpenGL编程。如果没有,请获取红皮书 OpenGL编程指南)。

我假设你已经安装了Cygwin。如果没有,请访问 cygwin.com 并安装。

I assume you have Cygwin installed. If not, visit cygwin.com and install it.

要编译和运行OpenGL程序,您需要名为 opengl 的Cygwin包。在Cygwin安装程序中,它可以在图形部分下找到。请安装此程序包。

To compile and run OpenGL programs, you need the Cygwin package named opengl. In the Cygwin installer, it can be found under the Graphics section. Please install this package.

编写一个简单的OpenGL程序,说 ogl.c

Write a simple OpenGL program, say ogl.c.

使用标志 -lglut32 -lglu32 -lopengl32 编译程序。 (这个链接你的程序与GLUT,GLU和OpenGL库。一个OpenGL程序通常可以使用所有3个功能)。例如:

Compile the program using the flags -lglut32 -lglu32 -lopengl32. (This links your program with the GLUT, GLU and OpenGL libraries. An OpenGL program might typically use functions from all the 3 of them.) For example:


$ gcc ogl.c -lglut32 -lglu32 -lopengl32

$ gcc ogl.c -lglut32 -lglu32 -lopengl32


  • 运行程序。这很简单!

  • Run the program. It's as simple as that!

    这篇关于从Cygwin下的OpenGL开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆