RenderDoc无法连接到OpenGL API。

huangapple go评论105阅读模式
英文:

RenderDoc does not connect to OpenGL API

问题

RenderDoc能够检测正在运行的应用程序中的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:
RenderDoc无法连接到OpenGL API。

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)

huangapple
  • 本文由 发表于 2023年6月19日 08:07:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/76502957.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定