92 {
93 if (m_depthRenderbuffer) {
94 glDeleteRenderbuffers(1, &m_depthRenderbuffer);
95 m_depthRenderbuffer = 0;
96 }
97
98
99 glGenRenderbuffers(1, &m_depthRenderbuffer);
100 glBindRenderbuffer(GL_RENDERBUFFER, m_depthRenderbuffer);
101 glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
102
103
104 if (height == 0) {
105 height = 1;
106 }
107
108
109 glViewport(0, 0, static_cast<GLsizei>(width), static_cast<GLsizei>(height));
110
111 SEnvironmentMgr::SetWidth(width);
112 SEnvironmentMgr::SetHeight(height);
113
114 setProjectionRatio(width, height);
115}