[gameprogrammer] Re: rendering video using OpenGL and SDL
- From: " Kuon - Nicolas Goy - 時期精霊 (Goyman.com SA) - 675 " <kuon@xxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Wed, 16 May 2007 15:20:26 +0200
On 16 May 2007, at 5:24 AM, Scott Harper wrote:
Never use glDrawPixels, each time you call this, it will upload the
data from CPU to GPU and do a lot of things you don't want, which
require sync and all. It is a slow path, it can be horrible on some GPU.
The best bet is to prepare a couple of textures in GPU memory with 0
in them, then use glTexSubImage2D when you need to upload new data.
In our in game movie player, we draw a quad at each frame, with
texture+textureIndex where i goes from 0 to textureCount, and we let
the render function go at the speed it wants, then in an other
thread, we upload a new texture every 1/30 sec and change
textureIndex. Don't forget to block opengl, as it is not thread safe.
If we use multiple texture, it is only because we are streaming from
the filesystem, and if the buffer under run, we simply increment
textureIndex to keep smooth animation while we load the rest.
Regards
--
Kuon
"Don't press that button."
http://goyman.com/
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- References:
- [gameprogrammer] rendering video using OpenGL and SDL
- From: Husam Zakaria
- [gameprogrammer] Re: rendering video using OpenGL and SDL
- From: Scott Harper
- [gameprogrammer] Re: rendering video using OpenGL and SDL
- From: Husam Zakaria
- [gameprogrammer] Re: rendering video using OpenGL and SDL
- From: Scott Harper
Other related posts:
- » [gameprogrammer] rendering video using OpenGL and SDL
- » [gameprogrammer] Re: rendering video using OpenGL and SDL
- » [gameprogrammer] Re: rendering video using OpenGL and SDL
- » [gameprogrammer] Re: rendering video using OpenGL and SDL
- » [gameprogrammer] Re: rendering video using OpenGL and SDL
- » [gameprogrammer] Re: rendering video using OpenGL and SDL
- [gameprogrammer] rendering video using OpenGL and SDL
- From: Husam Zakaria
- [gameprogrammer] Re: rendering video using OpenGL and SDL
- From: Scott Harper
- [gameprogrammer] Re: rendering video using OpenGL and SDL
- From: Husam Zakaria
- [gameprogrammer] Re: rendering video using OpenGL and SDL
- From: Scott Harper