[gameprogrammer] Re: rendering video using OpenGL and SDL

  • From: Robbert de Groot <zekaric@xxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Tue, 15 May 2007 16:47:12 -0400 (EDT)

--- Husam Zakaria <hzcppff@xxxxxxxxx> wrote:
> but I didn't say that!, you should focus very well in my mail, I
> said that
> the movie is rendered very well when I comment out the code that
> render the
> current frame of the game.
> 
> however, I have solved the problem by using glDrawPixels function
> to render
> the SDL surface that have the frame from the movie, that will solve
> the
> problem if I want to render the movie in fullscreen mode, but when
> I render
> the surface to an OpenGL texture and then render the texture to a
> face from
> a cube for an example, it will be very slow because I have to
> create the
> texture every frame and copy the pixels from the movie surface to
> the
> texture to render it as a OpenGL texture and delete it every frame,
> any one
> would tell me how I can do it without creating the texture every
> frame and
> destroying it every frame in OpenGL.
> 
> I think that it should be possible to create the texture once and
> copy the
> SDL_Surface to it every frame without deleting it and recreating it
> every
> frame.
> 
> Husam Zakaria

Look up glTexSubImage2D().  It allows you to replace part or the
whole texture without having you to remove and reinsert a texture.

http://www.glprogramming.com/red/chapter09.html


      Ask a question on any topic and get answers from real people. Go to 
Yahoo! Answers and share what you know at http://ca.answers.yahoo.com

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: