Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
* MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
* ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
* DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
*/
package jogamp.newt.driver.bcm.egl;
import javax.media.nativewindow.DefaultGraphicsScreen;
import javax.media.nativewindow.util.Rectangle;
import jogamp.newt.MonitorModeProps;
import jogamp.newt.ScreenImpl;
import com.jogamp.newt.MonitorDevice;
import com.jogamp.newt.MonitorMode;
public class ScreenDriver extends jogamp.newt.ScreenImpl {
static {
DisplayDriver.initSingleton();
}
public ScreenDriver() {
}
@Override
protected void createNativeImpl() {
aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
}
@Override
protected void closeNativeImpl() { }
@Override
protected int validateScreenIndex(int idx) {
return 0; // only one screen available
}
@Override
protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
int i = 0;
props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
props[i++] = fixedWidth; // FIXME
props[i++] = fixedHeight; // FIXME
props[i++] = ScreenImpl.default_sm_bpp; // FIXME
props[i++] = ScreenImpl.default_sm_rate * 100; // FIXME
props[i++] = 0; // flags
props[i++] = 0; // mode_idx
props[i++] = 0; // rotation
final MonitorMode currentMode = MonitorModeProps.streamInMonitorMode(null, cache, props, 0);
props = new int[MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES - 1 - MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES];
i = 0;
props[i++] = props.length;
props[i++] = 0; // crt_idx
props[i++] = ScreenImpl.default_sm_widthmm; // FIXME
props[i++] = ScreenImpl.default_sm_heightmm; // FIXME
props[i++] = 0; // rotated viewport x
props[i++] = 0; // rotated viewport y
props[i++] = fixedWidth; // FIXME rotated viewport width
props[i++] = fixedHeight; // FIXME rotated viewport height
MonitorModeProps.streamInMonitorDevice(null, cache, this, cache.monitorModes, currentMode, props, 0);
}
@Override
protected MonitorMode queryCurrentMonitorModeImpl(final MonitorDevice monitor) {
return monitor.getSupportedModes().get(0);
}
@Override
protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
return false;
}
@Override
protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
vOriginSize.set(0, 0, fixedWidth, fixedHeight); // FIXME
}
//----------------------------------------------------------------------
// Internals only
//
static final int fixedWidth = 1920; // FIXME
static final int fixedHeight = 1080; // FIXME
}