Hi
I want to create a dynamical moving list like in an aircraft for failures. So anything critical in red should go on top, other moving down one. Non critical, yellow go in the middle and warnings in white below. I want to create a texture for each failure and set it active or not. When active inserting depending the color.
First thoughts are alike:
typedef struct {
int active;
int type; // 1=integer 2=float 3=int array 4=float array 5=two ints 6=two floats
// 7=two array ints 8=two array floats
int index; // index into array
char label[100]; //dataref
int color; // 1=white 2=green 3=yellow 4=blue 5=red 6=cyan
char text[100]; //texturefilename
} FAILURES;
int mListe ()
{
std::list<int> mylist (2,100); // two ints with a value of 100
mylist.push_front (200);
mylist.push_front (300);
std::cout << "mylist contains:";
for (std::list<int>::iterator it=mylist.begin(); it!=mylist.end(); ++it)
//need to display textures here
std::cout << ' ' << *it;
std::cout << '\n';
return 0;
}
So basically how to write the mListe function.
- push/pop textures from Failures
- display, move up/down
Image display is something alike:
glPushMatrix();
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_TEXTURE_2D);
XPLMBindTexture2d(textures[MAUS2_TEXTURE].texIMGID, 0);
glColor3f(1, 1, 1);
glTexEnvf(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
glBegin(GL_QUADS);
glTexCoord2i(0, 0);
glVertex2f(x-25, y+25); //top left corner
glTexCoord2i(0, 1);
glVertex2i(x+25, y+25); //top right corner
glTexCoord2i(1, 1);
glVertex2i(x+25, y-25); //bottom right corner
glTexCoord2i(1, 0);
glVertex2i(x-25, y-25); //bottom left corner
glEnd();
glPopMatrix();
so y height should change dynamically.
Many thanks for any feedback.