I am still attempting to port one of my visualization applications that implements Irrlicht to my Mac. However, my glut primitives will not work the same for me on the mac as they did under linux. This code worked fine under linux. I get nothing plotted on screen though. Essentially what is supposed to happen is some glut cubes of required transparency and color are to be plotted on the screen. It seems like I am just not getting anything drawn to smgr and I cannot figure out why.
Code: Select all
int main()
{
device->setEventReceiver(&reciever);
device->getCursorControl()->setVisible(true);
createGUI();
while(device->run() && driver)
{
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(0,200,200,200));
if(flag3)
{
sprintf(TEMP,"%s.%06i",name.c_str(),i); // Takes the run name and alters it to the correct file name
//printf("\n\nTEMP= %s",TEMP); // within the specified range, these were output by LJ.f
int tmp=999;
tmp = ReadData(TEMP);
}
if(flag2){
for (int w=0;w<NUM_PARTICLES;w++)
{ // loop over all the x,y,z points and plot them
glColor4f(XYZ[w].f7,(1-XYZ[w].f7),0.0,0.2);
glPushMatrix();
glutSolidCube(5);
glPopMatrix();
}
smgr->drawAll();
}
env -> drawAll();
driver->endScene();
}
}
device->drop();
return 0;
}
Code: Select all
void initOpenGL(void){
// Material and lighting data to make things look pretty
vector3df cam_pos = camera->getAbsolutePosition();
float mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
float mat_shininess[] = { 20.0 };
float lightPosition[4];
cam_pos.getAs4Values(lightPosition);
lightPosition[4] = 20000.0;
// GL initialization stuff
glShadeModel (GL_SMOOTH);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
glLightfv(GL_LIGHT0, GL_POSITION, lightPosition);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_LIGHTING);
glEnable(GL_BLEND);
glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST);
glEnable(GL_ALPHA_TEST);
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_CULL_FACE);
}
Code: Select all
int main()
{
device->setEventReceiver(&reciever);
device->getCursorControl()->setVisible(true);
createGUI();
while(device->run() && driver)
{
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(0,200,200,200));
glutSolidCube(5);
env -> drawAll();
smgr->drawAll();
driver->endScene();
}
}
device->drop();
return 0;
}