在没有GLUT的情况下初始化OpenGL [英] Initializing OpenGL without GLUT

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

问题描述

我能找到的每个介绍和示例似乎都使用GLUT或其他框架来初始化" OpenGL.有没有一种使用GL和GLU中可用的东西来初始化OpenGL的方法?如果没有,那么没有它,GLUT怎么办呢?

every introduction and sample that I can find seems to use GLUT or some other framework to "initialize" OpenGL. Is there a way of initializing OpenGL with just what is available in GL and GLU? If not, then what is GLUT doing that is not possible without it?

推荐答案

正如卢克所说,创建和绑定上下文的代码特定于每个窗口平台.

As luke noted, the code to create and bind the context is specific to each windowing platform.

以下是一些在特定平台上初始化OpenGL的功能:

Here are some functions to get you started in terms of initializing OpenGL on specific platforms:

Windows(教程位于此处)

Windows (a tutorial is here)

  • wglCreateContext(hDC)

Mac OS X – OS X本质上具有三个选项:Carbon,Cocoa和基础Core Graphics Layer

Mac OS X -- OS X has essentially three options: Carbon, Cocoa, and the underlying Core Graphics Layer

  • The entire guide for Mac OS X OpenGL development
  • Carbon: aglCreateContext
  • Cocoa: Create (or subclass) an NSOpenGLView. They create their own context, and you can read their method documentation to find how to make it current.
  • CoreGraphicsLayer: CGLCreateContext

Linux

  • glx: glXCreateContext

这篇关于在没有GLUT的情况下初始化OpenGL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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