Why don't you want to use the OpenGL api directly? There are tons of tutorials/examples for that, as it doesn't really matter which language you are using.
Also you your above code seems to use intermediate mode, which is something you want to avoid for the core part mesh data.
Also you your above code seems to use intermediate mode, which is something you want to avoid for the core part mesh data.