   Can't draw QUAD (or anything)
  openGL, win32. Big black window instead of black window with white something. Code is a mess, I don't care, I wanted to try some algorithm. Instead of that, I'm fucking with this for an hour now.#include <windows.h>#include <stdio.h>#include <gl\gl.h>typedef struct{HGLRC hRC;HDC   hDC;HWND  hWnd;HINSTANCE  hInstance;}win_state_type;win_state_type win_state; RECT WindowRect;int SCRN_WDTH = 600;int SCRN_HGHT = 400;bool Lft_Btn = false;bool Mdl_Btn = false;bool Rgt_Btn = false;bool Lft_Rgt_Dwn = false;int MousePrevX = 0;int MousePrevY = 0;int MouseX = 0;int MouseY = 0;/*****************/#define MAX_POINTS10float ControlPoints[MAX_POINTS][2] = {1,59,56,268,484,24,867,758,512,425,785,325,487,12,412,36,47,678,98,654 };#define WIND_CLASS_NAME"Outline 1.0" LRESULT CALLBACK WndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam);/***************************/void Resize(){/*glViewport(0,0,SCRN_WDTH,SCRN_HGHT);glMatrixMode(GL_PROJECTION_MATRIX);glLoadIdentity();glOrtho(0,SCRN_WDTH,0,SCRN_HGHT,-100,100);glMatrixMode(GL_MODELVIEW_MATRIX);glLoadIdentity();*/glViewport(0,0,500,500);glMatrixMode(GL_PROJECTION_MATRIX);glLoadIdentity();glOrtho(0,500,0,500,-100,100);glMatrixMode(GL_MODELVIEW_MATRIX);glLoadIdentity();}void Init(){glShadeModel(GL_SMOOTH);glDisable(GL_TEXTURE_2D);glDisable(GL_LIGHTING);glClearColor(0.0f, 0.0f, 0.0f, 1.0f);}void Display(){glClear(GL_COLOR_BUFFER_BIT);glColor4f(1,1,1,1);glBegin(GL_LINES);for( int i = 0; i < MAX_POINTS-1; i++ ){glVertex2fv(ControlPoints);glVertex2fv(ControlPoints[i+1]);}glEnd();glBegin(GL_QUADS);glVertex2f(10,10);glVertex2f(10,600);glVertex2f(600,600);glVertex2f(10,600);glEnd();SwapBuffers(win_state.hDC);}void CreateGlWindow(){GLuintPixelFormat;WNDCLASSwc;WindowRect.left = (long)50;WindowRect.right = 50+(long)SCRN_WDTH;WindowRect.top = (long)50;WindowRect.bottom = 50+(long)SCRN_HGHT;win_state.hInstance= GetModuleHandle(NULL);wc.style= CS_HREDRAW | CS_VREDRAW | CS_OWNDC;wc.lpfnWndProc= (WNDPROC) WndProc;wc.cbClsExtra= 0;wc.cbWndExtra= 0;wc.hInstance= win_state.hInstance;wc.hIcon= LoadIcon(NULL, IDI_WINLOGO);wc.hCursor= LoadCursor(NULL, IDC_ARROW);wc.hbrBackground= NULL;wc.lpszMenuName= NULL;wc.lpszClassName= WIND_CLASS_NAME;RegisterClass(&wc);AdjustWindowRectEx(&WindowRect,WS_OVERLAPPEDWINDOW,FALSE,WS_EX_APPWINDOW|WS_EX_WINDOWEDGE);win_state.hWnd=CreateWindowEx(WS_EX_APPWINDOW|WS_EX_WINDOWEDGE,WIND_CLASS_NAME,WIND_CLASS_NAME,WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_POPUP,//WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,WindowRect.left, WindowRect.top,WindowRect.right-WindowRect.left,WindowRect.bottom-WindowRect.top,NULL,NULL,win_state.hInstance,NULL);staticPIXELFORMATDESCRIPTOR pfd ={sizeof(PIXELFORMATDESCRIPTOR),1,PFD_DRAW_TO_WINDOW |PFD_SUPPORT_OPENGL |PFD_DOUBLEBUFFER,PFD_TYPE_RGBA,32,//32,0, 0, 0, 0, 0, 0,0,0,0,0, 0, 0, 0,16,0,0,PFD_MAIN_PLANE,0,0, 0, 0};win_state.hDC = GetDC(win_state.hWnd);PixelFormat = ChoosePixelFormat(win_state.hDC,&pfd);SetPixelFormat(win_state.hDC,PixelFormat,&pfd);win_state.hRC = wglCreateContext(win_state.hDC);wglMakeCurrent(win_state.hDC,win_state.hRC);ShowWindow(win_state.hWnd,SW_SHOW);SetForegroundWindow(win_state.hWnd);SetFocus(win_state.hWnd);}void KillGlWindow(){wglMakeCurrent(NULL,NULL);wglDeleteContext(win_state.hRC);ReleaseDC(win_state.hWnd,win_state.hDC);DestroyWindow(win_state.hWnd);UnregisterClass(WIND_CLASS_NAME,win_state.hInstance);}LRESULT CALLBACK WndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam){switch(uMsg){case WM_CLOSE:PostQuitMessage(0);return 0;case WM_SIZE:SCRN_WDTH = LOWORD(lParam);SCRN_HGHT = HIWORD(lParam);Resize();InvalidateRect(win_state.hWnd, NULL, FALSE);return 0;case WM_LBUTTONDOWN:Lft_Btn = true;InvalidateRect(win_state.hWnd, NULL, FALSE);return 0;case WM_RBUTTONDOWN:Rgt_Btn = true;InvalidateRect(win_state.hWnd, NULL, FALSE);return 0;case WM_PAINT:Display();ValidateRect(win_state.hWnd, NULL);return 0;default:return DefWindowProc(hWnd,uMsg,wParam,lParam);}return DefWindowProc(hWnd,uMsg,wParam,lParam);}/**************************/int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow){MSGmsg;CreateGlWindow();Init();Resize();Display();while( GetMessage( &msg, NULL, 0, 0 ) )    {    if (msg.message==WM_QUIT)   {  break;   }   else   {  TranslateMessage(&msg);   DispatchMessage(&msg);    }    }KillGlWindow();return (msg.wParam);}The code is copied from another project. Message loop is okay and WM_PAINT stuff is okay in that project.Thanks in advance.   
  It's GL_MODELVIEW and GL_PROJECTION, not GL_MODELVIEW_MATRIX and GL_PROJECTION_MATRIX, you pass to glMatrixMode.   ;  *facepalm*I coded that part from memory.Thanks!   