4 ms·
I did the math for you and it comes down to about 8.6MiB on my Linux system. An OpenGL application that displays a triangle links to these libs: libc.so.6 lib
by Svenstaro 12y ago
I did the math for you and it comes down to about 8.6MiB on my Linux system.
An OpenGL application that displays a triangle links to these libs:
libc.so.6 libdl.so.2 libdrm.so.2 libgcc_s.so.1 libglapi.so.0 libGL.so.1 libm.so.6 libpthread.so.0 librt.so.1 libSDL2-2.0.so.0 libstdc++.so.6 libX11.so.6 libX11-xcb.so.1 libXau.so.6 libxcb-dri2.so.0 libxcb-dri3.so.0 libxcb-glx.so.0 libxcb-present.so.0 libxcb.so.1 libxcb-sync.so.1 libXdamage.so.1 libXdmcp.so.6 libXext.so.6 libXfixes.so.3 libxshmfence.so.1 libXxf86vm.so.1
Now to be fair, we'll only count those we directly link against:
ibSDL2-2.0.so.0 libstdc++.so.6 libGL.so.1 libdl.so.2 libc.so.6 libgcc_c.so.1 libm.so.6
These few turn out to be the biggest in our bunch, totalling to 5.5MiB.
So there you have it, by linking a minimal graphics demo on Linux, you are implicitly linking to about 5.5MiB of direct system libs and 8.6MiB of indirect system libs. These numbers will vary wildly for other OS, but I guess the DirectX stuff would be larger.
- MichaelGG 12y agoNeat! Although if you were just writing to a framebuffer you would probably use much less code. OTOH, the graphics drivers are doing the rasterizing right?
- Narishma 12y agoNo, the GPU is doing the rasterizing.
- pjc50 12y agoThe vast majority of that will be libstdc++ and libc, of which the app will be using a tiny corner. You could probably reduce that by half by sticking to C and then using a minimal libc.