Forum > General

GLUT

(1/1)

Imants:
Does someone know how to resize GLUT window.

I tryed this code. When there are no window created it is all right but if I had created window my application stop working:

procedure TGLEngine.DoSetScrSize(const NewWidth, NewHeight: Integer);
begin
  if FWnd <> -1 then
    glutDestroyWindow(FWnd);

  glutInitWindowSize(NewWidth, NewHeight);

  glutInitWindowPosition(
    (glutGet(GLUT_SCREEN_WIDTH) - NewWidth) div 2,
    (glutGet(GLUT_SCREEN_HEIGHT) - NewHeight) div 2);

  FWnd := glutCreateWindow('GLUT')
end;   

Leledumbo:
Simply call glutReshapeWindow ;)

Navigation

[0] Message Index

Go to full version