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 the application loses focus. So, obtain the handle every time you need it. If you want to use cached handles you have to update them in your focus gain function (see below).

Render targets' content is lost when the application loses focus. If you render a texture each frame this is not a problem. But if you render it once, at startup - you must rerender it when the application gains focus. To do this - write a focus gain function and attach it by setting HGE_FOCUSGAINFUNC system state.

Requirements

Header: hge.h
Import library: hge.lib