All Classes Functions Variables Typedefs Enumerations Groups
Classes | Typedefs
Initialization
Collaboration diagram for Initialization:

Classes

struct  GPU_RendererID
 

Typedefs

typedef Uint32 GPU_FeatureEnum
 
typedef Uint32 GPU_InitFlagEnum
 
DECLSPEC SDL_version SDLCALL GPU_GetLinkedVersion (void)
 
DECLSPEC void SDLCALL GPU_SetInitWindow (Uint32 windowID)
 
DECLSPEC Uint32 SDLCALL GPU_GetInitWindow (void)
 
DECLSPEC void SDLCALL GPU_SetPreInitFlags (GPU_InitFlagEnum GPU_flags)
 
DECLSPEC GPU_InitFlagEnum SDLCALL GPU_GetPreInitFlags (void)
 
DECLSPEC void SDLCALL GPU_SetRequiredFeatures (GPU_FeatureEnum features)
 
DECLSPEC GPU_FeatureEnum SDLCALL GPU_GetRequiredFeatures (void)
 
DECLSPEC void SDLCALL GPU_GetDefaultRendererOrder (int *order_size, GPU_RendererID *order)
 
DECLSPEC void SDLCALL GPU_GetRendererOrder (int *order_size, GPU_RendererID *order)
 
DECLSPEC void SDLCALL GPU_SetRendererOrder (int order_size, GPU_RendererID *order)
 
DECLSPEC GPU_Target *SDLCALL GPU_Init (Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
 
DECLSPEC GPU_Target *SDLCALL GPU_InitRenderer (GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
 
DECLSPEC GPU_Target *SDLCALL GPU_InitRendererByID (GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
 
DECLSPEC GPU_bool SDLCALL GPU_IsFeatureEnabled (GPU_FeatureEnum feature)
 
DECLSPEC void SDLCALL GPU_CloseCurrentRenderer (void)
 
DECLSPEC void SDLCALL GPU_Quit (void)
 

Detailed Description

SDL_gpu has a fairly simple initialization process. If you need nothing more than the default initialization, call:

GPU_Target* screen = GPU_Init(width, height, GPU_DEFAULT_INIT_FLAGS);

Then when you're done, clean up with:

GPU_Quit();

Other functions in the Initialization module control how initialization is performed.

Typedef Documentation

typedef Uint32 GPU_FeatureEnum

Important GPU features which may not be supported depending on a device's extension support. Can be bitwise OR'd together.

See Also
GPU_IsFeatureEnabled()
GPU_SetRequiredFeatures()
typedef Uint32 GPU_InitFlagEnum

Initialization flags for changing default init parameters. Can be bitwise OR'ed together. Default (0) is to use late swap vsync and double buffering.

See Also
GPU_SetPreInitFlags()
GPU_GetPreInitFlags()

Function Documentation

DECLSPEC void SDLCALL GPU_CloseCurrentRenderer ( void  )

Clean up the renderer state.

DECLSPEC void SDLCALL GPU_GetDefaultRendererOrder ( int *  order_size,
GPU_RendererID order 
)

Gets the default initialization renderer IDs for the current platform copied into the 'order' array and the number of renderer IDs into 'order_size'. Pass NULL for 'order' to just get the size of the renderer order array. Will return at most GPU_RENDERER_ORDER_MAX renderers.

DECLSPEC Uint32 SDLCALL GPU_GetInitWindow ( void  )

Returns the window ID that has been set via GPU_SetInitWindow().

DECLSPEC GPU_InitFlagEnum SDLCALL GPU_GetPreInitFlags ( void  )

Returns the current special flags to use for initialization.

DECLSPEC void SDLCALL GPU_GetRendererOrder ( int *  order_size,
GPU_RendererID order 
)

Gets the current renderer ID order for initialization copied into the 'order' array and the number of renderer IDs into 'order_size'. Pass NULL for 'order' to just get the size of the renderer order array.

DECLSPEC GPU_FeatureEnum SDLCALL GPU_GetRequiredFeatures ( void  )

Returns the current required features to use for initialization.

DECLSPEC GPU_Target* SDLCALL GPU_Init ( Uint16  w,
Uint16  h,
GPU_WindowFlagEnum  SDL_flags 
)

Initializes SDL and SDL_gpu. Creates a window and goes through the renderer order to create a renderer context.

See Also
GPU_SetRendererOrder()
DECLSPEC GPU_Target* SDLCALL GPU_InitRenderer ( GPU_RendererEnum  renderer_enum,
Uint16  w,
Uint16  h,
GPU_WindowFlagEnum  SDL_flags 
)

Initializes SDL and SDL_gpu. Creates a window and the requested renderer context.

DECLSPEC GPU_Target* SDLCALL GPU_InitRendererByID ( GPU_RendererID  renderer_request,
Uint16  w,
Uint16  h,
GPU_WindowFlagEnum  SDL_flags 
)

Initializes SDL and SDL_gpu. Creates a window and the requested renderer context. By requesting a renderer via ID, you can specify the major and minor versions of an individual renderer backend.

See Also
GPU_MakeRendererID
DECLSPEC GPU_bool SDLCALL GPU_IsFeatureEnabled ( GPU_FeatureEnum  feature)

Checks for important GPU features which may not be supported depending on a device's extension support. Feature flags (GPU_FEATURE_*) can be bitwise OR'd together.

Returns
1 if all of the passed features are enabled/supported
0 if any of the passed features are disabled/unsupported
DECLSPEC void SDLCALL GPU_Quit ( void  )

Clean up the renderer state and shut down SDL_gpu.

DECLSPEC void SDLCALL GPU_SetInitWindow ( Uint32  windowID)

The window corresponding to 'windowID' will be used to create the rendering context instead of creating a new window.

DECLSPEC void SDLCALL GPU_SetPreInitFlags ( GPU_InitFlagEnum  GPU_flags)

Set special flags to use for initialization. Set these before calling GPU_Init().

Parameters
GPU_flagsAn OR'ed combination of GPU_InitFlagEnum flags. Default flags (0) enable late swap vsync and double buffering.
DECLSPEC void SDLCALL GPU_SetRendererOrder ( int  order_size,
GPU_RendererID order 
)

Sets the renderer ID order to use for initialization. If 'order' is NULL, it will restore the default order.

DECLSPEC void SDLCALL GPU_SetRequiredFeatures ( GPU_FeatureEnum  features)

Set required features to use for initialization. Set these before calling GPU_Init().

Parameters
featuresAn OR'ed combination of GPU_FeatureEnum flags. Required features will force GPU_Init() to create a renderer that supports all of the given flags or else fail.