static void InitBannerFrame( void ) { if( !banner_local.flags.bInited ) { TEXTCHAR font[256]; InvokeDeadstart(); // register my control please... (f*****g optimizations) banner_local.pii = GetImageInterface(); banner_local.pdi = GetDisplayInterface(); banner_local.flags.bFullDraw = RequiresDrawAll(); GetDisplaySizeEx( 0, NULL, NULL, &banner_local.w, &banner_local.h ); #ifndef __NO_OPTIONS__ SACK_GetProfileStringEx( WIDE( "SACK/Widgets/Banner2" ), WIDE( "Default Font" ), WIDE( "arialbd.ttf" ), font, sizeof( font ), TRUE ); #else StrCpy( font, WIDE( "arialbd.ttf" ) ); #endif banner_local.font = RenderFontFile( font , banner_local.w / 30, ( ( banner_local.w * 1080 ) / 1920 ) / 20 , 2 ); if( !banner_local.font ) { #ifndef __NO_OPTIONS__ SACK_GetProfileStringEx( WIDE( "SACK/Widgets/Banner2" ), WIDE( "Alternate Font" ), WIDE( "fonts/arialbd.ttf" ), font, sizeof( font ), TRUE ); #else StrCpy( font, WIDE( "fonts/arialbd.ttf" ) ); #endif banner_local.font = RenderFontFile( font , banner_local.w / 30, ( ( banner_local.w * 1080 ) / 1920 ) / 20 , 2 ); } banner_local.explorer_font = RenderFontFile( font , banner_local.w / 60, ( ( banner_local.w * 1080 ) / 1920 ) / 40 , 2 ); banner_local.flags.bInited = TRUE; } }
int main( int argc, char **argv ) { l.world = OpenWorld( WIDE("") ); LoadWorldFromFile( l.world ); WakeableSleep( 500 ); // give the world time to load. { uint32_t w, h; PBODY body = EnterWorld( l.world ); PVIEW view ; GetDisplaySizeEx( 0, NULL,NULL,&w, &h ); //view = CreateViewEx( V_FORWARD, NULL, WIDE("blah"), h/3, h/3 ); //view = CreateViewEx( V_DOWN, NULL, WIDE("blah"), h/3, 0 ); //view = CreateViewEx( V_UP, NULL, WIDE("blah"), h/3, 2*h/2 ); //view = CreateViewEx( V_RIGHT, NULL, WIDE("blah"), 0, h/3 ); //view = CreateViewEx( V_LEFT, NULL, WIDE("blah"), 2*h/3, h/3 ); //view = CreateViewEx( V_BEHIND, NULL, WIDE("blah"), 3*h/3, h/3 ); //Equip( body ); //PlayWorld( world, body ); while( 1 ) Sleep( 1000 ); } return 0; }
int main( void ) { int32_t x, y; uint32_t w, h; PRENDERER renderer; l.pii = GetImageInterface(); l.pri = GetDisplayInterface(); SetSystemLog( SYSLOG_FILE, stdout ); GetDisplaySizeEx( 0, &x, &y, &w, &h ); renderer = OpenDisplaySizedAt( 0, w, h, x, y ); SetTouchHandler( renderer, touch_events, 0 ); UpdateDisplay( renderer ); while( 1 ) { WakeableSleep( 1000 ); } #if 0 HOOKPROC hkprcSysMsg; static HINSTANCE hinstDLL; static HHOOK hhookSysMsg; hinstDLL = LoadLibrary(TEXT("c:\\myapp\\sysmsg.dll")); hkprcSysMsg = (HOOKPROC)GetProcAddress(hinstDLL, "SysMessageProc"); hhookSysMsg = SetWindowsHookEx( WH_SYSMSGFILTER, hkprcSysMsg, hinstDLL, 0); SetWindowsHookEx( #endif return 0; }