Skip to content

GetMovieTexture

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions
BlitzLLVM

GetMovieTexture 〔BlitzLLVM〕

GetMovieTexture:Int32 movie:Int32
Parameter Mode Type Default Description
movie In Int32 required A movie handle from OpenMovie.

Returns: The handle of the texture, or 0 if the movie is not open.

Description

〔BlitzLLVM〕 This command does not exist in the original Blitz products. BlitzLLVM adds it.

Gives a texture that shows the movie, so that a movie can be on any surface of a 3D scene: a cube, a screen in a room, a sprite. The texture is as big as the movie and always has the picture of the movie that is playing. It is brought up to date whenever the program draws a movie (DrawMovie), asks about one (MoviePlaying, MoviePosition), renders the world (RenderWorld) or waits (Delay), so a 3D program only needs to render. Asking for the texture starts a movie that was not started yet, and the texture follows all the movie commands: it stays on the picture while the movie is paused, shows the first picture after StopMovie and the picture of the position after SeekMovie. This is a BlitzLLVM extension: the originals can only draw a movie onto the screen.

Every call for the same movie gives the same texture. It belongs to the movie, so do not free it with FreeTexture: it is freed with CloseMovie. It is an ordinary color texture without mip maps, which can be given to an entity with EntityTexture, a brush with BrushTexture and so on, and whose sampler can be changed with SetTextureSampler.

Differences

  • A debug build (-d) stops the program when the movie does not exist, for example the 0 of a movie that failed to open, other builds ignore the command, see Debug handle checks.

Examples

Graphics3D 640, 480, 0, 2
SetBuffer BackBuffer()
camera = CreateCamera()
PositionEntity camera, 0, 0, -3
cube = CreateCube()
EntityFX cube, 1                 ; not lit, so the movie has its own colors
movie = OpenMovie("intro.mpg")
EntityTexture cube, GetMovieTexture(movie)
While Not KeyHit(1)
	TurnEntity cube, 0, 1, 0
	RenderWorld
	Flip
Wend

A movie of a test pattern on a turning cube (the program above, made with tools/render_movie_samples.py); the picture is the one of the movie at that time:

Media

A movie on a cube

Related Commands

CloseMovie, DrawMovie, LoopMovie 〔BlitzLLVM〕, MovieHeight, MovieLength 〔BlitzLLVM〕, MoviePlaying, MoviePosition 〔BlitzLLVM〕, MovieVolume 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally