16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 15:09:19 +02:00

gles doesn't support glGetTexLevelParameter (though it anyway doesn't work on ANGLE)

This commit is contained in:
milek7
2018-10-25 19:00:44 +02:00
parent fbcd933d56
commit 43de4a59f3

View File

@@ -53,16 +53,20 @@ void texture_window::threadfunc()
while (!m_exit) while (!m_exit)
{ {
int w, h; // if texture resized, update window size (maybe not necessary?)
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w); if (GLAD_GL_VERSION_3_3 || GLAD_GL_ES_VERSION_3_1)
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
if (m_tex_w != w || m_tex_h != h)
{ {
m_tex_w = w; int w, h;
m_tex_h = h; glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
m_win_w = w; glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
m_win_h = h; if (m_tex_w != w || m_tex_h != h)
glfwSetWindowSize(m_window, w, h); // eh, not thread-safe (but works?) {
m_tex_w = w;
m_tex_h = h;
m_win_w = w;
m_win_h = h;
glfwSetWindowSize(m_window, w, h); // eh, not thread-safe (but works?)
}
} }
glViewport(0, 0, m_win_w, m_win_h); glViewport(0, 0, m_win_w, m_win_h);