Archive for January, 2008

OpenGL Super Bible! Page 461 pfd.cColorBits = 0;

Thursday, January 3rd, 2008

OpenGL Super Bible! Page 461 pfd.cColorBits = 0; /* Best color buffer please */ pfd.cDepthBits = 32; /* Need a depth buffer */ pfd.cStencilBits = 0; /* No stencil buffer */ pfd.cAccumBits = 0; /* No accumulation buffer */ pf = ChoosePixelFormat(SceneDC, &pfd); if (pf == 0) DisplayErrorMessage(’texscene was unable to choose a suitable pixel format! ); else if (!SetPixelFormat(SceneDC, pf, &pfd)) DisplayErrorMessage(’texscene was unable to set the pixel format! ); MakePalette(pf); SceneRC = wglCreateContext(SceneDC); wglMakeCurrent(SceneDC, SceneRC); /* * Load all the texture images into display lists */ LoadAllTextures(); break; case WM_SIZE : case WM_PAINT : /* * Repaint the client area with our bitmap */ BeginPaint(hWnd, &ps); GetClientRect(hWnd, &rect); RepaintWindow(&rect); EndPaint(hWnd, &ps); break; case WM_COMMAND : /* * Handle menu selections */ switch (LOWORD(wParam)) { case IDM_FILE_SAVEAS : SaveBitmapFile(); break; case IDM_FILE_PRINT : PrintBitmap(); break; case IDM_FILE_EXIT :
You want to have a cheap webhost for your apache application, then check apache web hosting services.

Page 460 OpenGL Super Bible! for (i = (Web hosting bandwidth)

Wednesday, January 2nd, 2008

Page 460 OpenGL Super Bible! for (i = 0; i < nColors; i ++) { pPal->palPalEntry[i].peRed = 255 * ((i >> pfd.cRedShift) & rmax) / rmax; pPal->palPalEntry[i].peGreen = 255 * ((i >> pfd.cGreenShift) & gmax) / gmax; pPal->palPalEntry[i].peBlue = 255 * ((i >> pfd.cBlueShift) & bmax) / bmax; pPal->palPalEntry[i].peFlags = 0; }; /* * Create, select, and realize the palette */ ScenePalette = CreatePalette(pPal); SelectPalette(SceneDC, ScenePalette, FALSE); RealizePalette(SceneDC); free(pPal); } /* * ‘SceneProc() - Handle window events in the viewing window. */ LRESULT CALLBACK SceneProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { int PIXELFORMATDESCRIPTOR PAINTSTRUCT RECT pf; pfd; ps; rect; /* I - Window triggering this event */ /* I - Message type */ /* I - ‘word parameter value */ /* I - ‘long parameter value */ /* Pixel format ID */ /* Pixel format information */ /* WM_PAINT message info */ /* Current client area rectangle */ switch (uMsg) { case WM_CREATE : /* * ‘Create’ message. Get device and rendering contexts, and * setup the client area for OpenGL drawing */ SceneDC = GetDC(hWnd); pfd.nSize = sizeof(pfd); pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; /* Do OpenGL drawing */ pfd.dwLayerMask = PFD_MAIN_PLANE; /* Main drawing plane */ pfd.iPixelType = PFD_TYPE_RGBA; /* RGB color buffer */
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

Vps web hosting - OpenGL Super Bible! Page 459 MessageBeep(MB_ICONEXCLAMATION); MessageBox(NULL, s,

Tuesday, January 1st, 2008

OpenGL Super Bible! Page 459 MessageBeep(MB_ICONEXCLAMATION); MessageBox(NULL, s, ‘Error , MB_OK | MB_ICONEXCLAMATION); } /* * ‘MakePalette() - Make a color palette for RGB colors if necessary. */ void MakePalette(int pf) /* I - Pixel format ID */ { PIXELFORMATDESCRIPTOR pfd; /* Pixel format information */ LOGPALETTE *pPal; /* Pointer to logical palette */ int nColors; /* Number of entries in palette */ int i, /* Color index */ rmax, /* Maximum red value */ gmax, /* Maximum green va6lue */ bmax; /* Maximum blue value */ /* * Find out if we need to define a color palette */ DescribePixelFormat(SceneDC, pf, sizeof(PIXELFORMATDESCRIPTOR), &pfd); if (!(pfd.dwFlags & PFD_NEED_PALETTE)) { ScenePalette = NULL; return; }; /* * Allocate memory for a color palette */ nColors = 1 << pfd.cColorBits; pPal = (LOGPALETTE *)malloc(sizeof(LOGPALETTE) + nColors * sizeof(PALETTEENTRY)); pPal->palVersion = 0×300; pPal->palNumEntries = nColors; /* * Get the maximum values for red, green, and blue. Then build ‘nColors * colors */ rmax = (1 << pfd.cRedBits) - 1; gmax = (1 << pfd.cGreenBits) - 1; bmax = (1 << pfd.cBlueBits) - 1;
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.