I'm able to render with element buffers but not GLbegin/GLend?

I’m trying to render simple lines, for some reason, this code…

while (!glfwWindowShouldClose(window))
    {
        	glfwPollEvents();

		glClearColor(0,0,0,1);
       		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

		glActiveTexture(GL_TEXTURE0);
		glBindTexture(GL_TEXTURE_2D,TX_RECON);
		glUniform1i(TEX_S,0);

		glBegin(GL_LINES);
		glVertex2f(0,0);
		glVertex2f(100,100);
		glEnd();

        	glfwSwapBuffers(window);
    }

… doesn’t work.

I can render element buffers fine but I’d rather use glBegin for what I’m planning to do.

Is there some way to fix this? Or are there other ways to render simple lines?

First, it’s not clear if you’re creating a compatibility context or not. If not, then you don’t have access to glBegin/glEnd, or any of the other compatibility functionality.

Second, if you’re using a vertex shader (which is what it seems like, as you use glUniform1i), then your vertex shader needs to use the appropriate input to receive and process the vertex data. gl_Vertex, in your case.