Begins to refactor the unholy mess that is `write_object_data.cpp`
Re-merge pull request #802 from sorlok/with_timelines_final

Some serious shit was happening in CompilerSource/compiler/components/write_object_data.cpp during the last pull request, and this had to be manually patched.
Revert "Merge pull request #799 from enigma-dev/revert-789-GL3.3Fixes"

This reverts commit f969248d94c46f6d6b95e2dd4928f5def99d46b4, reversing
changes made to 9ba26d8d96e8966b9f055b409543dc5fefebded2.
Fixes conflicts with master
Fixing GL3.3

-Started removing deprecated functions again.
-Fixes GLEW

Trying to fix glsl_attribute_set now.
More conflicts and update
Partially fixes drawing by adding VAO

-It turns out in GL core, you always must have a Vertex Array Object. If
it's not there, then you cannot use attributes. So I added a vertex
array object to the Mesh. Down the road it could speed things up.

Rendering is still messed up.
More GL fixes

-Moved VAO to the correct place, so it updates correctly.
-Changed shader so color blending happens differently, more closer to
GM8.
-Changed shader version to proper one.
-GL now errors with show_error() instead of printf'ing and then
segfaulting.
Fixes GL1 model update

-GL1 now uses lists as additional batching. These lists were not updated
when needed though. This broke Minecraft example. Now it's fixed.
-Also resolved a conflict that reverted some things in GLtextures.
Adds global VAO

-GL3.3 core requires at least one VAO bound when using buffers. The
"proper" way would be to create one per object. But sadly that doesn't
work correctly right, so I added a global one in OPENGL3Std.cpp. There
is also conflicting information on what is faster.
-Buffers are now generated at the mesh creation time.  Just as they are
deleted at mesh deletion. Technically we could get rid of the extra
generation routine in general.
Fixes surface rendering

-This fixes water in Project Mario.
Fixes deletion of glList in GL1

-The list was never deleted. Now when the mesh is destroyed the list is
deleted.
-The GL list is now created with the mesh. This way we don't have to do
additional checking to know if it's available or not.
Xlib changes

-Adds an include for memcpy to work on Xlib.
-Adds new context creation code for xlib-GL3 bridge, so it actually
creates a GL3 context.
-Also adds debug possibility to GL3 context on xlib.

This probably breaks linux, as it hasn't been compiled.
XLib changes and small optimizations

-GLXEW has STATIC flag now, like its windows countrerpart.
-Added glewInit() to xlib bridge.
-Added missing include.
-Small GL3 optimization by calling glBufferData(NULL), before total
buffer overwrite.
Added glxewInit()

-For xlib window functions we need to do glxewInit() as well. A
temporary context needs to be created for that.
Removed glxewInit()

-It turns out it's only defined when several contexts are used. It also
calls the same thing glewInit() does. So I removed it. But it maybe
fixes problems, as I still left the context, which was probably needed
for glewInit previously.
Ring buffer test

-Adds a ring buffer for STREAMING data. This should greatly reduce
stalling of GPU pipeline, but it's not working yet. Have some problems
with corruption.

DO NOT MERGE
Ring test continues

-I cannot for the life of me figure out why it doesn't work like this.
The values written the next frame are multiples of 256. Then more. So 10
frames later indexes are in hundreds of thousands, while I only have 1
thousands vertices defined.

If I'm not able to fix it this way, I'll try the multiple VBO variant.
Basically the same, but uses seperate VBO's.
Another Xlib fix test

-Maybe now?
Getting closer with ring buffer

-There is some offset issues in the vertex buffer. Still trying to fix.