dbf-udg
changeset 4:5fb21401b7c8
lala
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 07 Feb 2013 18:52:28 +0200 |
parents | 403ec1be3a1a |
children | e09cbb2e9d4f |
files | src/scroller.cc src/udg.cc |
diffstat | 2 files changed, 26 insertions(+), 6 deletions(-) [+] |
line diff
1.1 --- a/src/scroller.cc Fri Jan 11 22:52:56 2013 +0200 1.2 +++ b/src/scroller.cc Thu Feb 07 18:52:28 2013 +0200 1.3 @@ -25,6 +25,7 @@ 1.4 1.5 void draw_scroller(float sec) 1.6 { 1.7 + return; 1.8 glPushAttrib(GL_ENABLE_BIT); 1.9 1.10 glDisable(GL_DEPTH_TEST);
2.1 --- a/src/udg.cc Fri Jan 11 22:52:56 2013 +0200 2.2 +++ b/src/udg.cc Thu Feb 07 18:52:28 2013 +0200 2.3 @@ -106,7 +106,6 @@ 2.4 2.5 void draw_backdrop() 2.6 { 2.7 - /* 2.8 glPushAttrib(GL_ENABLE_BIT); 2.9 glDisable(GL_DEPTH_TEST); 2.10 glDisable(GL_LIGHTING); 2.11 @@ -132,23 +131,27 @@ 2.12 glPopMatrix(); 2.13 2.14 glPopAttrib(); 2.15 - */ 2.16 - draw_scroller(glutGet(GLUT_ELAPSED_TIME) / 1000.0); 2.17 + /*draw_scroller(glutGet(GLUT_ELAPSED_TIME) / 1000.0); */ 2.18 } 2.19 2.20 void disp() 2.21 { 2.22 float ldir[] = {-1, 1, 2, 0}; 2.23 2.24 + int xres = xsz / DITHER_SZ; 2.25 + int yres = ysz / DITHER_SZ; 2.26 + /*int xres = xsz; 2.27 + int yres = ysz;*/ 2.28 + 2.29 if(!rtarg) { 2.30 - printf("(re)creating render target (%dx%d)\n", xsz / DITHER_SZ, ysz / DITHER_SZ); 2.31 - if(!(rtarg = create_rtarg(xsz / DITHER_SZ, ysz / DITHER_SZ))) { 2.32 + printf("(re)creating render target (%dx%d)\n", xres, yres); 2.33 + if(!(rtarg = create_rtarg(xres, yres))) { 2.34 exit(0); 2.35 } 2.36 } 2.37 2.38 glBindFramebufferEXT(GL_FRAMEBUFFER, rtarg->fbo); 2.39 - glViewport(0, 0, xsz / DITHER_SZ, ysz / DITHER_SZ); 2.40 + glViewport(0, 0, xres, yres); 2.41 2.42 glClearColor(1, 1, 1, 1); 2.43 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 2.44 @@ -255,6 +258,22 @@ 2.45 switch(key) { 2.46 case 27: 2.47 exit(0); 2.48 + 2.49 + case 'f': 2.50 + { 2.51 + static bool fullscreen; 2.52 + static int orig_x, orig_y; 2.53 + 2.54 + fullscreen = !fullscreen; 2.55 + if(fullscreen) { 2.56 + orig_x = xsz; 2.57 + orig_y = ysz; 2.58 + glutFullScreen(); 2.59 + } else { 2.60 + glutReshapeWindow(orig_x, orig_y); 2.61 + } 2.62 + } 2.63 + break; 2.64 } 2.65 } 2.66