1
Feature requests / Pixel Buffer Objects support in SFML2
« on: November 21, 2012, 01:30:44 am »
Greetings
In my program I have a lot of image data coming in (you can think of the data as the frames of a movie streaming) and I'm currently using the update function of the Texture class to refresh the texture on screen, as follow:
Which works, but I noticed that as I increase the size of the texture the performance drops dramatically (for obvious reasons).
I read in a few places that Pixel Buffer Objects could be used to create spaces of shared memory between the CPU and the GPU (if I understood correctly). Right now I'm constantly copying data from the CPU to the GPU when calling the update function, maybe if I simply setup a space in memory where I can update my image data and tell OpenGL to use that space in memory to display my texture things would be faster.
Any suggestions? Ideas?
In my program I have a lot of image data coming in (you can think of the data as the frames of a movie streaming) and I'm currently using the update function of the Texture class to refresh the texture on screen, as follow:
// sf::Texture *texture = ....
void onFrameAvailable(char *bitmap_in){
texture->update((sf::Uint8 *)bitmap_in, textureWidth, textureHeight, 0, 0);
}
void onFrameAvailable(char *bitmap_in){
texture->update((sf::Uint8 *)bitmap_in, textureWidth, textureHeight, 0, 0);
}
Which works, but I noticed that as I increase the size of the texture the performance drops dramatically (for obvious reasons).
I read in a few places that Pixel Buffer Objects could be used to create spaces of shared memory between the CPU and the GPU (if I understood correctly). Right now I'm constantly copying data from the CPU to the GPU when calling the update function, maybe if I simply setup a space in memory where I can update my image data and tell OpenGL to use that space in memory to display my texture things would be faster.
Any suggestions? Ideas?