Anti-Aliasing in GPU shader Module(OpenGL)
You don't actually need any code to make the edges curved or smooth. Go to edit mode and select all the edges of the cube. Then select bevel, which is this option

And then you will see a yellow line with a circle on top of it. Pull it to the extent you want. You may see it becoming flat. But there's an easy solution. At the bottom left, there would be a bevel option with a dropbox. Click on the triangle near it and select segments and set it to ten. Below's the image of how the bevel segment looks like. Make sure to be in edges and not vertices.