CS-FreeStyle / 10000-How-To-Do-in-CS

1 stars 0 forks source link

deeper understanding of libs #87

Open liuty10 opened 4 years ago

liuty10 commented 4 years ago

https://www.bogotobogo.com/cplusplus/libraries.php

liuty10 commented 4 years ago

https://stackoverflow.com/questions/7221600/capturing-display-monitor-images-sending-keyboard-input-on-linux

liuty10 commented 4 years ago

https://git.itch.ovh/itchio/capsule/blob/e58794d05663723a91c0c617601d1b72f2fee5cf/libcapsule/src/shared/gl-capture.cpp https://github.com/nouspiro/kiroku/blob/master/lib/intercept.cpp https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=12&cad=rja&uact=8&ved=2ahUKEwi_jvuh6ovoAhVFLKwKHbKlBuU4ChAWMAF6BAgDEAE&url=http%3A%2F%2Fjsilva.komodoopenlab.com%2Fbzr%2Fframedump%2Fglxdump.c&usg=AOvVaw1_rxOK9esJcWtfIStkNJXu

liuty10 commented 4 years ago

https://codingfox.com/12-20-preprocessor-operators-and-misc-directives-in-c/

liuty10 commented 4 years ago

Yes, VirtualGL does intercept glXSwapBuffers(), and you could easily accomplish what you want by simply adding that new timing code to VirtualGL's existing glXSwapBuffers() implementation (refer to server/faker-glx.cpp.) If you want to use your own interposer rather than modifying VirtualGL, then here is the basic strategy:

  1. Develop your interposer as as standalone interposer library. You can borrow some of the VirtualGL symbol loader code to achieve this, if you want (just bear in mind that VirtualGL is LGPL-licensed.)

  2. Verify that your new interposer works properly without VirtualGL, by using LD_PRELOAD to load the interposer into various OpenGL applications.

  3. Use the VGL_GLLIB environment variable to instruct VirtualGL to load GLX symbols from your interposer. That means that VGL will pick up your version of glXSwapBuffers() ahead of the glXSwapBuffers() symbol in libGL.