ObjectivelyGPU
Object oriented graphics framework for SDL3 and C
Loading...
Searching...
No Matches
GraphicsPipeline.c File Reference
#include <assert.h>
#include "GraphicsPipeline.h"
#include "RenderDevice.h"

Macros

#define _Class   _GraphicsPipeline
 

Functions

static void dealloc (Object *self)
 
static GraphicsPipelineinitWithDevice (GraphicsPipeline *self, RenderDevice *device, const SDL_GPUGraphicsPipelineCreateInfo *info)
 
static void initialize (Class *clazz)
 
Class * _GraphicsPipeline (void)
 

Variables

OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUColorTargetBlendState GPU_BlendStateOpaque
 
OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUColorTargetBlendState GPU_BlendStateAlpha
 
OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUColorTargetBlendState GPU_BlendStatePremultipliedAlpha
 
OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUColorTargetBlendState GPU_BlendStateAdditive
 
OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUGraphicsPipelineCreateInfo GPU_GraphicsPipeline3D
 
OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUGraphicsPipelineCreateInfo GPU_GraphicsPipeline2D
 

Macro Definition Documentation

◆ _Class

#define _Class   _GraphicsPipeline

Function Documentation

◆ _GraphicsPipeline()

Class * _GraphicsPipeline ( void  )

◆ dealloc()

static void dealloc ( Object *  self)
static
See also
Object::dealloc(Object *)

◆ initialize()

static void initialize ( Class *  clazz)
static
See also
Class::initialize(Class *)

◆ initWithDevice()

static GraphicsPipeline * initWithDevice ( GraphicsPipeline self,
RenderDevice device,
const SDL_GPUGraphicsPipelineCreateInfo *  info 
)
static

Variable Documentation

◆ GPU_BlendStateAdditive

OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUColorTargetBlendState GPU_BlendStateAdditive
Initial value:
= {
.enable_blend = true,
.src_color_blendfactor = SDL_GPU_BLENDFACTOR_SRC_ALPHA,
.dst_color_blendfactor = SDL_GPU_BLENDFACTOR_ONE,
.color_blend_op = SDL_GPU_BLENDOP_ADD,
.src_alpha_blendfactor = SDL_GPU_BLENDFACTOR_ONE,
.dst_alpha_blendfactor = SDL_GPU_BLENDFACTOR_ONE,
.alpha_blend_op = SDL_GPU_BLENDOP_ADD,
}

◆ GPU_BlendStateAlpha

OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUColorTargetBlendState GPU_BlendStateAlpha
Initial value:
= {
.enable_blend = true,
.src_color_blendfactor = SDL_GPU_BLENDFACTOR_SRC_ALPHA,
.dst_color_blendfactor = SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
.color_blend_op = SDL_GPU_BLENDOP_ADD,
.src_alpha_blendfactor = SDL_GPU_BLENDFACTOR_ONE,
.dst_alpha_blendfactor = SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
.alpha_blend_op = SDL_GPU_BLENDOP_ADD,
}

◆ GPU_BlendStateOpaque

OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUColorTargetBlendState GPU_BlendStateOpaque
Initial value:
= {
.enable_blend = false,
}

◆ GPU_BlendStatePremultipliedAlpha

OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUColorTargetBlendState GPU_BlendStatePremultipliedAlpha
Initial value:
= {
.enable_blend = true,
.src_color_blendfactor = SDL_GPU_BLENDFACTOR_ONE,
.dst_color_blendfactor = SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
.color_blend_op = SDL_GPU_BLENDOP_ADD,
.src_alpha_blendfactor = SDL_GPU_BLENDFACTOR_ONE,
.dst_alpha_blendfactor = SDL_GPU_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
.alpha_blend_op = SDL_GPU_BLENDOP_ADD,
}

◆ GPU_GraphicsPipeline2D

OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUGraphicsPipelineCreateInfo GPU_GraphicsPipeline2D
Initial value:
= {
.primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST,
.rasterizer_state = {
.fill_mode = SDL_GPU_FILLMODE_FILL,
.cull_mode = SDL_GPU_CULLMODE_NONE,
.enable_depth_clip = true,
},
.multisample_state = {
.sample_count = SDL_GPU_SAMPLECOUNT_1,
},
}

◆ GPU_GraphicsPipeline3D

OBJECTIVELYGPU_EXPORT_DATA const SDL_GPUGraphicsPipelineCreateInfo GPU_GraphicsPipeline3D
Initial value:
= {
.primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST,
.rasterizer_state = {
.fill_mode = SDL_GPU_FILLMODE_FILL,
.cull_mode = SDL_GPU_CULLMODE_BACK,
.front_face = SDL_GPU_FRONTFACE_COUNTER_CLOCKWISE,
.enable_depth_clip = true,
},
.multisample_state = {
.sample_count = SDL_GPU_SAMPLECOUNT_1,
},
.depth_stencil_state = {
.compare_op = SDL_GPU_COMPAREOP_LESS_OR_EQUAL,
.enable_depth_test = true,
.enable_depth_write = true,
},
}