I tried with following methods - 1. using glew 2. using glut
both almost similar ways as follows -
#include <stdio.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
int main(int agrc, char **argv)
{
//do windowing related stuff here
if ( !glfwInit())
{
printf("Error: Failed to initialize GLFW\n");
return -1;
}
GLFWwindow* window = glfwCreateWindow(800, 600, "Triangle", NULL, NULL);
if (window == NULL)
{
printf("Failed to create GLFW window\n");
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
glewExperimental = GL_TRUE;
if (glewInit() != GLEW_OK)
{
printf("Error: Failed to initialize GLEW\n");
return -1;
}
printf("GL version: %s\n", glGetString(GL_VERSION));
printf("GL shading language version: %s\n",
glGetString(GL_SHADING_LANGUAGE_VERSION));
}
Question - Is it possible to check GL and GLSL Version with creating native window?
As per my understanding it is necessary to create GL context which is usually done by creating a window, Please tell me alternative without creating window.