2

I have an OpenGL 4.5 capable GPU and I wish to test if my application runs on an OpenGL 4.3 capable system. Can I set my GPU to use OpenGL 4.3?

Andreas
  • 177
  • 1
  • 8

1 Answers1

4

Can you forcibly limit your OpenGL implementation to a specific version? No. Implementations are permitted to give you any version which is 100% compatible with the one you asked for. And 4.5 is compatible with 4.3.

However, using the right OpenGL loading library, you can forcibly limit your header. Several libraries allow you to generate version-specific headers, which will provide APIs and enums for just that version and nothing else. And any extensions you wish to use.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
  • Thank you for your answer. Can you validate this with an example? I'm currently using GLEW in my project but can change that if necessary. – Andreas Sep 29 '16 at 07:27
  • @Andreas here's an example of generating headers and loader using [glad](https://github.com/Dav1dde/glad): `glad --out-path=./glad --generator=c --api="gl=4.3" --extensions=""`. Just don't forget to include the generated `glad.c` to source files list (and `-ldl` to linker flags if you're on Linux). For another generators see the link in this answer. – Ruslan May 14 '17 at 12:39