问题标签 [glew]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
opengl - Cg problems with OpenGL
I'm working on an OpenGL project on Windows, using GLEW to provide the functionality the provided Windows headers lack. For shader support, I'm using NVIDIA's Cg. All the documentation and code samples I have read indicate that the following is the correct method for loading an using shaders, and I've implemented things this way in my code:
- Create a Cg context with
cgCreateContext
. - Get the latest vertex and pixel shader profiles using
cgGLGetLatestProfile
withCG_GL_VERTEX
andCG_GL_FRAGMENT
, respectively. UsecgGLSetContextOptimalOptions
to create the optimal setup for both profiles. - Using these profiles and shaders you have written, create shader programs using
cgCreateProgramFromFile
. - Load the shader programs using
cgGLLoadProgram
.
Then, each frame, for an object that uses a given shader:
- Bind the desired shader(s) (vertex and/or pixel) using
cgGLBindProgram
. - Enable the profile(s) for the desired shader(s) using
cgGLEnableProfile
. - Retrieve and set any needed uniform shader parameters using
cgGetNamedParameter
and the various parameter setting functions. - Render your object normally
- Clean up the shader by calling
cgGLDisableProfile
However, things start getting strange. When using a single shader everything works just fine, but the act of loading a second shader with cgGLLoadProgram
seems to make objects using the first one cease to render. Switching the draw order seems to resolve the issue, but that's hardly a fix. This problem occurs on both my and my partner's laptops (fairly recent machines with Intel integrated chipsets).
I tested the same code on my desktop with a GeForce GTX 260, and everything worked fine. I would just write this off as my laptop GPU not getting along with Cg, but I've successfully built and run programs that use several Cg shaders simultaneously on my laptop using the OGRE graphics engine (unfortunately the assignment I'm currently working on is for a computer graphics class, so I can't just use OGRE).
In conclusion, I'm stumped. What is OGRE doing that my code is not? Am I using Cg improperly?
mingw - 使用 MinGW 在 Windows 上构建 GLEW 1.7.0
之前有人问过很多问题:如何在 Windows 上使用 MinGW 编译 GLEW 1.7.0 源代码?目标是从 c++ 项目动态链接库。
更多信息:我正在使用 QtCreator,因此使用 qmake 进行构建。我在 Windows 7 上。到目前为止,我已经尝试/查看了以下链接。
使用 vc++ 库静态,构建 dll.a 重用 vc++ .dll
使用 GLEW msvc++ 二进制文件的简单东西,适用于我的桌面
不幸的是,当我在项目中使用编译结果时,所有发布的解决方案都以以下错误消息结尾:
我对这个问题束手无策。我已经两次和三次检查了 qmake 中的 LIBS 路径和 Windows 路径变量,以包含 glew dll 所在的目录。qmake 的 INCLUDEPATH 也应该没问题。无论如何,这里是 .pro 文件中的路径:
那么有没有人可以提供一套关于如何使用 MinGW 编译 GLEW 1.7.0 源代码的万无一失的说明?
c++ - Eclipse CDT 编辑器无法识别 OpenGL 扩展
我在 Eclipse 中使用顶点数组对象和顶点缓冲区对象,但编辑器似乎无法识别函数声明。该程序编译和执行没有任何抱怨。
(请注意,错误是“无法解析功能。”)
我试过同时使用 GLee 和 GLEW,但结果是一样的。关于如何让 Eclipse 识别编辑器中的功能的任何想法?
visual-studio-2010 - Visual Studio 2010 中的 freeglut 问题
我一直在尝试安装 glew 和 freeglut 以与 Visual Studio 2010 一起使用。我遵循了本指南并回溯了几次以确保我正确地遵循了它,但是当我尝试编译示例代码时仍然出现以下错误结束:
错误 1 error LNK2019: unresolved external symbol _ imp _glutMainLoop@0 在函数 _main c:\Users\Esteban\documents\visual studio 2010\Projects\Chapter 1 Project\Chapter 1 Project\main.obj Chapter 1 Project 中引用
错误 2 错误 LNK2019:未解析的外部符号_imp _glutDisplayFunc @4 在函数 _InitWindow c:\Users\Esteban\documents\visual studio 2010\Projects\Chapter 1 Project\Chapter 1 Project\main.obj Chapter 1 Project 中引用
错误 3 error LNK2019: unresolved external symbol _ imp _glutReshapeFunc@4 referenced in function _InitWindow c:\Users\Esteban\documents\visual studio 2010\Projects\Chapter 1 Project\Chapter 1 Project\main.obj Chapter 1 Project
错误 4 error LNK2019: unresolved external symbol _ imp _glutInitDisplayMode@4 referenced in function _InitWindow c:\Users\Esteban\documents\visual studio 2010\Projects\Chapter 1 Project\Chapter 1 Project\main.obj Chapter 1 Project
和更多类似的。我不知道它是否有问题,但最初我不小心抓住了 64 位版本。我意识到我的错误并用 32 位版本覆盖了文件,然后清理并再次尝试构建,结果相同。
qt - 为 Qt + OpenGL + GLUT + GLEW 应用程序创建安装程序
我们(我和我在大学的同学)使用标题中列出的程序/库创建了一个 3D 医学可视化软件。现在我们很想为我们的应用程序创建一个安装程序,但我们似乎没有找到正确的解决方案。我一直在环顾四周,看到一些很酷的程序可以编译你得到的所有东西并创建安装程序,但我的问题如下:
它是否编译、链接并添加到安装程序 GLUT 和 GLEW 库?
我们很难在窗户上安装所有这些垃圾,我无法想象医生会经历同样痛苦的过程,如果你明白我的意思......
那么,是否有任何应用程序可以使这成为可能?
opengl - 链接到 NVIDIA OpenGL 库
我正在尝试正确运行 OpenGL 程序。我正在使用带有 GT 630M 的笔记本电脑,操作系统是 Fedora 16 64 位。它使用大黄蜂,我必须optirun
在每个可执行文件之前使用才能访问 GPU。
这是glx信息:
我正在尝试编译的程序来自一本名为“交互式计算机图形学”的书,源代码可以在这里下载:http ://www.cs.unm.edu/~angel/BOOK/INTERACTIVE_COMPUTER_GRAPHICS/SIXTH_EDITION/
我只是使用以下命令编译了示例程序:
当我像这样运行程序时,optirun ./example1
我遇到了段错误。我不确定是图书馆还是我编译它的方式,但似乎从来没有工作过。如果我尝试运行该示例,./example1
则会收到以下错误:
关于如何让 OpenGL 4.1 在这台笔记本电脑上工作的任何想法?
注意:我的 CUDA 程序运行成功。
更新: ldd ./example1 的输出
c++ - OpenGL:调用 glewInit() 后 glGetError() 返回无效枚举
我使用 GLEW 和 freeglut。出于某种原因,在调用 glewInit() 后,glGetError() 返回错误代码 1280,即使 glewExperimental = GL_FALSE 也是如此。
我无法编译着色器,glGetProgramInfoLog() 返回“顶点着色器在调用 glLinkProgram() 之前没有成功编译。链接失败。” 我之前能够编译着色器。
重新安装驱动程序没有帮助。
这是我的代码:
我做错了什么?
c++ - 类型“GLchar”无法解析
我正在使用 Eclipse、MinGW,并且我已经编译了 freeglut 和 glew,并将它们的库、DLL 和头文件复制到了正确的位置(MinGW/include/GL、MinGW/lib、Windows/SysWOW64)。我还在 MinGW C++ 链接器下链接了 Eclipse 中的库(freeglut64、opengl32、glew32、glu32)。这是我的代码...
我相信我所做的一切都是正确的,但是,Eclipse 在 VertexShader 和 FragmentShader 上抛出错误“无法解析类型 'GLchar'”。我是否在代码中犯了错误或错过了所需的步骤?
c++ - glGenFramebuffers 中的段错误
我遇到了段错误,不知道为什么。与我一起工作的人在 OSX 机器上编译并正确运行。gdb backtrace 告诉我它来自这部分代码,特别是来自 glGenFramebuffers:
我正在使用操作系统提供的 Nvidia 最新专有驱动程序运行 12.04 Ubuntu 和 Nvidia 卡。我对 OpenGL 不是很熟悉,很多代码是我的伙伴的,他似乎也被难住了。如果您需要任何进一步的信息,我很乐意提供。
c - linking to glew in c
I can't link properly to glew.
I have done:
However, I still get the error:
LNK2019: unresolved external symbol __glewGenBuffersARB referenced in function initialize