RenderDoc does not connect to OpenGL API

638 Views Asked by At

RenderDoc is able to detect OpenGL API in running application, but shows me following screen: Error 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

There are 1 best solutions below

0
A. Lukyanov On BEST ANSWER

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)