Using OpenGL Core Profile with OpenGL 3.0

Hi,

I want to use OpenGL 3.0 in a core profile context.
I use GLFW with this code :

#include <iostream>

#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>

void main() {
	if (!glfwInit())
	{
		return;
	}

	glfwWindowHint(GLFW_SAMPLES, 4);
	glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
	glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
	glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
	glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

	GLFWwindow* window;
	window = glfwCreateWindow(1024, 768, "testGL", NULL, NULL);
	if (window == NULL) {
		fprintf(stderr, "Failed to open GLFW window. If you have an Intel GPU, they are not 3.3 compatible. Try the 2.1 version of the tutorials.
");
		glfwTerminate();
		return;

	}
	glfwMakeContextCurrent(window);
	glewExperimental = true; // Needed in core profile
	if (glewInit() != GLEW_OK) {
		fprintf(stderr, "Failed to initialize GLEW
");
		return;
	}
}

If my minor version is lether than 2 the code dosen’t works.
My question is : wath is the minimum OpenGL version to use Core Profile. (I think is 3.0 but it seem 3.2).

Regards,
Robin

All outlined here: https://www.opengl.org/wiki/Core_And_Compatibility_in_Contexts

Ptofiles were introduced in GL 3.2.

“The 3.0 form of context creation allows the user to ask for a profile. Initially, only one profile was available: core” (wiki)
If I understand, OpenGL 3.0 must be used in core profile.
But with GLFW, why I can’t create an OpenGL 3.0 context ?

[QUOTE=robinfaury;1281725]“The 3.0 form of context creation allows the user to ask for a profile. Initially, only one profile was available: core” (wiki)
If I understand, OpenGL 3.0 must be used in core profile.[/QUOTE]
No. There is on profiles in OpenGL 3.0. Alfonse noticed the error and changed it today.

By the way, wikis should never be used as references.

I don’t know the answer since I’ve never used GLFW. The full control is the main reason I like to do everything by myself.
Why do you need GL 3.0 exactly?

Ok so using OpenGL 3.0 in Core Profile is a mistake.
If I want to use OpenGL context in Core Profile I have to use OpenGL 3.2.
Thant for your answer :slight_smile: