Programming/openGL2011. 4. 24. 23:32
기본적인 예제에서 reshape 쪽에 glOrtho 나 gluPerspective 를 사용하도록 코드가 구현되어 있다.
이를 변경해서, o 와 p 키를 누르면 변경되게 했는데
이래저래 reshape쪽 루틴을 타지 않길래 실험을 해보았더니
reshape는 말그대로 window의 크기 변동에 따라 다시 그리도록 하는 녀석이기 때문에
"윈도우 크기의 변화가 없으면 glutReshapeFunc 에 등록된 루틴을 태우지 않는다.

이래저래 키보드 입력해서 처리를 해야 하나..
아니면 크기를 바꾸는 꽁수를 써야하나?

void glutReshapeWindow(int width, int height);

width  New width of window in pixels.
height New height of window in pixels.


glutReshapeWindow requests a change in the size of the current window. The width and height parameters are size extents in pixels. The width and height must be positive values.

The requests by glutReshapeWindow are not processed immediately. The request is executed after returning to the main event loop. This allows multiple glutReshapeWindow, glutPositionWindow, and glutFullScreen requests to the same window to be coalesced.

In the case of top-level windows, a glutReshapeWindow call is considered only a request for sizing the window. The window system is free to apply its own policies to top-level window sizing. The intent is that top-level windows should be reshaped according glutReshapeWindow's parameters. Whether a reshape actually takes effect and, if so, the reshaped dimensions are reported to the program by a reshape callback.

glutReshapeWindow disables the full screen status of a window if previously enabled. 

[링크 :]

'Programming > openGL' 카테고리의 다른 글

openGL - DoF  (2) 2011.05.03
직교좌표계와 원근좌표계 전환하기  (0) 2011.05.01
glViewport  (0) 2011.04.05
glFrustum - 절두체  (6) 2011.03.30
openGL tutorial - 태양과 지구 돌리기  (0) 2011.03.29
Posted by 구차니

댓글을 달아 주세요