Set engine's default values. This has to be called by PApplet, somewhere inside setup() or draw() because it talks to the graphics buffer, meaning that for subclasses like OpenGL, there needs to be a valid graphics context to mess with otherwise you'll get some good crashing action. This is current
()
| 953 | * This is currently called by checkSettings(), during beginDraw(). |
| 954 | */ |
| 955 | protected void defaultSettings() { // ignore |
| 956 | // System.out.println("PGraphics.defaultSettings() " + width + " " + height); |
| 957 | |
| 958 | // //smooth(); // 2.0a5 |
| 959 | // if (quality > 0) { // 2.0a5 |
| 960 | // smooth(); |
| 961 | // } else { |
| 962 | // noSmooth(); |
| 963 | // } |
| 964 | |
| 965 | colorMode(RGB, 255); |
| 966 | fill(255); |
| 967 | stroke(0); |
| 968 | |
| 969 | // as of 0178, no longer relying on local versions of the variables |
| 970 | // being set, because subclasses may need to take extra action. |
| 971 | strokeWeight(DEFAULT_STROKE_WEIGHT); |
| 972 | strokeJoin(DEFAULT_STROKE_JOIN); |
| 973 | strokeCap(DEFAULT_STROKE_CAP); |
| 974 | |
| 975 | // init shape stuff |
| 976 | shape = 0; |
| 977 | |
| 978 | rectMode(CORNER); |
| 979 | ellipseMode(DIAMETER); |
| 980 | |
| 981 | autoNormal = true; |
| 982 | |
| 983 | // no current font |
| 984 | textFont = null; |
| 985 | textSize = 12; |
| 986 | textLeading = 14; |
| 987 | textAlign = LEFT; |
| 988 | textMode = MODEL; |
| 989 | |
| 990 | // if this fella is associated with an applet, then clear its background. |
| 991 | // if it's been created by someone else through createGraphics, |
| 992 | // they have to call background() themselves, otherwise everything gets |
| 993 | // a gray background (when just a transparent surface or an empty pdf |
| 994 | // is what's desired). |
| 995 | // this background() call is for the Java 2D and OpenGL renderers. |
| 996 | if (primaryGraphics) { |
| 997 | //System.out.println("main drawing surface bg " + getClass().getName()); |
| 998 | background(backgroundColor); |
| 999 | } |
| 1000 | |
| 1001 | blendMode(BLEND); |
| 1002 | |
| 1003 | settingsInited = true; |
| 1004 | // defaultSettings() overlaps reapplySettings(), don't do both |
| 1005 | reapplySettings = false; |
| 1006 | } |
| 1007 | |
| 1008 | |
| 1009 | /** |
no test coverage detected