-static void plane_clip_projection( m4x4f mat, v4f plane )
-{
- v4f c =
- {
- (vg_signf(plane[0]) + mat[2][0]) / mat[0][0],
- (vg_signf(plane[1]) + mat[2][1]) / mat[1][1],
- -1.0f,
- (1.0f + mat[2][2]) / mat[3][2]
- };
-
- v4_muls( plane, 2.0f / v4_dot(plane,c), c );
-
- mat[0][2] = c[0];
- mat[1][2] = c[1];
- mat[2][2] = c[2] + 1.0f;
- mat[3][2] = c[3];
+static struct pipeline{
+ glmesh fsquad;
+
+ framebuffer *fb_main,
+ *fb_water_reflection,
+ *fb_water_beneath,
+ *fb_workshop_preview,
+ *fb_network_status;
+ int ready;
+}
+gpipeline;
+
+struct framebuffer{
+ const char *display_name;
+ int resolution_div, /* definition */
+ fixed_w,
+ fixed_h,
+
+ render_w, /* runtime */
+ render_h;
+
+ struct framebuffer_attachment{
+ const char *display_name;
+
+ enum framebuffer_attachment_type{
+ k_framebuffer_attachment_type_none,
+ k_framebuffer_attachment_type_texture,
+ k_framebuffer_attachment_type_renderbuffer,
+ k_framebuffer_attachment_type_texture_depth
+ }
+ purpose;
+
+ enum framebuffer_quality_profile{
+ k_framebuffer_quality_all,
+ k_framebuffer_quality_high_only
+ }
+ quality;
+
+ GLenum internalformat,
+ format,
+ type,
+ attachment;
+
+ GLuint id;
+
+ /* Runtime */
+ int debug_view;
+ }
+ attachments[5];
+ GLuint fb;
+ framebuffer **link;