static inline void render_display_begin(struct obs_display *display) { struct vec4 clear_color; gs_load_swapchain(display ? display->swap : NULL); if (display->size_changed) { gs_resize(display->cx, display->cy); display->size_changed = false; } gs_beginscene(); vec4_set(&clear_color, 0.3f, 0.3f, 0.3f, 1.0f); gs_clear(GS_CLEAR_COLOR | GS_CLEAR_DEPTH | GS_CLEAR_STENCIL, &clear_color, 1.0f, 0); gs_enable_depthtest(false); /* gs_enable_blending(false); */ gs_setcullmode(GS_NEITHER); gs_ortho(0.0f, (float)display->cx, 0.0f, (float)display->cy, -100.0f, 100.0f); gs_setviewport(0, 0, display->cx, display->cy); }
static inline void set_render_size(uint32_t width, uint32_t height) { gs_enable_depthtest(false); gs_enable_blending(false); gs_setcullmode(GS_NEITHER); gs_ortho(0.0f, (float)width, 0.0f, (float)height, -100.0f, 100.0f); gs_setviewport(0, 0, width, height); }
static inline void render_video(struct obs_core_video *video, int cur_texture, int prev_texture) { gs_beginscene(); gs_enable_depthtest(false); gs_setcullmode(GS_NEITHER); render_main_texture(video, cur_texture); render_output_texture(video, cur_texture, prev_texture); if (video->gpu_conversion) render_convert_texture(video, cur_texture, prev_texture); stage_output_texture(video, cur_texture, prev_texture); gs_setrendertarget(NULL, NULL); gs_enable_blending(true); gs_endscene(); }
static inline void render_begin(struct obs_display *display) { struct vec4 clear_color; uint32_t width, height; gs_load_swapchain(display ? display->swap : NULL); gs_getsize(&width, &height); gs_beginscene(); vec4_set(&clear_color, 0.3f, 0.0f, 0.0f, 1.0f); gs_clear(GS_CLEAR_COLOR | GS_CLEAR_DEPTH | GS_CLEAR_STENCIL, &clear_color, 1.0f, 0); gs_enable_depthtest(false); /* gs_enable_blending(false); */ gs_setcullmode(GS_NEITHER); gs_ortho(0.0f, (float)width, 0.0f, (float)height, -100.0f, 100.0f); gs_setviewport(0, 0, width, height); }