gpt4 book ai didi

c++ - 带有 C++ 的 iPhone 上的 OpenGL ES?

转载 作者:可可西里 更新时间:2023-11-01 05:37:45 26 4
gpt4 key购买 nike

我正在尝试在 iPhone 上运行一些有效的 C++ OpenGL 代码。到目前为止,我设法在 iPhone 上运行了一个 Objective-C/OpenGL ES 示例,以及一些 Objective-C-> 纯 C++ 文件(“hello world”输出到控制台)。

但我不会任何 C++ OpenGL 代码。确切的问题是在 C++ 文件中包含 OpenGL 库:

如果我使用 Objective-C 的导入:

#import <UIKit/UIKit.h>
#import <GLKit/GLKit.h>

它会说所有 gl* 调用“使用未声明的标识符‘gl*’”。

如果我使用仅在 C++ 中使用的导入:

#include <OpenGL/OpenGL.h>
#include <GLUT/glut.h>

它说找不到 OpenGL/OpenGL.h 文件(这是我所预料的,因为 OpenGL 是完整的 OpenGL 库,而不是 OpenGL ES)。

那么我该如何使用这个 C++ 文件呢?

已搜索:

http://www.hackint0sh.org/iphone-developer-exchange-9/iphone-sdk-can-i-use-c-opengl-38638.htm

iPhone - OpenGL using C++ tutorial/snippet

https://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/WorkingwithEAGLContexts/WorkingwithEAGLContexts.html#//apple_ref/doc/uid/TP40008793-CH103-SW1

但我没有找到如何使用 C++ 文件。

最佳答案

尝试:-

#include <OpenGLES/AEGL.h>

关于c++ - 带有 C++ 的 iPhone 上的 OpenGL ES?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12240327/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com