Hello
Don't worry (or don't panic !)
First, when I opened the main.cpp I saw something that is going to hurt.
Let's see :
gfx_buffer* screen_buffer;
screen_buffer->graphics( "p01n3trz t3st", 640,480);As I told you, this, when running, will crash immediately. I will try to explain it.
screen_buffer, is a pointer to a gfx_buffer. Well, that's fine. But, I pointer is just like, an arrow pointing on something. Here, you don't point on anything and you are trying to use (second line : screen_buffer->graphics(...)) your "pointer on whatever".
It's a bit like having a mail adress as follow :
vdus<ovn oudsnv
vndusnvsduvsnuo
vndsuivd
Try to reach this

And computers are dumb. They will try. More precisely, in fact, screen_buffer does contain a value. Sometimes (when running in Windows debugger) it is 0 (or NULL). Sometimes, it is random. But everytime, it is not what you want.
When you are trying to do : screen_buffer->... (trying to use the pointer) and that it contains 0, it crash (everytime). Since 0 is not a valid pointer.
With random value, it depends on operating system and CPU. Since the random value can point memory that you own, it will not crash, but it is likely to crash (now or later).
So, first advice :
Always give a value to a new variable. Trust me, uninitialized variables are not your friends. Uninitialized pointers (since these are variables more or less as others) as to be initialized.
When you don't know which value to use, put 0. It will help you, at least by crashing the program immediately (but the bug will be more visible than just random behaviour).
Ok, it was the first part.
A pointer, litteraly, it's a memory address. It's just a memory address that we put in a variable and that we can follow to reach the memory (or an object stored in memory, or a variable stored in memory).
When you see a pointer :
int* pA = NULL; It just means this is a pointer, that will point on a int. So, if you follow the address in the pointer (ok, here, the address is 0 and it will crash), you will find a variable of type int.
More precisely :
int myVar = 42;
int* pMyVar = &myVarHere, I have a variable called "myVar" which contains 42. Ok, it means, in some way, that the computer stored 42 in its memory.
Now, the second line.
&myVar means -> the addresse of myVar.
So, pMyVar, is a pointer leading to a int, which is initialized to the address of myVar. It means, that, when I will follow the pointer (*pMyVar), it will lead me to 42

Second advice : to differentiate the variables with the pointers, I am using a "special" syntax. All my variables that are pointers, are called beginning with 'p'.
At least, it will help me to see if I have to use '.' or '->' syntax.
So, let's go back to your main.cpp
The point is that you have never initialized your pointers. You will have to do it, at the beginning of the main.
To allocate some memory (meaning, telling to the system the program wants to use some memory cells for its own usage), you will use "new" (it's a C++ keyword).
When you want to release the memory (meaning, telling to the system, the program does not need this memory anymore), you will use "delete".
So, at some point, at the very beginning of main, you will see :
screen_buffer = new gfx_buffer();Here, it allocates the space needed for a gfx_buffer, and new will return you, the address of this new storage that the OS allowed you to use.
At the very end of main, you will see :
delete screen_bufferWhich will call the destructor of your gfx_buffer.
Well, I saw your graphics function and I am understanding that you want to do.
You have to put graphics() and create_gfx_graphics() as static. Otherwise, you will have to do the "new" call.
Why ?
Because you can't use your gfx_buffer, since it needs to be initialized to be used. A static function can be used without initializing (creating) any of the class instance
Otherwise, you can also do the "graphics() function stuff" in the constructor of the class. Which sounds proper
I will stop here for now. Tell me if it is becoming understandable, or not.
Don't hesitate to ask more and more
