/** * Update state related to the current draw/read framebuffers. * Specifically, update these framebuffer fields: * _ColorDrawBuffers * _NumColorDrawBuffers * _ColorReadBuffer * _DepthBuffer * _StencilBuffer * If the current framebuffer is user-created, make sure it's complete. * The following functions can effect this state: glReadBuffer, * glDrawBuffer, glDrawBuffersARB, glFramebufferRenderbufferEXT, * glRenderbufferStorageEXT. */ void _mesa_update_framebuffer(GLcontext *ctx) { struct gl_framebuffer *fb = ctx->DrawBuffer; struct gl_framebuffer *fbread = ctx->ReadBuffer; update_framebuffer(ctx, fb); if (fbread != fb) update_framebuffer(ctx, fbread); }
/** * Update state related to the draw/read framebuffers. */ void _mesa_update_framebuffer(struct gl_context *ctx, struct gl_framebuffer *readFb, struct gl_framebuffer *drawFb) { assert(ctx); update_framebuffer(ctx, drawFb); if (readFb != drawFb) update_framebuffer(ctx, readFb); _mesa_update_clamp_vertex_color(ctx, drawFb); _mesa_update_clamp_fragment_color(ctx, drawFb); }
/** * Update state related to the current draw/read framebuffers. */ void _mesa_update_framebuffer(struct gl_context *ctx) { struct gl_framebuffer *drawFb; struct gl_framebuffer *readFb; assert(ctx); drawFb = ctx->DrawBuffer; readFb = ctx->ReadBuffer; update_framebuffer(ctx, drawFb); if (readFb != drawFb) update_framebuffer(ctx, readFb); }
void peek_for_resize() { SDL_Event events[100]; int num = SDL_PeepEvents(events, 100, SDL_PEEKEVENT, SDL_WINDOWEVENT, SDL_WINDOWEVENT); for (int i = 0; i < num; i++) { if (events[i].type == SDL_WINDOWEVENT && events[i].window.event == SDL_WINDOWEVENT_RESIZED) { update_framebuffer(); } } }