Cyphre
12-07-2006, 01:52 PM
Hello to all on the forum,
My aim is to achieve fastest blitting under Windows.
I'm using software rendering engine for hi-quality 2D antialiased vectorial GUI(as I need pixel-perfect crossplatform output). So far I have been using StretchBlt() WinAPI function to blit either the whole framebuffer or some part of it on the screen.
Recently I have read that it is possible to achieve faster HW accelerated blitting using OpenGL texture surface so I tried to write simple test which uses glBindTexture() and glTexImage2D()/glTexSubImage2D() OpenGL calls and then maps the texture on some quad shape.
It worked fast in case I have SW generated the texture bitmap once and load it to the GFX card memory (using the glBindTexture()). Unfortunately the framerate went rapidly down when I wanted to change content of the texture bitmap in every frame (probably due the CPU-MEM<->GPU-MEM transfer) so I guess in my case the HW blitting has no reason as it is fast only for games when you load all your textures into the GFX memory first. Or am I wrong?
To make my case clear. I need to:
1.SW render into framebuffer
2.blit as fast as possible into the window.
in every frame
Is there any way how to change content of the OpenGL texture directly at pixel level without the need to re-load it from CPU-MEM to GFX-MEM? Any other ideas how to solve this most efficiently?
My aim is to achieve fastest blitting under Windows.
I'm using software rendering engine for hi-quality 2D antialiased vectorial GUI(as I need pixel-perfect crossplatform output). So far I have been using StretchBlt() WinAPI function to blit either the whole framebuffer or some part of it on the screen.
Recently I have read that it is possible to achieve faster HW accelerated blitting using OpenGL texture surface so I tried to write simple test which uses glBindTexture() and glTexImage2D()/glTexSubImage2D() OpenGL calls and then maps the texture on some quad shape.
It worked fast in case I have SW generated the texture bitmap once and load it to the GFX card memory (using the glBindTexture()). Unfortunately the framerate went rapidly down when I wanted to change content of the texture bitmap in every frame (probably due the CPU-MEM<->GPU-MEM transfer) so I guess in my case the HW blitting has no reason as it is fast only for games when you load all your textures into the GFX memory first. Or am I wrong?
To make my case clear. I need to:
1.SW render into framebuffer
2.blit as fast as possible into the window.
in every frame
Is there any way how to change content of the OpenGL texture directly at pixel level without the need to re-load it from CPU-MEM to GFX-MEM? Any other ideas how to solve this most efficiently?