1 /******************************************************************************* 2 * Copyright 2011 See AUTHORS file. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 ******************************************************************************/ 16 17 package com.badlogic.gdx.backends.gwt; 18 19 import com.badlogic.gdx.backends.gwt.GwtGraphics.OrientationLockType; 20 import com.google.gwt.user.client.ui.Panel; 21 import com.google.gwt.user.client.ui.TextArea; 22 23 public class GwtApplicationConfiguration { 24 /** the width of the drawing area in pixels **/ 25 public int width; 26 /** the height of the drawing area in pixels **/ 27 public int height; 28 /** whether to use a stencil buffer **/ 29 public boolean stencil = false; 30 /** whether to enable antialiasing **/ 31 public boolean antialiasing = false; 32 /** the Panel to add the WebGL canvas to, can be null in which case a Panel is added automatically to the body element of the 33 * DOM **/ 34 public Panel rootPanel; 35 /** the id of a canvas element to be used as the drawing area, can be null in which case a Panel and Canvas are added to the 36 * body element of the DOM **/ 37 public String canvasId; 38 /** a TextArea to log messages to, can be null in which case a TextArea will be added to the body element of the DOM. */ 39 public TextArea log; 40 /** whether to use debugging mode for OpenGL calls. Errors will result in a RuntimeException being thrown. */ 41 public boolean useDebugGL = false; 42 /** whether SoundManager2 should prefer to use flash instead of html5 audio (it should fall back if not available) */ 43 public boolean preferFlash = true; 44 /** preserve the back buffer, needed if you fetch a screenshot via canvas#toDataUrl, may have performance impact **/ 45 public boolean preserveDrawingBuffer = false; 46 /** whether to include an alpha channel in the color buffer to combine the color buffer with the rest of the webpage 47 * effectively allows transparent backgrounds in GWT, at a performance cost. **/ 48 public boolean alpha = false; 49 /** whether to use premultipliedalpha, may have performance impact **/ 50 public boolean premultipliedAlpha = false; 51 /** screen-orientation to attempt locking as the application enters full-screen-mode. Note that on mobile browsers, full-screen 52 * mode can typically only be entered on a user gesture (click, tap, key-stroke) **/ 53 public OrientationLockType fullscreenOrientation; 54 GwtApplicationConfiguration(int width, int height)55 public GwtApplicationConfiguration (int width, int height) { 56 this.width = width; 57 this.height = height; 58 } 59 } 60