[gameprogrammer] Re: rendering video using OpenGL and SDL

Dear Scott Harper you wrote :

So, when written as is, the movie is NOT rendered when it should be,
but if you comment out the code to render the game without the movie,
then the movie IS rendered...?

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

Other related posts: