안녕하세요?
델파이로 OpenGL을 배우려다 보니 쉽지가 않군요.
자료도 부족하고, 예제등도 없으니,
Visual C++은 예제도 많고, 에러도 없이 잘되던데..
인터넷상에서 간신히 소스를 얻어 delphi다운 형태로 재 배치를 하다보니
문제가 발생하는군요.
컴파일 시키니...
Error : ...(154):Types of actual and formal var parameter must be identical.
Error : ...(182):Types of actual and formal var parameter must be identical.
위의 에러는 다음과 같이 두곳에서 발생했습니다.
델파이 도움말은 한줄밖에 안되니...
(For a variable parameter, the actual argument
must be of the exact type of the formal parameter.)
모두 @pfd를 사용한 곳에서 났는데 무슨 이유인지를 모르겠군요
잘 아시는 분의 해결을 부탁드립니다.
* 그리고 조언을 부탁드립니다.
* 델파이로는 opengl은 사용하지 않는 것 같으니...
* 다시 Visual C++로 돌아가야 하나요?
* 고민이군요
에러난 부분의 소스입니다.
그럼.....
procedure TForm1.setupPixelFormat(m_DC: HDC);
var
pixelFormat: integer;
pfd: TPIXELFORMATDESCRIPTOR;
begin
FillChar(pfd, sizeof(pfd), 0);
with pfd do
begin
nSize := sizeof(TPIXELFORMATDESCRIPTOR);
nVersion := 1;
dwFlags := PFD_SUPPORT_OPENGL or
PFD_DRAW_TO_WINDOW or
PFD_DOUBLEBUFFER;
iPixelType := PFD_TYPE_RGBA;
cColorBits := 16;
cDepthBits := 16;
iLayerType := PFD_MAIN_PLANE;
end;
pixelFormat := ChoosePixelFormat(m_DC, @pfd); //<--- 첫번째 에러
if (pixelFormat = 0) then
begin
MessageBox( WindowFromDC(m_DC),
'ChoosePixelFormat failed.', 'Error',
MB_ICONERROR or MB_OK );
halt;
end;
if (SetPixelFormat(m_DC, pixelFormat, @pfd) <> TRUE) then //<--- 두번째 에러
begin
MessageBox( WindowFromDC(m_DC),
'SetPixelFormat failed.', 'Error',
MB_ICONERROR or MB_OK );
halt;
end;
end;
|