Hi, I am trying to keep a stream to a file /dev/fb0 (linux framebuffer) open throughout several Qt member functions. The goal is to use a myscreen::connect function to open up the framebuffer
bool myscreen::connect()
{
std::fstream myscreen_Fb;
myscreen_Fb.open("/dev/fb0")
QImage* image;
image = new QImage(w, h, QImage::Format_RGB888);
QScreen::data = image->bits();
}
This would ideally open the frame buffer and create a new QImage to act as a memory buffer for the data being written to the screen. Then my "image" would point to the first visible pixel (memory) on the screen through the bits() function. I have to implement this because my hardware does not support the default memory mapping.
I would then like to blit it to the screen with:
void myscreen::blit(const QImage &img, const QPoint &topLeft, const QRegion ®ion)
{
QScreen::blit(img, topLeft, region);
write(myscreen_Fb, image.bits(), image.size());
}
I cant seem to get the pointer to the first visible pixel open to use and get complaints from GCC about myscreen_Fb not being declared in the scope. Any ideas?
update
I made the changes suggested and declared the function in the class but get this error which is driving me crazy.
error: expected constructor, destructor, or type conversion before '.' token
It refers to the line which contains:
vopuscreenFd.open("/dev/fb0", fstream::out);
Bryce