I'm going to write the following in terms of calls as exposed by C interfaces (for sake of generity; the specification itself completely omits the gl… in front).
glClearColor
selects the color to which the framebuffer is cleared upon a call of glClear(GL_COLOR_BUFFER_BIT | …)
. Without doing a glClear
call it has no effect whatsoever.
glEnable(GL_DEPTH_TEST)
enables depth testing for the drawing calls that follow.
want to add some lines and other shapes and apply on them default color
…
How can I do this?
Uh, just draw them.
which not affect the shapes with textures.
That's how OpenGL works anyway. OpenGL does not describe a scene. OpenGL is all about what's happening "in the moment". It just draws points, lines or triangles, one at a time, and the only "interference" is, that it overdraws pixels in the framebuffer.
Of course with a global state machine, altering state has an effect on everything that follows. So if you want to go back to the previous behavior you have to undo all the state changes you did for a particular drawing you did.