PDA

View Full Version : I need your help.. about "pixel format"



skydrm2
12-27-2004, 07:45 PM
Hi...^^ [ :) ]
(sorry I am not well speaking in english)

I am using eVc++ 4.0 and pocket pc 2003, emulater, and I use vencent's library.

Now I try to convert a MD2 loader(Opengl) to Opengl-Es version loader.

I've got(get?) a problems that is pixel-format.


=============================================
// [ caller ]

case WM_CREATE: // window is being created

hDC = GetDC(hwnd); // get current window's device context
g_HDC = hDC;
SetupPixelFormat(hDC); // call our pixel format setup function

// create rendering context and make it current
hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC, hRC);

========================================

// function to set the pixel format for the device context
void SetupPixelFormat(HDC hDC)
{
int nPixelFormat; // our pixel format index

static PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // size of structure
1, // default version
PFD_DRAW_TO_WINDOW | // window drawing support
PFD_SUPPORT_OPENGL | // OpenGL support
PFD_DOUBLEBUFFER, // double buffering support
PFD_TYPE_RGBA, // RGBA color mode
16, // 32 bit color mode
0, 0, 0, 0, 0, 0, // ignore color bits, non-palettized mode
0, // no alpha buffer
0, // ignore shift bit
0, // no accumulation buffer
0, 0, 0, 0, // ignore accumulation bits
16, // 16 bit z-buffer size
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main drawing plane
0, // reserved
0, 0, 0 }; // layer masks ignored

nPixelFormat = ChoosePixelFormat(hDC, &pfd); // choose best matching pixel format

SetPixelFormat(hDC, nPixelFormat, &pfd); // set pixel format to device context
}

=============================================

I can't convert this part. :(
I can't get information about this.

may be wgl -> egl .. I can't..

Help Me.......

I want to write more longer to explain what is my problem but I can't that.
Sorry...

[ December 27, 2004: Message edited by: quddn ]

[ December 27, 2004: Message edited by: quddn ]