Note that there are some explanatory texts on larger screens.

plurals
  1. POKeep a stream from fstream open through member functions
    primarykey
    data
    text
    <p>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</p> <pre><code>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-&gt;bits(); } </code></pre> <p>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.</p> <p>I would then like to blit it to the screen with:</p> <pre><code>void myscreen::blit(const QImage &amp;img, const QPoint &amp;topLeft, const QRegion &amp;region) { QScreen::blit(img, topLeft, region); write(myscreen_Fb, image.bits(), image.size()); } </code></pre> <p>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?</p> <p><strong><em>update</em></strong></p> <p>I made the changes suggested and declared the function in the class but get this error which is driving me crazy.</p> <pre><code>error: expected constructor, destructor, or type conversion before '.' token </code></pre> <p>It refers to the line which contains:</p> <pre><code>vopuscreenFd.open("/dev/fb0", fstream::out); </code></pre> <p>Bryce</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload