   The font doesn't draw
  Hi fellowsI'm trying to draw a font in OpenGL but I'm failing in this. I think that my code is perfect but it isn't. Fellows for the love of god, what I've forgot to put?The source is this:   //...code that creates the window   EnableOpenGL(hwnd, &hdc, &glrc);   while(msg.message != WM_QUIT)   { if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {    TranslateMessage(&msg);    DispatchMessage(&msg); } else {    glMatrixMode(GL_PROJECTION);    glLoadIdentity();    gluOrtho2D(0, 800, 600, 0);    //glClearColor(0.0f, 0.0f, 0.6f, 0.0f);    glClear(GL_COLOR_BUFFER_BIT);    glPushMatrix();   glColor3f(1.0f, 1.0f, 1.0f);    glRasterPos2i(300, 400);    PrintText(arialFont, "4");    //myButton.Draw(); } SwapBuffers(hdc);   }   DisableOpenGL(hwnd, hdc, glrc);   return msg.wParam;}And this is my function that I create and draw the fontunsigned int CreateFont(HDC* hdc, char *fontName, int Size){   HFONT hFont;   unsigned int base = glGenLists(223);   if(stricmp(fontName, "Arial")==0) hFont = CreateFont(Size, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE,SYMBOL_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_DONTCARE | DEFAULT_PITCH, fontName);   else  hFont = CreateFont(Size, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE,ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY, FF_DONTCARE | DEFAULT_PITCH, fontName);   if(!hFont)return 0;   SelectObject(*hdc, hFont);   wglUseFontBitmaps(*hdc, 32, 223, base);   return base;}void PrintText(unsigned int base, char* string){   if((base == 0 || string == NULL)) return;   glPushAttrib(GL_LIST_BIT);   glListBase(base - 32); glCallLists(strlen(string), GL_UNSIGNED_BYTE, string);   glPopAttrib(); }
  And what *does* it do?   ;  I want to draw the font. Now I discovered the error.I'm calling the function that creates the font before the function that Enables OpenGL.Thanx for the support   ;  There are two (possible) problems I noticed from the code you posted.1) Are you calling your CreateFont function before or after you create the OpenGL context?  All OpenGL calls are ignored if there isn't a current context.2) You are pushing the projection matrix without later popping it.  It doesn't seem like you are checking for OpenGL errors (you should be) because this would create one.And as Ezbez succinctly put, the more information you give us the easier it will be to help you.EDIT: Nevermind, I'm too slow.   