34 this->resize(_parent->size());
40 m_rgb.resize(640*480*3);
53 glClearColor(0.4f, 0.4f, 0.4f, 1.0f);
56 glEnable(GL_DEPTH_TEST);
57 glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
62 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
63 glEnable(GL_TEXTURE_2D);
66 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
67 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
76 glViewport(0,0,_w,_h);
77 glMatrixMode(GL_PROJECTION);
79 glOrtho (0, 640, 480, 0, -1.0f, 1.0f);
80 glMatrixMode(GL_MODELVIEW);
91 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
106 glTexImage2D(GL_TEXTURE_2D, 0, 3, 640, 480, 0, GL_RGB, GL_UNSIGNED_BYTE, &
m_rgb[0]);
109 glEnable(GL_TEXTURE_2D);
111 glBegin(GL_TRIANGLE_FAN);
112 glColor4f(255.0f, 255.0f, 255.0f, 255.0f);
113 glTexCoord2f(0, 0); glVertex3f(0,0,0);
114 glTexCoord2f(1, 0); glVertex3f(640,0,0);
115 glTexCoord2f(1, 1); glVertex3f(640,480,0);
116 glTexCoord2f(0, 1); glVertex3f(0,480,0);