istereo2
changeset 22:c6971ff4795e
screenshot helper code
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 02 Oct 2015 07:10:19 +0300 |
parents | 8f41da60b9f5 |
children | 7d795dade0bc |
files | ios/shots/SIZES ios/shots/grab src/glut/main.c src/istereo.c |
diffstat | 4 files changed, 86 insertions(+), 8 deletions(-) [+] |
line diff
1.1 --- a/ios/shots/SIZES Fri Oct 02 04:55:54 2015 +0300 1.2 +++ b/ios/shots/SIZES Fri Oct 02 07:10:19 2015 +0300 1.3 @@ -1,5 +1,9 @@ 1.4 -3.5 inch: 960x640 1.5 -4.0 inch: 1136x640 1.6 -4.7 inch: 1334x750 1.7 -5.5 inch: 2208x1242 1.8 - ipad: 2048x1496 1.9 +3.5 inch: 960x640 (1.5) 1.10 +4.0 inch: 1136x640 (1.775) 1.11 +4.7 inch: 1334x750 (1.777) 1.12 +5.5 inch: 2208x1242 (1.778) 1.13 + ipad: 2048x1496 (1.369) 1.14 + 1.15 +shot times: 1.16 +simple/gui: 32:234 1.17 +bump/simple_stereo: 51:102
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/ios/shots/grab Fri Oct 02 07:10:19 2015 +0300 2.3 @@ -0,0 +1,25 @@ 2.4 +#!/bin/sh 2.5 + 2.6 +if [ -z "$1" ]; then 2.7 + name=shot 2.8 +else 2.9 + name=$1 2.10 +fi 2.11 + 2.12 +echo "Capturing iOS applestore shots for: $name" 2.13 + 2.14 +echo 'hit enter to capture 3.5" iphone shot (960x640)' 2.15 +read foo 2.16 +import ${name}_sz35.jpg 2.17 +echo 'hit enter to capture 4.0" iphone shot (1136x640)' 2.18 +read foo 2.19 +import ${name}_sz40.jpg 2.20 +echo 'hit enter to capture 4.7" iphone shot (1134x750)' 2.21 +read foo 2.22 +import ${name}_sz47.jpg 2.23 +echo 'hit enter to capture half-res 5.5" iphone shot (1104x621)' 2.24 +read foo 2.25 +import ${name}_sz55.jpg && mogrify -resize 2208 ${name}_sz55.jpg 2.26 +echo 'hit enter to capture half-res ipad shot (1024x748)' 2.27 +read foo 2.28 +import ${name}_ipad.jpg && mogrify -resize 2048 ${name}_ipad.jpg
3.1 --- a/src/glut/main.c Fri Oct 02 04:55:54 2015 +0300 3.2 +++ b/src/glut/main.c Fri Oct 02 07:10:19 2015 +0300 3.3 @@ -98,11 +98,51 @@ 3.4 break; 3.5 3.6 case '.': 3.7 - seektime(250); 3.8 + seektime(50); 3.9 + break; 3.10 + case '>': 3.11 + seektime(10); 3.12 + break; 3.13 + case ']': 3.14 + seektime(1); 3.15 break; 3.16 3.17 case ',': 3.18 - seektime(-250); 3.19 + seektime(-50); 3.20 + break; 3.21 + case '<': 3.22 + seektime(-10); 3.23 + break; 3.24 + case '[': 3.25 + seektime(-1); 3.26 + break; 3.27 + 3.28 + case '1': 3.29 + glutReshapeWindow(960, 640); /* 3.5 inch iphone */ 3.30 + break; 3.31 + 3.32 + case '2': 3.33 + glutReshapeWindow(1136, 640); /* 4.0 inch iphone */ 3.34 + break; 3.35 + 3.36 + case '3': 3.37 + glutReshapeWindow(1334, 750); /* 4.7 inch iphone */ 3.38 + break; 3.39 + 3.40 + case '4': 3.41 + glutReshapeWindow(2208, 1242); /* 5.5 inch iphone */ 3.42 + break; 3.43 + 3.44 + case '5': 3.45 + glutReshapeWindow(2048, 1496); /* ipad2? */ 3.46 + break; 3.47 + 3.48 + case '9': 3.49 + glutReshapeWindow(1104, 621); /* hald 5.5 inch iphone */ 3.50 + break; 3.51 + 3.52 + case '0': 3.53 + glutReshapeWindow(1024, 748); /* half ipad2 */ 3.54 break; 3.55 3.56 default:
4.1 --- a/src/istereo.c Fri Oct 02 04:55:54 2015 +0300 4.2 +++ b/src/istereo.c Fri Oct 02 07:10:19 2015 +0300 4.3 @@ -138,6 +138,8 @@ 4.4 dtx_close_font(font); 4.5 } 4.6 4.7 +static int time_print_pending; 4.8 + 4.9 void redraw(void) 4.10 { 4.11 float pan_x, pan_y, z; 4.12 @@ -216,6 +218,11 @@ 4.13 #endif 4.14 4.15 assert(glGetError() == GL_NO_ERROR); 4.16 + 4.17 + if(time_print_pending) { 4.18 + printf("t: %lds %ldms\n", time_msec / 1000, time_msec % 1000); 4.19 + time_print_pending = 0; 4.20 + } 4.21 } 4.22 4.23 static void render(float t) 4.24 @@ -443,6 +450,7 @@ 4.25 paused = !paused; 4.26 if(paused) { 4.27 last_pause = sys_msec; 4.28 + time_print_pending = 1; 4.29 } else { 4.30 time_offset -= sys_msec - last_pause; 4.31 } 4.32 @@ -450,7 +458,8 @@ 4.33 4.34 void seektime(long msec) 4.35 { 4.36 - time_offset -= msec; 4.37 + time_offset += msec; 4.38 + time_print_pending = 1; 4.39 } 4.40 4.41 static unsigned int get_shader_program(const char *vfile, const char *pfile)