Geting MAX TEXTURE SIZE 1024 for a perticular pixel format?
-
Different max texture size for PFD_DRAW_TO_BITMAP & PFD_DRAW_TO_WINDOW. Is there is any solution to get same max texture size? 1. I am using CreateDIBSection() for off screen rendering. 2. Which is working fine in my code as listed below. 3. But i am getting problem with textures as i am getting max texture size is 1024 4. I am getting desired 4096 texture size when i render to application window. 5. Pixel format of main application window and offscreen window is different. 6. The difference of pixel format and returned max texture size is mentioned below. How can i get 4096 max texture size for off screen window also? Getting 1024 max texture size PFD_DRAW_TO_BITMAP | PFD_SUPPORT_OPENGL | PFD_STEREO_DONTCARE, PFD_TYPE_RGBA, Getting 4096 max texture size PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER, PFD_TYPE_RGBA, What pixel format should i use to get 4096 max texture size.
bool Create(unsigned int width, unsigned int height)
{// Create a p-buffer for off-screen rendering m\_uiWidth = width; m\_uiHeight = height; m\_hWnd = g\_pMainApplicationWindow->GetHWND(); m\_hMainApplicationWindowDC = g\_pMainApplicationWindow->GetHDC(); m\_hMainApplicationWindowRC = g\_pMainApplicationWindow->GetHGLRC(); memset(&m\_bmi, 0, sizeof(BITMAPINFO)); m\_bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); m\_bmi.bmiHeader.biWidth = m\_uiWidth; m\_bmi.bmiHeader.biHeight = m\_uiHeight; m\_bmi.bmiHeader.biPlanes = 1; m\_bmi.bmiHeader.biBitCount = 32; m\_bmi.bmiHeader.biCompression = BI\_RGB; m\_bmi.bmiHeader.biSizeImage = m\_uiWidth \* m\_uiHeight \* 4; // Create DIB HDC hDC = ::GetDC(m\_hWnd); m\_hDib = ::CreateDIBSection(hDC, &m\_bmi, DIB\_RGB\_COLORS, (void\*\*)&m\_pTextureData, NULL, (DWORD)0); ReleaseDC(m\_hWnd, hDC); m\_hMemDC = ::CreateCompatibleDC(NULL); if(!m\_hMemDC) { DeleteObject(m\_hDib); m\_hDib = NULL; return (false); } m\_hOldDib = SelectObject(m\_hMemDC, m\_hDib); // Setup memory DC's pixel format. if (!SetDCPixelFormat(m\_hMemDC, PFD\_DRAW\_TO\_BITMAP | PFD\_SUPPORT\_OPENGL | PFD\_STEREO\_DONTCARE)) { SelectObject(m\_hMemDC, m\_hOldDib); DeleteObject(m\_hDib); m\_hDib = NULL; DeleteDC(m\_hMemDC); m\_hMemDC = NULL; return (false); } m\_hRC = ::wglCreateContext(m\_hMemDC); if (!m\_hRC) { SelectObject(m\_hMemDC, m\_hOldDib); DeleteObject(m\_hDib); m\_hDib = NULL; DeleteDC(m\_hMemDC); m\_hMemDC = NULL; return (fal