sdlSetGpuRenderStateSamplerBindings function render

bool sdlSetGpuRenderStateSamplerBindings(
  1. Pointer<SdlGpuRenderState> state,
  2. int numSamplerBindings,
  3. Pointer<SdlGpuTextureSamplerBinding> samplerBindings
)

Set sampler bindings variables in a custom GPU render state.

The data is copied and will be binded using SDL_BindGPUFragmentSamplers() during draw call execution.

\param state the state to modify. \param num_sampler_bindings The number of additional fragment samplers to bind. \param sampler_bindings Additional fragment samplers to bind. \returns true on success or false on failure; call SDL_GetError() for more information.

\threadsafety This function should be called on the thread that created the renderer.

\since This function is available since SDL 3.6.0.

extern SDL_DECLSPEC bool SDLCALL SDL_SetGPURenderStateSamplerBindings(SDL_GPURenderState *state, int num_sampler_bindings, const SDL_GPUTextureSamplerBinding *sampler_bindings)

Implementation

bool sdlSetGpuRenderStateSamplerBindings(
  Pointer<SdlGpuRenderState> state,
  int numSamplerBindings,
  Pointer<SdlGpuTextureSamplerBinding> samplerBindings,
) {
  final sdlSetGpuRenderStateSamplerBindingsLookupFunction = _libSdl
      .lookupFunction<
        Uint8 Function(
          Pointer<SdlGpuRenderState> state,
          Int32 numSamplerBindings,
          Pointer<SdlGpuTextureSamplerBinding> samplerBindings,
        ),
        int Function(
          Pointer<SdlGpuRenderState> state,
          int numSamplerBindings,
          Pointer<SdlGpuTextureSamplerBinding> samplerBindings,
        )
      >('SDL_SetGPURenderStateSamplerBindings');
  return sdlSetGpuRenderStateSamplerBindingsLookupFunction(
        state,
        numSamplerBindings,
        samplerBindings,
      ) ==
      1;
}