SDL_gpu  0.11.0
A hardware-accelerated, cross-platform 2D graphics API
Data Structures
Context Controls

Data Structures

struct  GPU_Context
 
DECLSPEC GPU_Target *SDLCALL GPU_GetContextTarget (void)
 
DECLSPEC GPU_Target *SDLCALL GPU_GetWindowTarget (Uint32 windowID)
 
DECLSPEC GPU_Target *SDLCALL GPU_CreateTargetFromWindow (Uint32 windowID)
 
DECLSPEC void SDLCALL GPU_MakeCurrent (GPU_Target *target, Uint32 windowID)
 
DECLSPEC GPU_bool SDLCALL GPU_SetWindowResolution (Uint16 w, Uint16 h)
 
DECLSPEC GPU_bool SDLCALL GPU_SetFullscreen (GPU_bool enable_fullscreen, GPU_bool use_desktop_resolution)
 
DECLSPEC GPU_bool SDLCALL GPU_GetFullscreen (void)
 
DECLSPEC void SDLCALL GPU_SetShapeBlending (GPU_bool enable)
 
DECLSPEC GPU_BlendMode SDLCALL GPU_GetBlendModeFromPreset (GPU_BlendPresetEnum preset)
 
DECLSPEC void SDLCALL GPU_SetShapeBlendFunction (GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha)
 
DECLSPEC void SDLCALL GPU_SetShapeBlendEquation (GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation)
 
DECLSPEC void SDLCALL GPU_SetShapeBlendMode (GPU_BlendPresetEnum mode)
 
DECLSPEC float SDLCALL GPU_SetLineThickness (float thickness)
 
DECLSPEC float SDLCALL GPU_GetLineThickness (void)
 

Detailed Description

Function Documentation

◆ GPU_CreateTargetFromWindow()

DECLSPEC GPU_Target* SDLCALL GPU_CreateTargetFromWindow ( Uint32  windowID)

Creates a separate context for the given window using the current renderer and returns a GPU_Target that represents it.

Definition at line 478 of file SDL_gpu.c.

◆ GPU_GetBlendModeFromPreset()

DECLSPEC GPU_BlendMode SDLCALL GPU_GetBlendModeFromPreset ( GPU_BlendPresetEnum  preset)

Translates a blend preset into a blend mode.

Definition at line 1743 of file SDL_gpu.c.

◆ GPU_GetContextTarget()

DECLSPEC GPU_Target* SDLCALL GPU_GetContextTarget ( void  )
Returns
The renderer's current context target.

Definition at line 1293 of file SDL_gpu.c.

◆ GPU_GetFullscreen()

DECLSPEC GPU_bool SDLCALL GPU_GetFullscreen ( void  )

Returns true if the current context target's window is in fullscreen mode.

Definition at line 513 of file SDL_gpu.c.

◆ GPU_GetLineThickness()

DECLSPEC float SDLCALL GPU_GetLineThickness ( void  )

Returns the current line thickness value.

Definition at line 22 of file SDL_gpu_shapes.c.

◆ GPU_GetWindowTarget()

DECLSPEC GPU_Target* SDLCALL GPU_GetWindowTarget ( Uint32  windowID)
Returns
The target that is associated with the given windowID.

Definition at line 385 of file SDL_gpu.c.

◆ GPU_MakeCurrent()

DECLSPEC void SDLCALL GPU_MakeCurrent ( GPU_Target target,
Uint32  windowID 
)

Makes the given window the current rendering destination for the given context target. This also makes the target the current context for image loading and window operations. If the target does not represent a window, this does nothing.

Definition at line 497 of file SDL_gpu.c.

◆ GPU_SetFullscreen()

DECLSPEC GPU_bool SDLCALL GPU_SetFullscreen ( GPU_bool  enable_fullscreen,
GPU_bool  use_desktop_resolution 
)

Enable/disable fullscreen mode for the current context target's window. On some platforms, this may destroy the renderer context and require that textures be reloaded. Unfortunately, SDL does not provide a notification mechanism for this.

Parameters
enable_fullscreenIf true, make the application go fullscreen. If false, make the application go to windowed mode.
use_desktop_resolutionIf true, lets the window change its resolution when it enters fullscreen mode (via SDL_WINDOW_FULLSCREEN_DESKTOP).
Returns
0 if the new mode is windowed, 1 if the new mode is fullscreen.

Definition at line 505 of file SDL_gpu.c.

◆ GPU_SetLineThickness()

DECLSPEC float SDLCALL GPU_SetLineThickness ( float  thickness)

Sets the thickness of lines for the current context.

Parameters
thicknessNew line thickness in pixels measured across the line. Default is 1.0f.
Returns
The old thickness value

Definition at line 16 of file SDL_gpu_shapes.c.

◆ GPU_SetShapeBlendEquation()

DECLSPEC void SDLCALL GPU_SetShapeBlendEquation ( GPU_BlendEqEnum  color_equation,
GPU_BlendEqEnum  alpha_equation 
)

Sets the blending component equations for shape rendering.

Definition at line 1872 of file SDL_gpu.c.

◆ GPU_SetShapeBlendFunction()

DECLSPEC void SDLCALL GPU_SetShapeBlendFunction ( GPU_BlendFuncEnum  source_color,
GPU_BlendFuncEnum  dest_color,
GPU_BlendFuncEnum  source_alpha,
GPU_BlendFuncEnum  dest_alpha 
)

Sets the blending component functions for shape rendering.

Definition at line 1858 of file SDL_gpu.c.

◆ GPU_SetShapeBlending()

DECLSPEC void SDLCALL GPU_SetShapeBlending ( GPU_bool  enable)

Enables/disables alpha blending for shape rendering on the current window.

Definition at line 1734 of file SDL_gpu.c.

◆ GPU_SetShapeBlendMode()

DECLSPEC void SDLCALL GPU_SetShapeBlendMode ( GPU_BlendPresetEnum  mode)

Sets the blending mode for shape rendering on the current window, if supported by the renderer.

Definition at line 1884 of file SDL_gpu.c.

◆ GPU_SetWindowResolution()

DECLSPEC GPU_bool SDLCALL GPU_SetWindowResolution ( Uint16  w,
Uint16  h 
)

Change the actual size of the current context target's window. This resets the virtual resolution and viewport of the context target. Aside from direct resolution changes, this should also be called in response to SDL_WINDOWEVENT_RESIZED window events for resizable windows.

Definition at line 529 of file SDL_gpu.c.