I want to keep a title on the top of my program at all times, so I can't use ("cls") because that clears everything on the screen. Is there a way to permanently keep something on the screen or to choose whta you want to delete?
Like it would be great if I could put ("cls") in functions and it would only delete what was in that function.. anyway do any of you have an idea?
The reason for this lies with how pixels are displayed on screen. (you'll appreciate this when you start doing Open GL, Direct X... all low level graphics APIs)
A
nd basically it works this way:
1.Whenever you render something on screen you are creating a picture.
2.When you want to alter the picture/creating a new frame, you basically destroying the previous picture and creating a new one.
(thats how all animation is created:
e.g.
mouse movement
3D graphics (these are just pictures being drawn each frame)
................. And basically any form of visual interactivity.
)
The only solution is that when you clear the screen, you'll have to draw again what you will want to be kept so as to give the illusion that it wasn't erased. This is exactly what I have to do in Open GL.
1. So in languages like DarkBasic Pro (What I first started using) everytime it synced it was virtually deleting everything on the screen and redrawing it?
2. So by telling C++ to draw it again, it wouldn't make the program slower? Because of adding more code? But is actually the ideal way to do it?