本文整理汇总了C++中screen函数的典型用法代码示例。如果您正苦于以下问题:C++ screen函数的具体用法?C++ screen怎么用?C++ screen使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了screen函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: screen
void CUIWindowItem::PositionSelf()
{
if( m_pWindow )
{
CEGUI::MouseCursor& cursor = CEGUI::MouseCursor::getSingleton();
CEGUI::Rect screen( CEGUI::System::getSingleton().getRenderer()->getRect());
CEGUI::Rect tipRect( m_pWindow->getUnclippedPixelRect());
const CEGUI::Image* mouseImage = cursor.getImage();
CEGUI::Point mousePos(cursor.getPosition());
CEGUI::Size mouseSz(0,0);
if (mouseImage)
{
mouseSz = mouseImage->getSize();
}
CEGUI::Point tmpPos(mousePos.d_x - tipRect.getWidth() - 5, mousePos.d_y - tipRect.getHeight() - 5);
tipRect.setPosition(tmpPos);
// if tooltip would be off the right of the screen,
// reposition to the other side of the mouse cursor.
if ( tipRect.d_right < 0 )
{
tmpPos.d_x = mousePos.d_x + mouseSz.d_width + 5;
}
// if tooltip would be off the bottom of the screen,
// reposition to the other side of the mouse cursor.
if ( tipRect.d_bottom < 0 )
{
tmpPos.d_y = mousePos.d_y + mouseSz.d_height + 5;
}
// set final position of tooltip window.
m_pWindow->setPosition( CEGUI::Absolute, tmpPos);
}
}
示例2: Z80
void sys2900_state::sys2900(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, XTAL(8'000'000) / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &sys2900_state::mem_map);
m_maincpu->set_addrmap(AS_IO, &sys2900_state::io_map);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(50);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
screen.set_size(640, 480);
screen.set_visarea(0, 640-1, 0, 480-1);
screen.set_screen_update(FUNC(sys2900_state::screen_update_sys2900));
screen.set_palette("palette");
PALETTE(config, "palette", palette_device::MONOCHROME);
Z80CTC(config, "ctc", 0);
Z80PIO(config, "pio", 0);
Z80SIO(config, "sio1", 0);
Z80SIO(config, "sio2", 0);
}
示例3: agentWarnInvalidNumArgs
std::string
CommandEventHandler::info(std::vector<std::string>& args)
{
if (args.size() != 1)
return agentWarnInvalidNumArgs(1);
if (args[0].compare("id") == 0)
return id();
else if (args[0].compare("os") == 0)
return os();
else if (args[0].compare("systime") == 0)
return systime();
else if (args[0].compare("uptime") == 0)
return uptime();
else if (args[0].compare("uptimemillis") == 0)
return uptimemillis();
else if (args[0].compare("screen") == 0)
return screen();
else if (args[0].compare("memory") == 0)
return memory();
else if (args[0].compare("power") == 0)
return power();
return agentWarn("Invalid info subcommand.");
}
示例4: Z80
// TODO: Additional machine definition - Master Monty has a different memory layout
void monty_state::monty(machine_config &config)
{
// Basic machine hardware
Z80(config, m_maincpu, 3580000); // Ceramic resonator labeled 3.58MT
m_maincpu->set_addrmap(AS_PROGRAM, &monty_state::monty_mem);
m_maincpu->set_addrmap(AS_IO, &monty_state::monty_io);
m_maincpu->halt_cb().set(FUNC(monty_state::halt_changed));
// Video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD));
screen.set_refresh_hz(50);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // Not accurate
screen.set_size(50, 32); // Two SED1503s (42x16 pixels) control the top and bottom halves
screen.set_visarea(0, 50-1, 0, 32-1);
screen.set_screen_update(FUNC(monty_state::lcd_update));
/* sound hardware */
SPEAKER(config, "mono").front_center();
SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50);
// LCD controller interfaces
SED1520(config, m_sed0).set_screen_update_cb(FUNC(monty_state::screen_update));
}
示例5: MC6809E
void cswat_state::cswat(machine_config &config)
{
/* basic machine hardware */
MC6809E(config, m_maincpu, XTAL(18'432'000)/3/4); // HD68A09EP, 1.5MHz?
m_maincpu->set_addrmap(AS_PROGRAM, &cswat_state::cswat_map);
m_maincpu->set_vblank_int("screen", FUNC(cswat_state::irq0_line_assert));
m_maincpu->set_periodic_int(FUNC(cswat_state::nmi_handler), attotime::from_hz(300)); // ?
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500));
screen.set_size(36*8, 28*8);
screen.set_visarea_full();
screen.set_palette("palette");
screen.set_screen_update(FUNC(cswat_state::screen_update_cswat));
GFXDECODE(config, "gfxdecode", "palette", gfx_cswat);
PALETTE(config, "palette").set_entries(4*256);
/* sound hardware */
// TODO
}
示例6: FUNC
ROM_END
/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void a2bus_videx160_device::device_add_mconfig(machine_config &config)
{
screen_device &screen(SCREEN(config, ULTRATERM_SCREEN_NAME, SCREEN_TYPE_RASTER));
screen.set_raw(CLOCK_LOW, 882, 0, 720, 370, 0, 350);
screen.set_screen_update(ULTRATERM_MC6845_NAME, FUNC(mc6845_device::screen_update));
MC6845(config, m_crtc, CLOCK_LOW/9);
m_crtc->set_screen(ULTRATERM_SCREEN_NAME);
m_crtc->set_show_border_area(false);
m_crtc->set_char_width(8);
m_crtc->set_update_row_callback(FUNC(a2bus_videx160_device::crtc_update_row), this);
m_crtc->out_vsync_callback().set(FUNC(a2bus_videx160_device::vsync_changed));
}
示例7: sprintf
DIR *CommandMenu::screenopendir(char *m_commandDir,int *dirlen,int olddirlen)
{
char *p;
DIR *dir;
if(isRootDir)
{
for(p=m_commandDir;*p;p++); // search end of m_commandDir
sprintf(p,".%d",screen()); // append screen number
dir = opendir(m_commandDir);
if (dir == NULL) {
m_commandDir[olddirlen] = '\0'; // strip of screen number
*dirlen = olddirlen;
dir = opendir(m_commandDir);
}
}
else
{
*dirlen = olddirlen;
dir = opendir(m_commandDir);
}
return(dir);
}
示例8: Z80
void microterm_state::mt5510(machine_config &config)
{
Z80(config, m_maincpu, 6_MHz_XTAL);
m_maincpu->set_addrmap(AS_PROGRAM, µterm_state::mt5510_mem_map);
m_maincpu->set_addrmap(AS_IO, µterm_state::mt5510_io_map);
scn2681_device &duart(SCN2681(config, "duart", 3.6864_MHz_XTAL));
duart.irq_cb().set_inputline(m_maincpu, 0);
duart.outport_cb().set("eeprom1", FUNC(eeprom_serial_93cxx_device::di_write)).bit(6);
duart.outport_cb().append("eeprom2", FUNC(eeprom_serial_93cxx_device::di_write)).bit(5);
duart.outport_cb().append("eeprom1", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(4);
duart.outport_cb().append("eeprom2", FUNC(eeprom_serial_93cxx_device::cs_write)).bit(4);
duart.outport_cb().append("eeprom1", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(3);
duart.outport_cb().append("eeprom2", FUNC(eeprom_serial_93cxx_device::clk_write)).bit(3);
EEPROM_93C46_16BIT(config, "eeprom1").do_callback().set("duart", FUNC(scn2681_device::ip6_w));
EEPROM_93C46_16BIT(config, "eeprom2").do_callback().set("duart", FUNC(scn2681_device::ip5_w));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(45.8304_MHz_XTAL / 2, 1120, 0, 960, 341, 0, 300); // wild guess at resolution
screen.set_screen_update(FUNC(microterm_state::mt5510_update));
}
示例9: main
/*===========================================================================*/
int main( int argc, char** argv )
{
kvs::glut::Application app( argc, argv );
/* Read volume data from the specified data file. If the data file is not
* specified, tornado volume data is created by using kvs::TornadoVolumeData class.
*/
kvs::StructuredVolumeObject* object = NULL;
if ( argc > 1 ) object = new kvs::StructuredVolumeImporter( std::string( argv[1] ) );
else object = new kvs::TornadoVolumeData( kvs::Vector3ui( 8, 8, 8 ) );
if ( !object )
{
kvsMessageError( "Cannot create a structured volume object." );
return false;
}
// Create a diamond glyph renderer.
kvs::DiamondGlyph* glyph = new kvs::DiamondGlyph();
if ( !glyph )
{
kvsMessageError( "Cannot creat an diamond glyph.");
return false;
}
// Set properties.
const kvs::TransferFunction transfer_function( 256 );
glyph->setTransferFunction( transfer_function );
kvs::glut::Screen screen( &app );
screen.registerObject( object, glyph );
screen.setGeometry( 0, 0, 512, 512 );
screen.setTitle( "kvs::DiamondGlyph" );
screen.show();
return app.run();
}
示例10: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QSplashScreen screen(QPixmap(":/images/chargement.png"));
screen.show();
app.processEvents();
//Traduction des boutons
QString locale = QLocale::system().name().section('_', 0, 0);
QTranslator translator;
translator.load(QString("qt_") + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
app.installTranslator(&translator);
//-----------------------------------------------------
// Vérification de l'existence d'une autre instance
//-----------------------------------------------------
app.setApplicationName("Dadaword");
QSharedMemory sharedMemory(app.applicationName());
// On vérifie à la création de cette zone mémoire si celle-ci existe
if(sharedMemory.create(sizeof(int))==false){
QMessageBox::warning(0, QObject::tr("Programme en cours d'exécution"), QObject::tr("Dadaword est déjà en cours d'exécution. Veuillez fermer l'instance ouverte avant de le lance à nouveau."));
//exit(EXIT_SUCCESS);
}
DadaWord instance;
//Création de l'interface utilisateur
instance.createUI();
//Affichage
instance.show();
screen.finish(&instance);
return app.exec();
}
示例11: M6502
void pokechmp_state::pokechmp(machine_config &config)
{
/* basic machine hardware */
M6502(config, m_maincpu, 4_MHz_XTAL/4);
m_maincpu->set_addrmap(AS_PROGRAM, &pokechmp_state::pokechmp_map);
M6502(config, m_audiocpu, 4_MHz_XTAL/4);
m_audiocpu->set_addrmap(AS_PROGRAM, &pokechmp_state::pokechmp_sound_map);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
screen.set_size(32*8, 32*8);
screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1);
screen.set_screen_update(FUNC(pokechmp_state::screen_update_pokechmp));
screen.set_palette(m_palette);
screen.screen_vblank().set_inputline(m_maincpu, INPUT_LINE_NMI);
screen.screen_vblank().append(FUNC(pokechmp_state::sound_irq));
GFXDECODE(config, m_gfxdecode, m_palette, gfx_pokechmp);
PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x400);
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
YM2203(config, "ym1", XTAL(4'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.60);
YM3812(config, "ym2", XTAL(24'000'000)/16).add_route(ALL_OUTPUTS, "mono", 1.0);
okim6295_device &oki(OKIM6295(config, "oki", XTAL(24'000'000)/16, okim6295_device::PIN7_LOW));
oki.add_route(ALL_OUTPUTS, "mono", 0.50); /* sound fx */
oki.add_route(ALL_OUTPUTS, "mono", 0.50);
oki.set_addrmap(0, &pokechmp_state::pokechmp_oki_map);
}
示例12: screen
void Tooltip::positionSelf(void)
{
MouseCursor& cursor = MouseCursor::getSingleton();
Rect screen(Vector2(0, 0), System::getSingleton().getRenderer()->getDisplaySize());
Rect tipRect(getUnclippedOuterRect());
const Image* mouseImage = cursor.getImage();
Point mousePos(cursor.getPosition());
Size mouseSz(0,0);
if (mouseImage)
{
mouseSz = mouseImage->getSize();
}
Point tmpPos(mousePos.d_x + mouseSz.d_width, mousePos.d_y + mouseSz.d_height);
tipRect.setPosition(tmpPos);
// if tooltip would be off the right of the screen,
// reposition to the other side of the mouse cursor.
if (screen.d_right < tipRect.d_right)
{
tmpPos.d_x = mousePos.d_x - tipRect.getWidth() - 5;
}
// if tooltip would be off the bottom of the screen,
// reposition to the other side of the mouse cursor.
if (screen.d_bottom < tipRect.d_bottom)
{
tmpPos.d_y = mousePos.d_y - tipRect.getHeight() - 5;
}
// set final position of tooltip window.
setPosition(
UVector2(cegui_absdim(tmpPos.d_x),
cegui_absdim(tmpPos.d_y)));
}
示例13: Z80
void calorie_state::calorie(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, 4000000); /* 4 MHz */
m_maincpu->set_addrmap(AS_PROGRAM, &calorie_state::calorie_map);
m_maincpu->set_addrmap(AS_OPCODES, &calorie_state::decrypted_opcodes_map);
m_maincpu->set_vblank_int("screen", FUNC(calorie_state::irq0_line_hold));
z80_device &audiocpu(Z80(config, "audiocpu", 3000000)); /* 3 MHz */
audiocpu.set_addrmap(AS_PROGRAM, &calorie_state::calorie_sound_map);
audiocpu.set_addrmap(AS_IO, &calorie_state::calorie_sound_io_map);
audiocpu.set_periodic_int(FUNC(calorie_state::irq0_line_hold), attotime::from_hz(64));
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
screen.set_size(256, 256);
screen.set_visarea(0, 256-1, 16, 256-16-1);
screen.set_screen_update(FUNC(calorie_state::screen_update_calorie));
screen.set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_calorie);
PALETTE(config, m_palette).set_format(palette_device::xBGR_444, 0x100);
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
YM2149(config, "ay1", 1500000).add_route(ALL_OUTPUTS, "mono", 0.8);
YM2149(config, "ay2", 1500000).add_route(ALL_OUTPUTS, "mono", 0.8);
YM2149(config, "ay3", 1500000).add_route(ALL_OUTPUTS, "mono", 0.8);
}
示例14: D_INTERNAL
void ParameterWindow::_constrainToScreen() {
D_INTERNAL(("ParameterWindow::_constrainToScreen()\n"));
BScreen screen(this);
BRect screenRect = screen.Frame();
BRect windowRect = Frame();
// if the window is outside the screen rect
// move it to the default position
if (!screenRect.Intersects(windowRect)) {
windowRect.OffsetTo(screenRect.LeftTop());
MoveTo(windowRect.LeftTop());
windowRect = Frame();
}
// if the window is larger than the screen rect
// resize it to fit at each side
if (!screenRect.Contains(windowRect)) {
if (windowRect.left < screenRect.left) {
windowRect.left = screenRect.left + 5.0;
MoveTo(windowRect.LeftTop());
windowRect = Frame();
}
if (windowRect.top < screenRect.top) {
windowRect.top = screenRect.top + 5.0;
MoveTo(windowRect.LeftTop());
windowRect = Frame();
}
if (windowRect.right > screenRect.right) {
windowRect.right = screenRect.right - 5.0;
}
if (windowRect.bottom > screenRect.bottom) {
windowRect.bottom = screenRect.bottom - 5.0;
}
ResizeTo(windowRect.Width(), windowRect.Height());
}
}
示例15: _SetRect
void
PreviewView::Update(const BRect* rect, BBitmap* bitmap)
{
if (Window() == NULL || Window()->IsHidden())
return;
if (rect != NULL)
_SetRect(*rect);
bigtime_t now = system_time();
if (bitmap == NULL) {
// Avoid updating preview too often
if (fTimeStamp + 50000 >= now)
return;
BScreen screen(Window());
screen.GetBitmap(&bitmap, false, &fCoordRect);
}
if (bitmap != NULL) {
BRect destRect;
BRect bitmapBounds = bitmap->Bounds();
BRect viewBounds = fBitmapView->Bounds();
if (BRectRatio(viewBounds) >= BRectRatio(bitmapBounds)) {
float overlap = BRectHorizontalOverlap(viewBounds, bitmapBounds);
destRect.Set(-overlap, 0, viewBounds.Width() + overlap,
viewBounds.Height());
} else {
float overlap = BRectVerticalOverlap(viewBounds, bitmapBounds);
destRect.Set(0, -overlap, viewBounds.Width(), viewBounds.Height() + overlap);
}
fTimeStamp = now;
fBitmapView->SetViewBitmap(bitmap,
bitmap->Bounds().OffsetToCopy(B_ORIGIN),
destRect,
B_FOLLOW_TOP|B_FOLLOW_LEFT, B_FILTER_BITMAP_BILINEAR);
Invalidate();
}
}