Hi
Have been using OpenGL with Borland C++ Builder 4 for about 10 years but need to port across to Embarcadero C++ Builder 2010 and am developing on generous W7x64 platform.
I cant remember where I downloaded the original package from but I need a new package containing the right components for W7.
Here is a sample of the code I am using. Pions->points to lower level plot routines
Thanks
Deep Thought
void __fastcall TForm1::OpenGLPanel1Init(TObject *Sender)
{
glViewport(0,0,(GLsizei)OpenGLPanel1->Width,(GLsizei)OpenGLPanel1->Height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if ( OpenGLPanel1->Height==0)
gluPerspective(45, (GLdouble)OpenGLPanel1->Width, 1.0, 2000.0);
else
gluPerspective(45, (GLdouble)OpenGLPanel1->Width/
(GLdouble)OpenGLPanel1->Height,1.0, 2000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glEnable(GL_DEPTH_TEST);
//glClearColor(1.0,1.0,1.0,1.0);
glClearColor(0.8,0.8,0.8,1.0);
}
void __fastcall TForm1::OpenGLPanel1Resize(TObject *Sender)
{
glViewport(0,0,(GLsizei)OpenGLPanel1->Width,(GLsizei)OpenGLPanel1->Height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if ( OpenGLPanel1->Height==0)
gluPerspective(5, (GLdouble)OpenGLPanel1->Width, 1.0, 2000.0);
else
gluPerspective(5, (GLdouble)OpenGLPanel1->Width/
(GLdouble)OpenGLPanel1->Height,1.0, 2000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void __fastcall TForm1::OpenGLPanel1Paint(TObject *Sender)
{
double zoom=1., shift=0.;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslated(OffX1, OffY1, -5.0);//0.0); // order ? duplicate with offx, offy, offz
glRotatef(RotX, 1.0, 0.0, 0.0);
glRotatef(RotY, 0.0, 1.0, 0.0);
glRotatef(RotZ, 0.0, 0.0, 1.0);
glScalef(Scale1x,Scale1y,1.);
if (Pions->DataToPlot)
{
Pions->SetLims(SelPath->ItemIndex, Ysel->ItemIndex); // iq
Pions->DrawGraphPaper(zoom, shift);
//Pions->SetBoxesByOffer(SelPath->ItemIndex, Ysel->ItemIndex, RequiredReliability); // im, iq
Pions->SetBoxesByMB(SelPath->ItemIndex, Ysel->ItemIndex, RequiredReliability, UseMonth);
Pions->DrawBlox();
PrintLabs();
}
glPopMatrix();
}