I have been learning C++ for long time (but only learning game development for eight days) and I have made a simple game using 2D textures.
I was thinking of starting on 3D game development. I wanted to begin by loading and rendering a 3D model on the program, but I dont know how.
Can anybody tell me if this function could be changed to output 3D model:
GLuint loadTexture( const string &fileName )
{
SDL_Surface *image = IMG_Load( fileName.c_str() );
SDL_DisplayFormatAlpha(image);
unsigned object(0);
glGenTextures(1, &object);
glBindTexture(GL_TEXTURE_2D, object);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image -> w, image -> h, 0, GL_RGBA,
GL_UNSIGNED_BYTE, image -> pixels);
//Free surface
SDL_FreeSurface(image);
Also what format should I use for this? I am using Blender, and I have seen it can export to a variety of formats. I don't know which would be the best for this kind of stuff and for serious game development.