DTK_LOAD_VIDEO_TCP(3) Draw Toolkit manual DTK_LOAD_VIDEO_TCP(3)NAME
dtk_load_video_tcp - Load an video stream via TCP connection as a texture
SYNOPSIS
#include <dtk_video.h>
dtk_htex dtk_load_video_tcp(int flags, const char *host, int port);
DESCRIPTION
This function loads as a dynamic texture the video stream broadcasted over the network via TCP by the server host on the port port. The
texture will then been tracked by an internal texture manager so that the next call using the same host and port arguments will return the
same texture handle, thus sparing the resources of the system. If not specified by flags the video will not be played immediately and
dtk_video_exec(3) should be called to do start playing.
The argument flags is used to modify the creation. It should contains a bitwise OR combination of the following flags:
DTK_AUTOSTART : Indicates that the video should start immediately after creation.
DTK_NOBLOCKING : Indicates that the creation function should not block waiting that the video pipeline is fully running.
A dynamic texture can be used the same way as a static texture (for example image file). The only difference is that the content of the
texture changes automatically with the stream of video. This means that every time a shape using this texture is drawn, the latest frame
available from the video stream will be mapped on the shape.
There is no need for a valid window to create successfully a texture, i.e. creation of textures are completely decoupled from the creation
of others resources and can even be created in one thread to be used in another one.
Once a the texture is stopped being used, it should be destroyed by dtk_destroy_texture(3).
RETURN VALUE
In case of success, the function returns the handle to the created texture. In case of failure, NULL is returned.
THREAD SAFETY
dtk_load_video_tcp() is thread-safe.
SEE ALSO dtk_destroy_texture(3), dtk_video_exec(3), dtk_video_getstate(3)EPFL 2011 DTK_LOAD_VIDEO_TCP(3)
Check Out this Related Man Page
GLBINDTEXTURE(3G)GLBINDTEXTURE(3G)NAME
glBindTexture - bind a named texture to a texturing target
C SPECIFICATION
void glBindTexture( GLenum target,
GLuint texture )
PARAMETERS
target Specifies the target to which the texture is bound. Must be either GL_TEXTURE_1D, GL_TEXTURE_2D, or GL_TEXTURE_3D.
texture Specifies the name of a texture.
DESCRIPTION
glBindTexture lets you create or use a named texture. Calling glBindTexture with
target set to GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_3D and texture set to the name of the newtexture binds the texture name to the tar-
get. When a texture is bound to a target, the previous binding for that target is automatically broken.
Texture names are unsigned integers. The value zero is reserved to represent the default texture for each texture target. Texture names
and the corresponding texture contents are local to the shared display-list space (see glXCreateContext) of the current GL rendering con-
text; two rendering contexts share texture names only if they also share display lists.
You may use glGenTextures to generate a set of new texture names.
When a texture is first bound, it assumes the dimensionality of its target: A texture first bound to GL_TEXTURE_1D becomes one-dimen-
sional, and a texture first bound to GL_TEXTURE_2D becomes two-dimensional, and a texture first bound to GL_TEXTURE_3D becomes a three-
dimensional texture. The state of a one-dimensional texture immediately after it is first bound is equivalent to the state of the default
GL_TEXTURE_1D at GL initialization, and similarly for two-, and three-dimensional textures.
While a texture is bound, GL operations on the target to which it is bound affect the bound texture, and queries of the target to which it
is bound return state from the bound texture. If texture mapping of the dimensionality of the target to which a texture is bound is active,
the bound texture is used. In effect, the texture targets become aliases for the textures currently bound to them, and the texture name
zero refers to the default textures that were bound to them at initialization.
A texture binding created with glBindTexture remains active until a different texture is bound to the same target, or until the bound tex-
ture is deleted with glDeleteTextures.
Once created, a named texture may be re-bound to the target of the matching dimensionality as often as needed. It is usually much faster
to use glBindTexture to bind an existing named texture to one of the texture targets than it is to reload the texture image using
glTexImage1D, glTexImage2D, or glTexImage3D. For additional control over performance, use glPrioritizeTextures.
glBindTexture is included in display lists.
NOTES
glBindTexture is available only if the GL version is 1.1 or greater.
ERRORS
GL_INVALID_ENUM is generated if target is not one of the allowable values.
GL_INVALID_OPERATION is generated if texture has a dimensionality that doesn't match that of target.
GL_INVALID_OPERATION is generated if glBindTexture is executed between the execution of glBegin and the corresponding execution of glEnd.
ASSOCIATED GETS
glGet with argument GL_TEXTURE_BINDING_1D
glGet with argument GL_TEXTURE_BINDING_2D
glGet with argument GL_TEXTURE_BINDING_3D
SEE ALSO glAreTexturesResident(3G), glDeleteTextures(3G), glGenTextures(3G), glGet(3G),
glGetTexParameter(3G), glIsTexture(3G), glPrioritizeTextures(3G), glTexImage1D(3G), glTexImage2D(3G), glTexParameter(3G)GLBINDTEXTURE(3G)