英文:
RenderDoc does not connect to OpenGL API
问题
RenderDoc能够检测正在运行的应用程序中的OpenGL API,但显示给我以下屏幕:
我已经更改了OpenGL上下文版本(从4.6更改为3.3),并启用了核心配置文件,方式如下:
import Graphics.UI.GLUT
-- 其他导入
main = do
(_progName, _args) <- getArgsAndInitialize
initialContextVersion $= (3, 3)
initialContextProfile $= [CoreProfile]
initialDisplayMode $= [DoubleBuffered]
-- 渲染代码
这些更改消除了一些警告,但RenderDoc仍然无法连接到API。
我使用freeglut.dll来进行GLUT函数。
英文:
RenderDoc is able to detect OpenGL API in running application, but shows me following screen:
I've already changed the OpenGL context version (from 4.6 to 3.3) and enabled Core Profile following way:
import Graphics.UI.GLUT
-- Other imports
main = do
(_progName, _args) <- getArgsAndInitialize
initialContextVersion $= (3, 3)
initialContextProfile $= [CoreProfile]
initialDisplayMode $= [DoubleBuffered]
-- Rendering code
This removed some of the warnings, but RenderDoc still is not able to connect to the API.
I use freeglut.dll for GLUT functions
答案1
得分: 0
默认情况下,Haskell OpenGL包中的renderPrimitives函数使用glBegin和其他类似的函数。要使用RenderDoc,您需要移除所有不受支持的函数。
在我的情况下,我不得不移除glLoadIdentitiy(loadIdentity),glFrustum(frustum)和renderPrimitives函数,并用着色器替换它们。
此外,不要忘记RenderDoc需要上下文版本3.2+,因此您需要在您的代码中添加类似以下的内容(如果需要,请更改主要版本和次要版本):
initialContextVersion $= (3, 3)
英文:
By default, renderPrimitives in haskell OpenGL package uses glBegin and other similar functions. To use RenderDoc, you need to remove all unsupported functions.
In my case, I had to remove glLoadIdentitiy (loadIdentity), glFrustum (frustum) and renderPrimitives functions and replaced them with shaders
Also, do not forget that RenderDoc requires context version 3.2+, so you need to add something like that to your code (change major and minor versions, if needed):
initialContextVersion $= (3, 3)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论