Commit 66691085 authored by Christophe Geuzaine's avatar Christophe Geuzaine

reset GL_UNPACK_ROW_LENGTH to 0 (tentative fix for texture/font issues on some…

reset GL_UNPACK_ROW_LENGTH to 0 (tentative fix for texture/font issues on some Windows/Mac machines)
parent 2dad4c39
Pipeline #2962 failed with stage
in 56 minutes and 25 seconds
......@@ -81,6 +81,7 @@ GLuint gmshPopplerWrapper::getTextureForPage(double xres, double yres)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img->w(), img->h(), 0,
(img->d() == 4) ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE,
img->array);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
_w = img->w();
_h = img->h();
......
......@@ -147,10 +147,8 @@ public:
void drawString(const char *str) { gl_draw(str); }
void resetFontTextures()
{
#if defined(__APPLE__)
gl_texture_pile_height(
gl_texture_pile_height()); // force font texture recomputation
#endif
// force font texture recomputation
gl_texture_pile_height(gl_texture_pile_height());
}
std::string getName() { return "Fltk"; }
};
......
......@@ -445,6 +445,7 @@ bool drawContext::generateTextureForImage(const std::string &name, int page,
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img2->w(), img2->h(), 0,
(img2->d() == 4) ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE,
img2->array);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
imageW = img->w();
imageH = img->h();
delete img;
......
......@@ -111,6 +111,12 @@ public:
virtual std::string getName() { return "None"; }
};
class imgtex {
public:
GLuint tex, w, h;
imgtex() : tex(0), w(0), h(0) {}
};
class drawContext {
private:
static drawContextGlobal *_global;
......@@ -121,9 +127,6 @@ private:
std::set<PView *> _hiddenViews;
GLuint _bgImageTexture, _bgImageW, _bgImageH;
openglWindow *_openglWindow;
struct imgtex {
GLuint tex, w, h;
};
std::map<std::string, imgtex> _imageTextures;
public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment