HGE::Target_GetTexture

Returns a render target's texture handle.

HTEXTURE Target_GetTexture(
  HTARGET target
);

Parameters

target
Handle of the render target which texture handle will be returned.

Return value

Returns the render target's texture handle.

Remarks

You may use the returned texture for rendering to screen or other render targets.

DON'T delete the textures obtained with Target_GetTexture call! The results are unpredictable. A render target's texture is deleted automatically during render target deletion.

The texture handle, returned by Target_GetTexture may change when contents of video memory is lost (eg. mode switching). So, obtain the handle every time you need it. If you want to use cached handles you have to update them in your HGE_GFXRESTOREFUNC function.

Render targets' content can be lost due to events like video mode switching. If you render a texture each frame this is not a problem. But if you render it once, at startup - you must rerender it upon signal from HGE. To do this - write a rendering function and attach it by setting HGE_GFXRESTOREFUNC system state.

Requirements

Header: hge.h
Import library: hge.lib