Firstly, Thank you soo much community for helping me with my last dilemma.
all bugs from that are fixed now, the only problem is when i call the model to be rendered it doesn't show in the viewport.
can anyone shed any light on this?
heres the main.cpp
#include "main.h"
#include "3dsloader.h"
void lighting();
void initRendering();
void drawScene();
void mainLoop();
Object* testcube;
int main(int argc, char **argv)
{
bool running = true;
InitializeWindow();
testcube = new Object("apex.3ds");
initRendering();
testcube->CreateVBO();
mainLoop();
return 0;
}
void initRendering()
{
glClearColor(0.0, 0.0, 0.0, 0.0);
glShadeModel(GL_SMOOTH);
// Enable lighting and set the position of the light
glEnable(GL_LIGHT0);
glEnable(GL_LIGHTING);
GLfloat pos[] = { 0.0, 4.0, 4.0 };
glLightfv(GL_LIGHT0, GL_POSITION, pos);
}
void mainLoop(void)
{
// the time of the previous frame
double old_time = glfwGetTime();
// this just loops as long as the program runs
while(1)
{
// escape to quit, arrow keys to rotate view
if (glfwGetKey(GLFW_KEY_ESC) == GLFW_PRESS)
break;
// draw the figure
drawScene();
// swap back and front buffers
glfwSwapBuffers();
}
}
void drawScene()
{
//clear info from last draw
glClear(GL_COLOR_BUFFER_BIT);
glTranslatef(0.0f, 0.0f, -5.0f); // translate camera
// ADD SCENE OBJECTS TO RENDER HERE
testcube->Draw();
glfwSwapBuffers();
};
void shutdown()
{
glfwTerminate();
delete testcube;
exit(1);
}
all the other headers arent necessary but if you think they are, they can be found here->
http://www.gamedev.net/topic/621666-debug-assertion-failed-on-game-project/
Thankyou