}
/* render image or only benson */
-void opengl_blit_image(uint8_t *rgb, int filter, int benson_at_line, int render_benson_only, double fov, double monitor_distance, double benson_size)
+void opengl_blit_image(uint8_t *rgb, int filter, int benson_at_line, int render_benson_only, double fov, double monitor_distance, double benson_size, int benson_case)
{
double texture_left = 0;
double texture_right = ((double)image_width) / (double)texture_size;
double slope = tan(fov / 360 * M_PI) * monitor_distance;
/* render image */
+
+ if (benson_case) {
+ glEnable(GL_CULL_FACE);
+ glFrontFace(GL_CW);
+ glCullFace(GL_BACK);
+ }
+
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, image_name);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); /* no modulation with color */
glVertex3f(-benson_size * slope, image_top * slope, -monitor_distance);
glEnd();
glDisable(GL_TEXTURE_2D);
+ /* render benson case */
+ if (benson_case) {
+ double left, right, bottom, top, near, far;
+ left = -benson_size * slope;
+ right = benson_size * slope;
+ bottom = image_bottom * slope;
+ top = image_top * slope;
+ near = -monitor_distance;
+ far = near - benson_size * slope / 3.0;
+ glBegin(GL_QUADS);
+ /* back */
+ glColor4f(0.3, 0.3, 0.3, 1.0);
+ glVertex3f(left, top, far);
+ glVertex3f(right, top, far);
+ glVertex3f(right, bottom, far);
+ glVertex3f(left, bottom, far);
+ /* top */
+ glColor4f(0.2, 0.2, 0.2, 1.0);
+ glVertex3f(left, top, near);
+ glVertex3f(right, top, near);
+ glVertex3f(right, top, far);
+ glVertex3f(left, top, far);
+ /* bottom */
+ glColor4f(0.05, 0.05, 0.05, 1.0);
+ glVertex3f(left, bottom, far);
+ glVertex3f(right, bottom, far);
+ glVertex3f(right, bottom, near);
+ glVertex3f(left, bottom, near);
+ /* left */
+ glColor4f(0.1, 0.1, 0.1, 1.0);
+ glVertex3f(left, bottom, far);
+ glVertex3f(left, bottom, near);
+ glVertex3f(left, top, near);
+ glVertex3f(left, top, far);
+ /* right */
+ glVertex3f(right, top, far);
+ glVertex3f(right, top, near);
+ glVertex3f(right, bottom, near);
+ glVertex3f(right, bottom, far);
+ glEnd();
+ }
+
+ if (benson_case) {
+ glDisable(GL_CULL_FACE);
+ }
}
/* render osd texture */