invisible
diff src/main.cc @ 12:226073258785
quick backup: display video, draw tesselated quads
author | Eleni Maria Stea <eleni@mutantstargoat.com> |
---|---|
date | Mon, 04 Nov 2013 23:39:22 +0200 |
parents | 4f1b8ddcd32e |
children | 65fd6d7c42b1 |
line diff
1.1 --- a/src/main.cc Mon Nov 04 21:53:21 2013 +0200 1.2 +++ b/src/main.cc Mon Nov 04 23:39:22 2013 +0200 1.3 @@ -1,11 +1,12 @@ 1.4 #include <GL/glew.h> 1.5 #include <GL/glut.h> 1.6 + 1.7 +#include <assert.h> 1.8 #include <stdio.h> 1.9 1.10 -#include <pthread.h> 1.11 - 1.12 #include "kinect.h" 1.13 #include "frame.h" 1.14 +#include "tesquad.h" 1.15 1.16 freenect_context *kin_ctx; 1.17 freenect_device *kin_dev; 1.18 @@ -45,7 +46,7 @@ 1.19 glutIdleFunc(idle); 1.20 1.21 glClearColor(1, 1, 1, 1); 1.22 - frame = new Frame(); 1.23 + frame = new Frame; 1.24 1.25 atexit(cleanup); 1.26 glutMainLoop(); 1.27 @@ -66,9 +67,19 @@ 1.28 fprintf(stderr, "Failed to process events.\n"); 1.29 exit(0); 1.30 } 1.31 + assert(glGetError() == GL_NO_ERROR); 1.32 frame->process(); 1.33 1.34 + glEnable(GL_TEXTURE_2D); 1.35 + glBindTexture(GL_TEXTURE_2D, frame->video_tex); 1.36 + assert(glGetError() == GL_NO_ERROR); 1.37 + draw_tess_quad(-1, -1, 0.6, 0.6, 1, 1); 1.38 +// glBindTexture(GL_TEXTURE_2D, frame->depth_tex); 1.39 +// draw_tes.. 1.40 + glDisable(GL_TEXTURE_2D); 1.41 + 1.42 glutSwapBuffers(); 1.43 + assert(glGetError() == GL_NO_ERROR); 1.44 } 1.45 1.46 static void reshape(int w, int h)