예제 #1
0
파일: DS18B20.cpp 프로젝트: matmunk/DS18B20
uint8_t DS18B20::hasAlarm() {
    uint8_t oldResolution = selectedResolution;
    setResolution(9);
    float temp = getTempC();
    setResolution(oldResolution);
    return ((temp <= selectedScratchpad[ALARM_LOW]) || (temp >= selectedScratchpad[ALARM_HIGH]));
}
예제 #2
0
GlAndroidContext::GlAndroidContext(const XCHAR *title, int width, int height) {
	_render = new GlRender(width, height);
	printGraphicInformation();
	setResolution(width, height);
	setFullscreen(true);
	_Context = this;
}
예제 #3
0
static int l_RenderWindow_setResolution(lua_State *L) {
    auto renderWindow = lua_torenderwindow(L, 1);
    integerType width = luaL_checkint(L, 2);
    integerType height = luaL_checkint(L, 3);
    renderWindow->setResolution(width, height);
    return 0;
}
void ExternalDisplay::processUEventOnline(const char *str) {
    const char *s1 = str + (strlen(str)-strlen(DEVICE_NODE_FB1));
    // check if it is for FB1
    if(strncmp(s1,DEVICE_NODE_FB1, strlen(DEVICE_NODE_FB1))== 0) {
        if(isHDMIConfigured()) {
            // HDMI connect event.
            // Tear-down WFD if it is active.
            if(mExternalDisplay == EXTERN_DISPLAY_FB2) {
                closeFrameBuffer();
                setExternalDisplay(EXTERN_DISPLAY_NONE);
                triggerRefresh();
            }
        }
        readResolution();
        //Get the best mode and set
        setResolution(getBestMode());
        enableHDMIVsync(EXTERN_DISPLAY_FB1);
        setExternalDisplay(EXTERN_DISPLAY_FB1);
        triggerRefresh();
    }
    else if(strncmp(s1, DEVICE_NODE_FB2, strlen(DEVICE_NODE_FB2)) == 0) {
        // WFD connect event
        if(mExternalDisplay  == EXTERN_DISPLAY_FB1) {
            // HDMI has higher priority.
            // Do Not Override.
        }else {
            // WFD is connected
            openFrameBuffer(EXTERN_DISPLAY_FB2);
            setExternalDisplay(EXTERN_DISPLAY_FB2);
            triggerRefresh();
        }
    }
}
void ExtDisplayObserver::handleUEvent(char* str){
    int connected = 0;
    // TODO: check for fb2(WFD) driver also
    if(!strcasestr(str, DEVICE_NODE))
    {
        ALOGD_IF(EXT_OBSERVER_DEBUG, "%s: Not Ext Disp Event ", __FUNCTION__);
        return;
    }
    // Event will be of the form:
    // change@/devices/virtual/graphics/fb1 ACTION=change
    // DEVPATH=/devices/virtual/graphics/fb1
    // SUBSYSTEM=graphics HDCP_STATE=FAIL MAJOR=29
    // for now just parse the online or offline are important for us.
    if(!(strncmp(str,"online@",strlen("online@")))) {
        ALOGD_IF(EXT_OBSERVER_DEBUG, "%s: external disp online", __FUNCTION__);
        connected = 1;
        readResolution();
        //Get the best mode and set
        // TODO: DO NOT call this for WFD
        setResolution(getBestMode());
    } else if(!(strncmp(str,"offline@",strlen("offline@")))) {
        ALOGD_IF(EXT_OBSERVER_DEBUG, "%s: external disp online", __FUNCTION__);
        connected = 0;
        close(fd);
    }
    setExternalDisplayStatus(connected);
}
예제 #6
0
파일: gfbdc.cpp 프로젝트: kingvuplus/ME
gFBDC::gFBDC()
{
	fb=new fbClass;

	if (!fb->Available())
		eFatal("[gFBDC] no framebuffer available");

	int xres;
	int yres;
	int bpp;
	fb->getMode(xres, yres, bpp);

	/* we can only use one of these three modes: */
	if (!((xres == 720 && yres == 576)
		|| (xres == 1280 && yres == 720)
		|| (xres == 1920 && yres == 1080)))
	{
		/* fallback to a decent default */
		xres = 720;
		yres = 576;
	}

	surface.clut.data = 0;
	setResolution(xres, yres); // default res

	reloadSettings();
}
예제 #7
0
bool			BzfDisplay::doSetDefaultResolution()
{
  if (numResolutions >= 2 && defaultResolution < numResolutions)
    return setResolution(defaultResolution);
  else
    return false;
}
void DallasTemperature::begin(void) {
    DeviceAddress deviceAddress;

    _wire->reset_search();

    devices = 0; // Reset the number of devices when we enumerate wire devices

    while (_wire->search(deviceAddress)) {
        if (validAddress(deviceAddress)) {
#if REQUIRESPARASITEPOWERAVAILABLE
            if (!parasite && readPowerSupply(deviceAddress)) parasite = true;
#endif			

            ScratchPad scratchPad;
            readScratchPad(deviceAddress, scratchPad);

#if REQUIRESONLY12BITCONVERSION			
            setResolution(deviceAddress, 12);
#else
            //bitResolution = max(bitResolution, getResolution(deviceAddress));
            uint8_t newResolution = getResolution(deviceAddress);
            if (newResolution > bitResolution) { // the max macro may call getResultion multiple times. 
                bitResolution = newResolution;
            }
#endif
            devices++;
        }
    }
}
예제 #9
0
JNIEXPORT void JNICALL Java_com_n0n3m4_q3e_Q3EJNI_init(JNIEnv *env, jclass c, jstring LibPath, jint width, jint height, jstring GameDir, jstring Cmdline)
{
    char **argv;
    int argc=0;
    jboolean iscopy;
    const char *dir = (*env)->GetStringUTFChars(
                          env, GameDir, &iscopy);
    const char *arg = (*env)->GetStringUTFChars(
                          env, Cmdline, &iscopy);
    chdir(strdup(dir));
    (*env)->ReleaseStringUTFChars(env, GameDir, dir);
    argv = malloc(sizeof(char*) * 255);
    argc = ParseCommandLine(strdup(arg), argv);
    (*env)->ReleaseStringUTFChars(env, Cmdline, arg);

    const char *libpath = (*env)->GetStringUTFChars(
                              env, LibPath, &iscopy);
    loadLib(strdup(libpath));
    (*env)->ReleaseStringUTFChars(env, LibPath, libpath);

    setCallbacks(&initAudio,&writeAudio,&setState);
    setResolution(width, height);

    qmain(argc, argv);
    free(argv);
}
예제 #10
0
ImageReceiver::ImageReceiver ()
  : src (new cv::Mat)
{
  cv::namedWindow ("Live Image", 1);
  setStreaming (true);
  setResolution (640, 480);
}
void ExternalDisplay::setExternalDisplay(int connected)
{

    hwc_context_t* ctx = mHwcContext;
    if(ctx) {
        ALOGD_IF(DEBUG, "%s: status = %d", __FUNCTION__,
                 connected);
        if(connected) {
            readResolution();
            //Get the best mode and set
            // TODO: Move this to activate
            setResolution(getBestMode());
            setDpyAttr();
            //enable hdmi vsync
        } else {
            // Disable the hdmi vsync
            closeFrameBuffer();
            resetInfo();
        }
        // Store the external display
        mExternalDisplay = connected;
        const char* prop = (connected) ? "1" : "0";
        // set system property
        property_set("hw.hdmiON", prop);
    }
    return;
}
예제 #12
0
const bool RawivImporter::import( const std::string& filename )
{
    FILE* ifs = fopen( filename.c_str(), "rb" );
    if ( !ifs )
    {
        kvsMessageError( "Cannot open file <%s>.", filename.c_str() );
        return( false );
    }

    fseek( ifs, 8 * sizeof(int), SEEK_SET );

    unsigned int dim[3];
    fread( dim, sizeof(unsigned int), 3, ifs );
    kvs::Endian::Swap( dim, 3 );
    m_resolution = kvs::Vector3ui( dim );

    fseek( ifs, 6 * sizeof(float), SEEK_CUR );
    const size_t nnodes = m_resolution.x() * m_resolution.y() * m_resolution.z();

    kvs::File file( filename );
    const size_t byte_size = file.byteSize();
    if ( ( byte_size - 68 ) == nnodes )
    {
        unsigned char* values = new unsigned char[ nnodes ];
        fread( values, sizeof(unsigned char), nnodes, ifs );
        kvs::Endian::Swap( values, nnodes );
        m_values = kvs::AnyValueArray( kvs::ValueArray<unsigned char>( values, nnodes ) );
        delete [] values;
    }
    else if ( ( byte_size - 68 ) == 2 * nnodes )
    {
        unsigned short* values = new unsigned short[ nnodes ];
        fread( values, sizeof(unsigned short), nnodes, ifs );
        kvs::Endian::Swap( values, nnodes );
        m_values = kvs::AnyValueArray( kvs::ValueArray<unsigned short>( values, nnodes ) );
        delete [] values;
    }
    else
    {
        float* values = new float[ nnodes ];
        fread( values, sizeof(float), nnodes, ifs );
        kvs::Endian::Swap( values, nnodes );
        m_values = kvs::AnyValueArray( kvs::ValueArray<float>( values, nnodes ) );
        delete [] values;
    }

    fclose( ifs );
    
    const kvs::StructuredVolumeObject::GridType grid_type = kvs::StructuredVolumeObject::Uniform;
    
    setGridType( grid_type );
    setResolution( m_resolution );
    setVeclen( 1 );
    setValues( m_values );
    updateMinMaxCoords();
    updateMinMaxValues();
    
    return( true );
}
예제 #13
0
void QSFMLCanvas::resizeGL(int width, int height)
{
  Vector3 resolution(width,height,32);
  
  setResolution(resolution);
  
  glViewport(0,0,width,height);
}
예제 #14
0
/******************************************************************************
Description.: process commands, allows to set v4l2 controls
Input Value.: * control specifies the selected v4l2 control's id
                see struct v4l2_queryctr in the videodev2.h
              * value is used for control that make use of a parameter.
Return Value: depends in the command, for most cases 0 means no errors and
              -1 signals an error. This is just rule of thumb, not more!
******************************************************************************/
int input_cmd(int plugin_number, unsigned int control_id, unsigned int group, int value)
{
    int ret = -1;
    int i = 0;
    DBG("Requested cmd (id: %d) for the %d plugin. Group: %d value: %d\n", control_id, plugin_number, group, value);
    switch(group) {
    case IN_CMD_GENERIC: {
            int i;
            for (i = 0; i<pglobal->in[plugin_number].parametercount; i++) {
                if ((pglobal->in[plugin_number].in_parameters[i].ctrl.id == control_id) &&
                    (pglobal->in[plugin_number].in_parameters[i].group == IN_CMD_GENERIC)){
                    DBG("Generic control found (id: %d): %s\n", control_id, pglobal->in[plugin_number].in_parameters[i].ctrl.name);
                    DBG("New %s value: %d\n", pglobal->in[plugin_number].in_parameters[i].ctrl.name, value);
                    return 0;
                }
            }
            DBG("Requested generic control (%d) did not found\n", control_id);
            return -1;
        } break;
    case IN_CMD_V4L2: {
            ret = v4l2SetControl(cams[plugin_number].videoIn, control_id, value, plugin_number, pglobal);
            if(ret == 0) {
                pglobal->in[plugin_number].in_parameters[i].value = value;
            } else {
                DBG("v4l2SetControl failed: %d\n", ret);
            }
            return ret;
        } break;
    case IN_CMD_RESOLUTION: {
        // the value points to the current formats nth resolution
        if(value > (pglobal->in[plugin_number].in_formats[pglobal->in[plugin_number].currentFormat].resolutionCount - 1)) {
            DBG("The value is out of range");
            return -1;
        }
        int height = pglobal->in[plugin_number].in_formats[pglobal->in[plugin_number].currentFormat].supportedResolutions[value].height;
        int width = pglobal->in[plugin_number].in_formats[pglobal->in[plugin_number].currentFormat].supportedResolutions[value].width;
        ret = setResolution(cams[plugin_number].videoIn, width, height);
        if(ret == 0) {
            pglobal->in[plugin_number].in_formats[pglobal->in[plugin_number].currentFormat].currentResolution = value;
        }
        return ret;
    } break;
    case IN_CMD_JPEG_QUALITY:
        if((value >= 0) && (value < 101)) {
            pglobal->in[plugin_number].jpegcomp.quality = value;
            if(IOCTL_VIDEO(cams[plugin_number].videoIn->fd, VIDIOC_S_JPEGCOMP, &pglobal->in[plugin_number].jpegcomp) != EINVAL) {
                DBG("JPEG quality is set to %d\n", value);
                ret = 0;
            } else {
                DBG("Setting the JPEG quality is not supported\n");
            }
        } else {
            DBG("Quality is out of range\n");
        }
        break;
    }
    return ret;
}
예제 #15
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ImportR3DStack::readFilterParameters(AbstractFilterParametersReader* reader, int index)
{
  reader->openFilterGroup(this, index);
  setZStartIndex( reader->readValue("ZStartIndex", getZStartIndex()) );
  setZEndIndex( reader->readValue("ZEndIndex", getZEndIndex()) );
  setOrigin( reader->readValue("Origin", getOrigin()) );
  setResolution( reader->readValue("Resolution", getResolution()) );
  reader->closeFilterGroup();
}
예제 #16
0
bool DecodeInputAvFormat::initInput(const char* fileName)
{
    uint16_t width = 0, height = 0;
    int ret = avformat_open_input(&m_format, fileName, NULL, NULL);
    if (ret)
        goto error;
    uint32_t i;
    for (i = 0; i < m_format->nb_streams; ++i) {
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
        AVCodecParameters* codec = m_format->streams[i]->codecpar;
#else
        AVCodecContext* codec = m_format->streams[i]->codec;
#endif
        //VP9: width and height of the IVF header,VP8: width and height is zero
        if (AVMEDIA_TYPE_VIDEO == codec->codec_type) {
            width = codec->width;
            height = codec->height;
            break;
        }
    }

    ret = avformat_find_stream_info(m_format, NULL);
    if (ret < 0)
        goto error;
    for (i = 0; i < m_format->nb_streams; i++)
    {
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 33, 100)
        AVCodecParameters* codec = m_format->streams[i]->codecpar;
#else
        AVCodecContext* codec = m_format->streams[i]->codec;
#endif
        if (AVMEDIA_TYPE_VIDEO == codec->codec_type) {
            m_codecId = codec->codec_id;
            if (codec->extradata && codec->extradata_size)
                m_codecData.append((char*)codec->extradata, codec->extradata_size);
            m_videoId = i;
            //VP9: display_width and display_height of the first frame
            if (codec->width > width)
                width = codec->width;
            if (codec->height > height)
                height = codec->height;
            setResolution(width, height);
            break;
        }
    }
    if (i == m_format->nb_streams) {
        ERROR("no video stream");
        goto error;
    }
    m_isEos = false;
    return true;
error:
    if (m_format)
        avformat_close_input(&m_format);
    return false;

}
void ofApp::endRenderMode(){
    cout<<"realtime mode"<<endl;

    setResolution(realtime_width, realtime_height);

    vwt->setAudioDelay(audio_delay);

    closeAudioFile();
}
예제 #18
0
bool DirectShowCamera::setupDevice() {

	setResolution(_width, _height);
	setFrameRate(_frameRate);
	_videoInput->setAutoReconnectOnFreeze(_id, true, 3);

	return true;

}
예제 #19
0
// set resolution of all devices to 9, 10, 11, or 12 bits
// if new resolution is out of range, it is constrained.
void DallasTemperature::setResolution(uint8_t newResolution)
{
  bitResolution = constrain(newResolution, 9, 12);
  DeviceAddress deviceAddress;
  for (int i=0; i<devices; i++)
  {
    getAddress(deviceAddress, i);
	setResolution(deviceAddress, bitResolution);
  }
}
예제 #20
0
void ExternalDisplay::setEDIDMode(int resMode) {
    ALOGD_IF(DEBUG,"resMode=%d ", resMode);
    {
        Mutex::Autolock lock(mExtDispLock);
        setExternalDisplay(false);
        openFrameBuffer(mHdmiFbNum);
        setResolution(resMode);
    }
    setExternalDisplay(true, mHdmiFbNum);
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void SetOriginResolutionImageGeom::readFilterParameters(AbstractFilterParametersReader* reader, int index)
{
  reader->openFilterGroup(this, index);
  setChangeOrigin( reader->readValue("ChangeOrigin", getChangeOrigin()) );
  setChangeResolution( reader->readValue("ChangeResolution", getChangeResolution()) );
  setOrigin( reader->readFloatVec3("Origin", getOrigin() ) );
  setResolution(reader->readFloatVec3("Resolution", getResolution() ) );
  setDataContainerName(reader->readString("DataContainerName", getDataContainerName()));
  reader->closeFilterGroup();
}
예제 #22
0
/* internal engine routines */
static void *
_output_setup(int w, int h)
{
   Render_Engine *re;
   int i;
   u16 width, height;
   DATA32 *image_data = NULL;
   int image_size;

   printf ("_output_setup called : %dx%d\n", w, h);
   re = calloc(1, sizeof(Render_Engine));
   if (!re)
     return NULL;

   /* Allocate a 1Mb buffer, alligned to a 1Mb boundary
    * to be our shared IO memory with the RSX. */
   re->host_addr = memalign (1024 * 1024, HOST_SIZE);
   if (re->host_addr == NULL)
     {
        free (re);
        return NULL;
     }
   re->context = initScreen (re->host_addr, HOST_SIZE);
   if (re->context == NULL)
     {
        free (re->host_addr);
        free (re);
        return NULL;
     }
   width = w;
   height = h;
   setResolution (re->context, &width, &height);
   re->currentBuffer = 0;
   re->width = width;
   re->height = height;

   for (i = 0; i < MAX_BUFFERS; i++)
     makeBuffer (&re->buffers[i], width, height, i);

   flipBuffer(re->context, MAX_BUFFERS - 1);

   re->tb = evas_common_tilebuf_new(w, h);

   /* in preliminary tests 16x16 gave highest framerates */
   evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);

   /* Allocate our memaligned backbuffer */
   image_size = ((w * h * sizeof(u32)) + 0xfffff) & - 0x100000;
   image_data = memalign (1024 * 1024, image_size);
   re->rgba_image = (RGBA_Image *)evas_cache_image_data(evas_common_image_cache_get(),
                                                        w, h, image_data, 1, EVAS_COLORSPACE_ARGB8888);
   gcmMapMainMemory(image_data, image_size, &re->rgba_image_offset);

   return re;
}
예제 #23
0
파일: metaImage.c 프로젝트: robbisg/meg-mri
metaImage * sag2coron (metaImage * imageS) {

    double conf[12];
    double dim[3], dimNew[3];
    int dimInt[3];
    metaImage imageTemp;
    int i,j,k;

    dim[0] = imageS->dimx;
    dim[1] = imageS->dimy;
    dim[2] = imageS->slices;

    double matrixOut[9];

    for(i = 0; i < 12; i++) {
        if (i<9) matrixOut[i] = 0;
        conf[i] = 0;

    }

    //Rotation around X of -90 degrees (positive is counterclockwise)
    conf[5] = -M_PI*0.5;

    //Zooming should be 1
    conf[6] = conf[8] = 1;
    conf[7] = 1;



    forwardMatrix(matrixOut, conf);

    transformLight(dim, matrixOut, dimNew, conf);

    for(i =0; i<3; i++) {
        dimInt[i] = rint(abs(dimNew[i]));

    }


    printf("%d	%d	%d\n",dimInt[2], dimInt[0], dimInt[1]);
//  printf("%f %f %f\n",imageTemp->resolution[2], imageTemp->resolution[0], imageTemp->resolution[1]);


    initImage(dimInt[2], dimInt[0], dimInt[1], &imageTemp, BACKGROUND);
    setResolution(&imageTemp, imageS->resolution);

    inverseMappingNewLight(imageS, &imageTemp, conf, metaWriteMatrix, trilinearInterp);

    metaImage * pointer = &imageTemp;

//  deInit(imageS);

    return pointer;

}
예제 #24
0
void Game::init(const std::string& path)
{
	// Set application directory
	size_t last_dir = path.find_last_of("/\\");
	m_app_dir = path.substr(0, last_dir + 1);
	if (m_app_dir.empty())
		m_app_dir = "./";

	// Init resources search directory
	Resources::setSearchPath(m_app_dir + "/resources/");

	// Init levels
	std::cout << "* loading levels from " << WB_LEVEL_FILE << std::endl;
	LevelManager::getInstance().openFromFile(m_app_dir + WB_LEVEL_FILE);

	// Init GUI module
	gui::Theme::loadFont(m_app_dir + "/resources/images/font.png");

	SoundSystem::openMusicFromFile(m_app_dir + "/resources/musics/evolution_sphere.ogg");

	// Load configuration from settings file
	IniParser config;
	std::cout << "* loading settings from " << WB_SETTINGS_FILE << std::endl;
	if (config.load(m_app_dir + WB_SETTINGS_FILE))
	{
		config.seek_section("Wallbreaker");
		size_t app_width = config.get("app_width", APP_WIDTH * 2);
		size_t app_height = config.get("app_height", APP_HEIGHT * 2);
		setResolution(app_width, app_height);

		Settings::highscore = config.get("highscore", 0);

		SoundSystem::enableSound(config.get("sound", true));
		SoundSystem::enableMusic(config.get("music", true));
	}
	else
	{
		setResolution(APP_WIDTH * 2, APP_HEIGHT * 2);
	}

	SoundSystem::playMusic();
}
void ExternalDisplay::setEDIDMode(int resMode) {
    ALOGD_IF(DEBUG,"resMode=%d ", resMode);
    int extDispType;
    {
        Mutex::Autolock lock(mExtDispLock);
        extDispType = mExternalDisplay;
        setExternalDisplay(0);
        setResolution(resMode);
    }
    setExternalDisplay(extDispType);
}
예제 #26
0
파일: imageview.cpp 프로젝트: MzHub/cefabs
void ImageView::wheelEvent(QWheelEvent *e) {
    QSize sz = size();
    double u = e->delta() / 120.0 / 4.0;
    if (u < -0.5) u = -0.5;
    if (u > 0.5) u = 0.5;
    if (e->modifiers() & Qt::ControlModifier) {
        setResolution(m_resolution * (1 + u));
    } else {
        setZoom(m_zoom * (1 + u));
    }
}
예제 #27
0
파일: gfbdc.cpp 프로젝트: st7TEAM/bh-gui
gFBDC::gFBDC()
{
	fb=new fbClass;

	if (!fb->Available())
		eFatal("no framebuffer available");

	surface.clut.data = 0;
	setResolution(1280, 720); // default res
	reloadSettings();
}
void PanoramicTFTPStreamreader::setStreamParams(StreamParams newParam)
{
	if (!m_inited) return;
	Mutex mutex(m_params_CS);
	if (newParam.quality!=m_streamParam.quality)
		setQuality(newParam.quality);

	if (newParam.resolution != m_streamParam.resolution)
		setResolution(newParam.resolution);


	if (newParam.width != m_streamParam.width  || newParam.height != m_streamParam.height)
		setResolution(newParam.width, newParam.height);


	if (newParam.bitrate != m_streamParam.bitrate)
		setBitrate(newParam.bitrate);


	m_streamParam = newParam;
}
예제 #29
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void ChangeResolution::readFilterParameters(AbstractFilterParametersReader* reader, int index)
{
  reader->openFilterGroup(this, index);
  setNewDataContainerName( reader->readString("NewDataContainerName", getNewDataContainerName() ) );
  setCellAttributeMatrixPath( reader->readDataArrayPath("CellAttributeMatrixPath", getCellAttributeMatrixPath() ) );
  setCellFeatureAttributeMatrixPath( reader->readDataArrayPath("CellFeatureAttributeMatrixPath", getCellFeatureAttributeMatrixPath() ) );
  setFeatureIdsArrayPath(reader->readDataArrayPath("FeatureIdsArrayPath", getFeatureIdsArrayPath() ) );
  setResolution( reader->readFloatVec3("Resolution", getResolution() ) );
  setRenumberFeatures( reader->readValue("RenumberFeatures", getRenumberFeatures()) );
  setSaveAsNewDataContainer( reader->readValue("SaveAsNewDataContainer", getSaveAsNewDataContainer()) );
  reader->closeFilterGroup();
}
예제 #30
0
/**
 * Constructor.
 */
EmulationThread::EmulationThread(QGLImage *qglimage) : screen(qglimage)
{
	// Allocate buffer of the texture size.
	videoBuffer = NULL;
	QObject::connect(this, SIGNAL(newResolution(int, int)), qglimage, SLOT(resolutionChanged(int, int)));
	setResolution(qglimage->getTextureWidth(), qglimage->getTextureHeight());
	emulationState = EMULATION_STOPPED;
	
	// Set default refresh slow arbitrary frequency.
	setRefreshFrequency(1.0f);
	done = false;
}