diff --git a/contrib/mobile/drawContext.cpp b/contrib/mobile/drawContext.cpp index 00400ddacf35b20b9d29d02710e862f24f313dff..d0f056afd2dda4653c281e97bd671a4a6d831211 100644 --- a/contrib/mobile/drawContext.cpp +++ b/contrib/mobile/drawContext.cpp @@ -51,7 +51,7 @@ static bool locked = false; static bool onelabStop = false; -drawContext::drawContext() +drawContext::drawContext(bool isRetina) { GmshInitialize(); GmshSetOption("General", "Terminal", 1.0); @@ -64,6 +64,7 @@ drawContext::drawContext() _fillMesh = false; _gradiant = true; + _fontFactor = (isRetina)?2:1; } static void checkGlError(const char* op) { @@ -478,10 +479,10 @@ void drawContext::drawScale() else{ sprintf(label, "%s", data->getName().c_str()); } - drawString lbl(label, 20); + drawString lbl(label, 20*_fontFactor); lbl.draw(xmin+width/2, ymin+ 2.5*dh, 0., _width/(_right-_left), _height/(_top-_bottom)); - drawString val(data->getName().c_str(), 14); + drawString val(data->getName().c_str(), 14*_fontFactor); for(int i = 0; i < 3; i++) { double v = opt->getScaleValue(i, 3, opt->tmpMin, opt->tmpMax); sprintf(label, opt->format.c_str(), v); @@ -536,11 +537,11 @@ void drawContext::drawAxes(float x0, float y0, float z0, float h) glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_COLOR_ARRAY); double dx = h/10; - drawString x ("X", 14,colors); + drawString x ("X", 14*_fontFactor,colors); x.draw(x0+h+dx, y0, z0, _width/(_right-_left), _height/(_top-_bottom), false); - drawString y("Y", 14,colors+8); + drawString y("Y", 14*_fontFactor,colors+8); y.draw(x0+dx, y0+h, z0, _width/(_right-_left), _height/(_top-_bottom), false); - drawString z("Z", 14,colors+16); + drawString z("Z", 14*_fontFactor,colors+16); z.draw(x0+dx, y0, z0+h, _width/(_right-_left), _height/(_top-_bottom), false); glPopMatrix(); glLineWidth(1); diff --git a/contrib/mobile/drawContext.h b/contrib/mobile/drawContext.h index e800ae3501b51868b9f8a5e150776cd31eb84669..d3cf3d63e12961fa5ce66dfde6f1067b3a6bdd62 100644 --- a/contrib/mobile/drawContext.h +++ b/contrib/mobile/drawContext.h @@ -35,6 +35,7 @@ private: movePosition _start, _previous, _current; // store informations about user interactions int _width, _height; // size of OpenGL context in pixel float _left, _right, _top, _bottom; // value of "border" + float _fontFactor; bool _gradiant, // show the background gradiant _fillMesh; // fill the Mesh @@ -43,7 +44,7 @@ private: void drawVectorArray(PViewOptions *opt, VertexArray *va); public: - drawContext(); + drawContext(bool isRetina=false); ~drawContext(){} void load(std::string filename); void eventHandler(int event, float x=0, float y=0); diff --git a/contrib/mobile/drawString.cpp b/contrib/mobile/drawString.cpp index 8d2b19e1a681c6f0c2e81ce3a4f28aafab9e9914..1803b196b34733d36dd2eaf32d4fa0bbf1da1c2c 100644 --- a/contrib/mobile/drawString.cpp +++ b/contrib/mobile/drawString.cpp @@ -56,10 +56,10 @@ void drawString::draw(float x, float y, float z, float w, float h, bool center) if(center) x-=(float)_realWidth/w/2; GLfloat vertex[] = { - x, y, z, // bottom left - x, y+(float)_height/h, z, // top left - x+(float)_width/w, y, z, // bottom right - x+(float)_width/w, y+(float)_height/h, z, // top right + x, y-_height/h+_size/h, z, // bottom left + x, y+(float)_height/h-_height/h+_size/h, z, // top left + x+(float)_width/w, y-_height/h+_size/h, z, // bottom right + x+(float)_width/w, y+(float)_height/h-_height/h+_size/h, z, // top right }; GLfloat texture[] = { 0.0f, 1.0f, // top left diff --git a/contrib/mobile/iOS/Onelab/EAGLView.mm b/contrib/mobile/iOS/Onelab/EAGLView.mm index 606e78847215542111cf2421bb1efa2bf6a1b7d0..e94096edd2d990eff1da6768dd5e06410588217f 100644 --- a/contrib/mobile/iOS/Onelab/EAGLView.mm +++ b/contrib/mobile/iOS/Onelab/EAGLView.mm @@ -54,7 +54,7 @@ //[self release]; return nil; } - mContext = new drawContext(); + mContext = new drawContext(eaglLayer.contentsScale==2); } rendering = NO; return self; diff --git a/contrib/mobile/utils/make_icon_ios.sh b/contrib/mobile/utils/make_icon_ios.sh index b2e124e2d897c4de8a0913bf642e5d57d7191906..64338fd265b71b91696503202f975fcd08cd1046 100755 --- a/contrib/mobile/utils/make_icon_ios.sh +++ b/contrib/mobile/utils/make_icon_ios.sh @@ -5,5 +5,5 @@ mkdir -p ios.iconset convert -scale 152 ../../../utils/icons/gmsh_mobile_master.png ios.iconset/icon_app_ipad_retina.png convert -scale 76 ../../../utils/icons/gmsh_mobile_master.png ios.iconset/icon_app_ipad.png -# App icons (iPhone) +# App icon (iPhone) convert -scale 120 ../../../utils/icons/gmsh_mobile_master.png ios.iconset/icon_app_iphone_retina.png