- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想将 OpenGL 与 C++ 结合使用来创建一个带有“相机”(透视图)和要查看的对象的基本场景。我找到了示例代码 here .但出于某种原因,尽管我已将所有必要的包含和库捆绑在一起(见下文),
// OpenGL init and components:
#include <glload/gl_3_3.h>
#include <glload/gl_load.hpp>
#include <GL/glew.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/freeglut.h>
#include <excpt.h>
#include <glm/glm.hpp>
IDE(适用于 Windows 桌面的 Visual Studio Express 2012)不同意我的观点:
如果您需要某种类型的更多信息,请告诉我。
============================================= ==============================
更新:在摆弄了一些与 opengl 相关的文件之后,这就是我想出的:
// Basics:
#include <windows.h>
#include <string>
#include <exception>
#include <stdexcept>
#include <stdio.h>
#include <stdlib.h>
// OpenGL init and components:
#include <glload/gl_3_1_comp.h>
#include <glload/gl_3_2_comp.h>
#include <glload/gl_3_3.h>
#include <glload/gl_4_0_comp.h>
#include <glload/gl_4_1_comp.h>
#include <glload/gl_4_2_comp.h>
#include <glload/gl_4_3_comp.h>
#include <glload/gl_4_4_comp.h>
#include <glload/gl_load.hpp>
#include <GL/glew.h>
#include <GL/freeglut.h>
#include <excpt.h>
#include <glm/glm.hpp>
它告诉我 GLEW_OK 是未定义的,尽管它就在 glew.h 中:
#define GLEW_OK 0
最佳答案
我看到你在使用 glew,你调用了 glewInit()
了吗?
还要确保您正在检查初始化是否成功。
GLenum err = glewInit();
if (GLEW_OK != err)
{
/* Problem: glewInit failed, something is seriously wrong. */
fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
}
或者,它可能类似于 this今天早上发生在我身上,重启解决了我的问题
关于c++ - 无法识别 glMatrixMode() 或 GL_PROJECTION 并提供所有需要的库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23458752/
将 glRotatef() 放在 glMatrixMode(GL_PROJECTION); 之后有什么区别 glMatrixMode(GL_PROJECTION); glLoadIdentity();
glMatrixMode(GL_PROJECTION)有什么区别和 glMatrixMode(GL_MODELVIEW) ? #include #include #include #define
我学习过的大多数 Android OpenGL ES 教程都有这样的 onSurfaceChanged() 函数: public void onSurfaceChanged( GL10 gl, int
我收到 0 个错误,但我在控制台中得到了这个: >Exception in thread "main" java.lang.NullPointerException >>at org.lwjgl.
我开始研究 OpenGL 的一些东西,我看到了很多调用 glMatrixMode 函数的例子。 根据我收集到的信息,将其设置为 GL_MODELVIEW 或 GL_PROJECTION(等)将激活该特
所以我正在阅读this LWJGL wiki 上的文章提到,“当使用‘向前兼容’上下文时,任何标记为已弃用的功能都将被删除。” 现在,当我实现与显示的前向兼容性时,每当我调用 glMatrixMode
static void resize(int width, int height) { const float ar = (float) width / (float) height;
我目前正在使用 SDL 1.2.4 和 C++Builder 10.0 Seattle。我设置了一个简单的测试程序来检查是否一切正常。 以下代码编译时没有警告或错误,但给我一个运行时错误: Excep
我正在阅读一本关于 OpenGL、SDL 的书,并且已经阅读了一些 OpenGL 文档。我也读过这篇文章:What does glLoadIdentity() do in OpenGL? 我正在掌握
我的下一个问题(或问题)是,当我用 glm 加载模型时,我能够看穿模型的某些部分,例如:如果有两座山在另一座前面,我可以看穿越近的山。 我会展示一张图片,但由于纹理不起作用,所以无法理解。 问题在这里
我想将 OpenGL 与 C++ 结合使用来创建一个带有“相机”(透视图)和要查看的对象的基本场景。我找到了示例代码 here .但出于某种原因,尽管我已将所有必要的包含和库捆绑在一起(见下文), /
在查看红皮书中的 reshape 示例时,我通常会发现如下内容: void reshape(int w, int h) { glViewport(0, 0, (GLsizei) w, (GLs
我有一个 iPhone 应用程序,我在 appDidFinishLaunching 中调用这三个函数: glMatrixMode(GL_PROJECTION); glOrthof(0, rect.si
在 Mac 上的 Parallels 中运行的 Windows 10 上,android 模拟器在启动时崩溃 C:\Android-SDK>.\tools\bin\avdmanager create
我的 OpenGL C++ 项目突然停止识别 glMatrixMode(GL_MODELVIEW)。我去吃晚饭,然后我的项目无法构建。 我在带有 CDT 插件的 Eclipse 中使用 Windows
我将先发布代码,然后发布以下问题: import java.util.Properties; import org.lwjgl.Sys; import org.lwjgl.input.Keyboard
使用 opengl es 演练黑莓 10 sdk。它使用 2 个命令,即: glMatrixMode(GL_PROJECTION); glLoadIdentity(); 及以后: glMatrixMo
我是一名优秀的程序员,十分优秀!