Hi
Yes I should have shown the init as there's exectly where I get the
errors. So texLogo = loadTexture("Images/carmine_64x16.png",1,0);
and ftglCreatePixmapFont("Fonts/MgOpenModataOblique.ttf");
don't load or create. Why? That's exactly my problem here.
This shared lib gets loaded from X-Plane as a plugin. Now this was
a openGL standalone app and works if I simply put the previous class
into main. Now I want to call it from within a plugin function and get
rid of window creation and related functions. But first simply get
loadTexture and ftglCreatePixmapFont working. I've included the headers
and it compiles.
As I've only done some VB.NET so far I guess I've the declarations of
loadTexture and ftglCreatePixmapFont at some wrong location? Those
declarations are in another file...can I leave it that way?
Yes this C++ linking is still weird to me...
Many thanks
Michael
* \brief Constructor.
*/
Demo:
emo()
{
m_pCurrCamera = NULL;
m_nCameraIndex = -1;
m_bLighting = FALSE;
m_pfontBig = NULL;
m_pfontMedium = NULL;
texLogo = 0;
}
* \brief Initialises the demonstration.
* \return true, if initialization succeeds.
* false, otherwise.
*/
bool Demo::init()
{
if (!App::init(WIDTH, HEIGHT, BITDEPTH, false, "What is a demo for ?
Showing Off !"))
{
return false;
}
//glDisable(GL_MULTISAMPLE_ARB);
glShadeModel(GL_SMOOTH); // Enable Smooth Shading
//glClearColor(0.827f,0.827f, 0.827f, 0.0f);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
texLogo = loadTexture("Images/carmine_64x16.png",1,0);
m_pfontBig = ftglCreatePixmapFont("Fonts/MgOpenModataOblique.ttf");
if(!m_pfontBig)
{
cout << "Could not load big font"<< endl;
return false;
}
ftglSetFontFaceSize(m_pfontBig, 25, 25);
m_pfontMedium = ftglCreateTextureFont("Fonts/AndikaDesRevG.ttf");
if(!m_pfontMedium)
{
cout << "Could not load medium font"<< endl;
return false;
}
ftglSetFontFaceSize(m_pfontMedium, 14, 14);
m_oDefaultCamera.m_pName = "Default";
m_oDefaultCamera.fLocX = 0;
m_oDefaultCamera.fLocY = -16.0;
m_oDefaultCamera.fLocZ = 16.0;
m_oDefaultCamera.fRotX = 45.0;//90.0;
m_oDefaultCamera.fRotY = 0.0;//180.0;
m_oDefaultCamera.fRotZ = 0.0;
m_oDefaultCamera.fScaleX = 1.0;
m_oDefaultCamera.fScaleY = 1.0;
m_oDefaultCamera.fScaleZ = 1.0;
m_oDefaultCamera.fClipStart = 0.1;
m_oDefaultCamera.fClipEnd = 100.0;
m_oDefaultCamera.fLens = 34.0;
m_oDefaultCamera.m_parrParentIndices = NULL;
resetCameraToDefault();
create3DScene();
m_RotationAngle = 0.0;
return true;
}