I have a program that displays an animation with a fixed frame rate (say 30 fps) in a window.
Currently I use SDL but unfortunately it lacks desktop integration(like drag & drop) and now I want to use GTK instead.
so what I want to do (assuming the window is double buffered):
1 obtain off-screen buffer
2 render my stuff to buffer
3 tell the toolkit to swap buffers
4 update window
5 repeat
I don't want to use any features except very basic GDK/GTK calls to create and manage the window and receive input events.
In the FAQ they suggest using GdkRGB. However, in the official documentation for GdkRGB they use the gdk_draw_rgb_image()
function which is deprecated, in fact most GdkRGB functions are.
As an alternative they suggest using OpenGL. The problem with that is it requires some uncommon lib like GtkGLArea that is not part of GTK (I don't want to depend on any libs that aren't installed by default). Also, on my system the driver's OpenGL support is... limited.
I've looked into Cairo (which is offered as the alternative for some deprecated functions) but that would add even more boilerplate code (and I suspect additional overhead) for my relatively simple problem.