16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 20:19:18 +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)
{
int w, h;
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
if (m_tex_w != w || m_tex_h != h)
// if texture resized, update window size (maybe not necessary?)
if (GLAD_GL_VERSION_3_3 || GLAD_GL_ES_VERSION_3_1)
{
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?)
int w, h;
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h);
if (m_tex_w != w || m_tex_h != h)
{
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);