0

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
    Those functions (glBegin, glColor4f, etc.) are part of the compatibility profile, which RenderDoc [does not support](https://renderdoc.org/docs/behind_scenes/opengl_support.html). – Yun Jun 19 '23 at 18:40

1 Answers1

0

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)