ich möchte ein Videostream auf ein QGLWidget legen.
Jedoch zeigt er mir im Programmablauf nichts an.
Die QGLWidget wird auf ein QWidget gelegt.
im QWidget:
Code: Alles auswählen
GLBox* openglBox;
openglBox = new GLBox( this, "glbox"); //f, "glbox"
.....
//Aufruf:
openglBox->LoadGL( dataPtr /*Videostream*/ );
Code: Alles auswählen
void GLBox::initializeGL()
{
qglClearColor( white );
glEnable( GL_DEPTH_TEST );
glClearDepth(1.0f);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
}
....
bool GLBox::LoadGL( unsigned char* pic )
{
bool Status = true; // Status Indicator
if(pic != NULL)
{
glDisable(GL_DEPTH_TEST);
glColorMask( 1, 1, 1, 1 ); //enable colors rgba
glDisable(GL_BLEND);// Disable Blending
glPixelZoom( 1, -1 );
glRasterPos3i( 320, 240, 0 );
glDrawPixels( m_grab.GetWidth(), m_grab.GetHeight(), GL_BGRA_EXT, GL_UNSIGNED_BYTE, pic );
glDisable(GL_BLEND);// Disable Blending
glEnable(GL_DEPTH_TEST);// Enable Depth Testing
}
else
{
printf("\nPic can't load for the gl widget!\n");
}
return Status; // Return The Status
}
Bei der Ausgabe kommt jedoch nur ein weisses Bild?
Kann mir jemand einen Tipp geben in welcher Richtung das Problem liegen könnte, oder wo ich Fehler mache!
Gruß und Dank!