Access to all video memory through OpenGL programming

How to access the video memory of a video card through OpenGL programming, in particular, to get the entire contents of the video memory?

I tried the following two methods but could not. With their connection, I hope you could point out an error in my program or my understanding of the structure of video memory. Thanks in advance!

My main idea is to continue highlighting the uninitialized area in the video memory until I examine the entire contents of the video memory.

(1) In the main function, I create a window with double buffers (see the following codes).

int main(int argc,char ** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA); // double buffers
    glutInitWindowPosition(0,0);
    glutInitWindowSize(windowWidth, windowHeight);
    glutCreateWindow("Hope to be successful!");
    glutDisplayFunc(myDisplay); // call back function "myDisplay"
    glutKeyboardFunc(keyboard);
    glutMainLoop();

    free(PixelData);
    return 0;
}

, "myDisplay", -, glReadPixels(), , "PixelData" , , , glDrawPixels(). . . , . , .

, . , /, , , , , , . , ( )?

, ( ), , . , .

OpenBL frameBuffer (FBO), : OpenGL , . , . , -, .

(2) FBO , FBO .

FBO 7 renderbuffer (RBO), 7 FBO .

const int RBO_COUNT = 7; //how many renderBuffer objects are created to attach to the frameBuffer object

int main(int argc, char **argv)
{
    ....
    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_ALPHA); // display mode
    ...  

    // create a framebuffer object
    glGenFramebuffers(1, &fboId);
    glBindFramebuffer(GL_FRAMEBUFFER, fboId);

    //Create several 7 render buffer objects and attach all of them to the FBO.
    glGenRenderbuffers(RBO_COUNT, rbo);
    for (int i = 0; i < RBO_COUNT; i++)
    {
        glBindRenderbuffer(GL_RENDERBUFFER, rbo[i]);
        glRenderbufferStorage(GL_RENDERBUFFER, PIXEL_FORMAT, SCREEN_WIDTH, SCREEN_HEIGHT);
        glFramebufferRenderbuffer(GL_FRAMEBUFFER, colorAttach[i], GL_RENDERBUFFER, rbo[i]);
    }

   // check FBO status
   bool status = checkFramebufferStatus();
   if(!status) fboUsed = false;

    glBindFramebuffer(GL_FRAMEBUFFER, 0);
    ...

    glutMainLoop(); /* Start GLUT event-processing loop */
    return 0;
}

. , renderBuffer , .

void displayCB()
{
glBindFramebuffer(GL_FRAMEBUFFER, fboId);

//read this FBO attached RBO, save its content to fboContent
//"count" is a global variable, and is incremented by 1 (mod )every time pressing the space key of the keyboard.
glReadBuffer(colorAttach[count]); 
glReadPixels(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, PIXEL_FORMAT, GL_UNSIGNED_BYTE, fboContent);

// back to normal window-system-provided framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, 0); // unbind

// render to the default framebuffer //////////////////////////
glClear(GL_COLOR_BUFFER_BIT); // clear buffer
glClearColor(1, 0, 0, 1);
glDrawBuffer(GL_BACK);
glRasterPos2i(-1, -1);  
glDrawPixels(SCREEN_WIDTH, SCREEN_HEIGHT, PIXEL_FORMAT, GL_UNSIGNED_BYTE, fboContent);
glutSwapBuffers();
}

. renderBuffer . , , .

+5
3

OpenGL, , ?

. OpenGL DirectX. OpenGL "". , - , Windows. , - , , . , .

OLD- - EGA/CGA/VGA, , VESA, , - MS -DOS /. , Linux, , .

.

, OpenGL ​​? , .

- , , . . , , , - , .

, , .

, , , OpenGL api, - DLL, dll-injection .

+6

OpenGL, , ?

, OpenGL.

+1

, , , , , .

, FRAPS, , , , ( ): , OpenGL DirectX.

-1

All Articles