   help?
  hello.. i am newbie in opengl and i have a few questions..i have written the following code..#include <stdlib.h>#include <glut.h>#include <math.h>#include <stdio.h>GLsizei width=640;GLsizei height=480;#define AR_GRAM 6#define AR_STIL 14GLsizei xwmin=-50;GLsizei xwmax=50;GLsizei ywmin=-50;GLsizei ywmax=50;void display(){char x[6][14]={ {'*','1','3','4','-','1','3','1','1','1','1','1','1','1'},{'1','1','1','4','-','1','3','1','1','1','1','1','1','1'},{'1','1','3','4','-','1','3','1','1','1','1','1','1','1'},{'1','1','3','1','-','4','3','1','2','1','1','1','1','1'},{'1','1','3','3','-','4','3','1','1','1','1','1','1','1'},{'1','1','3','1','-','1','3','1','2','1','1','1','1','1'}};int i,j;GLsizei temp1=0,temp2=0,cnt1,cnt2;glClearColor(1,1,1,0);glClear(GL_COLOR_BUFFER_BIT);cnt1=(2*xwmax/AR_GRAM);cnt2=(2*ywmax/AR_STIL);//προσπελαση του πινακαfor (i=0;i<AR_GRAM;i++) {for (j=0;j<AR_STIL;j++) {if (x[j]=='*') {glColor3f(1,0,0);glBegin(GL_POLYGON);glVertex2i(temp1,temp2+cnt2);glVertex2i(temp1,temp2);glVertex2i(temp1,temp1+cnt1);glVertex2i(temp1+cnt1,temp2+cnt2);glEnd();}else if (x[j]=='2'){glColor3f(0,1,0);glBegin(GL_POLYGON);glVertex2i(temp1,temp2+cnt2);glVertex2i(temp1,temp2);glVertex2i(temp1,temp1+cnt1);glVertex2i(temp1+cnt1,temp2+cnt2);glEnd();}temp1=temp1+cnt1;temp2=temp2+cnt2;}}}int main (int argc, char** argv){glutInit(&argc,argv);glutInitWindowPosition(50,50);glutInitWindowSize(width,height);glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);glutCreateWindow("attempt1");glMatrixMode(GL_PROJECTION);gluOrtho2D(xwmin,xwmax,ywmin,ywmax);glutDisplayFunc(display);glutMainLoop();return 0;}the problem is that it not working properly.. it's not working at all.. i only see the frame of the window and nothing in it..what i want to do is:read from an array each character and then, draw a rectangle depending on the character i've read.. if its an 'a' for example draw a red one, read then the next character, draw next to the previous one another rectangle and so on..any corrections to the code above.. any other suggestions/code..??thanks anyway..
  woah, that's ranking pretty high in my top ten of odd ways to do odd things.lemme try to understand anyway...you have temp1 and temp2 which somewhat represent x and y, except not all the time.both initialized to 0.then you have cnt1 which initializes to 100/6 and cnt2 which initializes to 100/14you are then drawing the first polygon at {(0,100/14),(0,0),(0,100/6),(100/6,100/14)}. you then keep moving further up right. given the inconsistency of temp1 and temp2 that's likely to cause some distortion.then you have this array of characters which specifies the color. right now you're ignoring everything except '*' which would be a red quad-thingie and '2' which would be a green quad-thingie.for all i can tell it would still render some of these quads. at least the upper right corner of each. perhaps check if GL_CULL_FACE and GL_DEPTH_TEST are disabled since you don't clear depth buffer   