How to render pixels on screen after rendering a rotating object?

I made a program based on colorful triangle example. This version of code allows me to render window’s gl content event I resize or click on borders. Now the thing I want to do it rendering some pixels directly on gl content over rotating triangle. I really want to understand it. What is the way I achieve it? :pray:

void Draw(GLFWwindow* window) {
	

	glfwMakeContextCurrent(window);
	while (!glfwWindowShouldClose(window))
	{
		float ratio;
		mat4x4 m, p, mvp;
		glfwGetFramebufferSize(window, &width, &height);
		ratio = width / (float)height;

		glViewport(0, 0, width, height);
		glClear(GL_COLOR_BUFFER_BIT);

		mat4x4_identity(m);
		mat4x4_rotate_Z(m, m, (float)glfwGetTime());
		mat4x4_ortho(p, -ratio, ratio, -1.f, 1.f, 1.f, -1.f);
		mat4x4_mul(mvp, p, m);

		glUseProgram(program);
		glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*)mvp);
		glDrawArrays(GL_TRIANGLES, 0, 3);
		glEnd();

		/*I EXPECTED RENDERING PIXELS HERE*/
		/*VOID(...)*/

		cout << "[FRAME]";

		glfwSwapBuffers(window);
		this_thread::sleep_for(10ms);
	}
}

This could mean a lot of things, so I don’t have a precise answer. I recommendation following a tutorial such as this one Learn OpenGL with GLFW to learn OpenGL rendering techniques.

I passed it trough texture:

I switched shader using glUseProgram(0); to zero. At this time that renders white not the color I put to “char *data”. I think I have to switch to a different shader with glUseProgram(…) but whatever I did produced white result.

UPDATE: I found a way to render different color than white I just put glColor3f(…); Before glBegin(…); And I got expected result.

Here is a short video: GLFW test - YouTube

Note that this forum is for helping people with the GLFW API (functions which begin with glfw), and not for general OpenGL questions (functions which begin with gl only), which is why I suggested following a tutorial and going from there. It looks like you’ve solved your problem now - using textures is a good approach for the problem you describe.