You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i use sdl2 an sdl_gpu lib (SDL_gpu)[https://github.com/grimfang4/sdl-gpu] i can use shader process my image like this
GPU_Image* image = GPU_LoadImage("data/test3.png");
Uint32 color_shader;
GPU_ShaderBlock color_block = load_shader_program(&color_shader, "data/shaders/common.vert", "data/shaders/color.frag");
int color_loc = GPU_GetUniformLocation(color_shader, "myColor");
GPU_ActivateShaderProgram(color_shader, &color_block);
update_color_shader((1+sin(t))/2, (1+sin(t+1))/2, (1+sin(t+2))/2, 1.0f, color_loc);
GPU_Blit(image, NULL, screen, screen->w/4, screen->h/4);
,now How do I apply shaders to images in SDL3, and is there any demo code available?
The text was updated successfully, but these errors were encountered:
when i use sdl2 an sdl_gpu lib (SDL_gpu)[https://github.com/grimfang4/sdl-gpu] i can use shader process my image like this
GPU_Image* image = GPU_LoadImage("data/test3.png");
Uint32 color_shader;
GPU_ShaderBlock color_block = load_shader_program(&color_shader, "data/shaders/common.vert", "data/shaders/color.frag");
int color_loc = GPU_GetUniformLocation(color_shader, "myColor");
GPU_ActivateShaderProgram(color_shader, &color_block);
update_color_shader((1+sin(t))/2, (1+sin(t+1))/2, (1+sin(t+2))/2, 1.0f, color_loc);
GPU_Blit(image, NULL, screen, screen->w/4, screen->h/4);
The text was updated successfully, but these errors were encountered: