Relatively simple Win32 OpenGL program

Source: Internet
Author: User
Tags win32
[CPP]   View plain  copy  print?   Reproduced from: http://blog.csdn.net/zhuyingqingfen/article/details/22506111// glsample. cpp  //  by blaine hodge  //     // Includes       #include  <windows.h>   #include  <gl/gl.h>     // function declarations      Lresult callback wndproc (HWND  hwnd, uint message, wparam wparam, lparam lparam);   void  Enableopengl (HWND&NBSP;HWND,&NBSP;HDC&NBSP;*&NBSP;HDC,&NBSP;HGLRC&NBSP;*&NBSP;HRC);   void  Disableopengl (HWND&NBSP;HWND,&NBSP;HDC&NBSP;HDC,&NBSP;HGLRC&NBSP;HRC);     // WinMain       Int winapi winmain (hinstance hinstance, hinstance  hprevinstance,               &nbsP;       lpstr lpcmdline, int icmdshow)    {        WNDCLASS wc;       HWND hWnd;       HDC hDC;       HGLRC hRC;        MSG msg;       BOOL quit = FALSE;        float theta = 0.0f;               // register window class        wc.style = cs_owndc;       wc.lpfnWndProc = WndProc;        wc.cbClsExtra = 0;       wc.cbwndextra  = 0;       wc.hInstance = hInstance;        wc.hicoN = loadicon ( NULL, IDI_APPLICATION );       wc.hcursor  = loadcursor ( NULL, IDC_ARROW );       wc.hbrbackground  =  (Hbrush) getstockobject ( BLACK_BRUSH );        wc.lpszmenuname = null;       wc.lpszClassName =  "Glsample";        registerclass ( &wc );               // create main window        Hwnd = createwindow (             "Glsample",   "Opengl sample",            ws_caption |  WS_POPUPWINDOW | WS_VISIBLE,           0,  0, 256, 256,           NULL, NULL, hInstance, NULL  );              // enable opengl for  the window       enableopengl (&NBSP;HWND,&NBSP;&AMP;HDC,&NBSP;&AMP;HRC  );              // program main  loop       while  ( !quit )         {             

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.