int main(int argc, char** argv) { // Create display. Display* dpy = CreateDisplay(); int screen = XDefaultScreen(dpy); int depth = XDefaultDepth(dpy, screen); Window root_win = XDefaultRootWindow(dpy); int numScreens = 1; Drawable screens[] = { root_win }; axRect dpy_rect = axRect(0, 0, XDisplayWidth(dpy, screen), XDisplayHeight(dpy, screen)); // Setup GLX. XVisualInfo* v_info = GetGLXVisualInfo(dpy); Visual* visual = v_info->visual; Colormap colormap = XCreateColormap(dpy, root_win, visual, AllocNone); glEnable(GL_TEXTURE_2D); // Create window. axRect window_rect(0, 0, 500, 500); Window win = CreateWindow(dpy, window_rect, root_win, colormap, v_info); // Pixmap back_buffer = XCreatePixmap(dpy, win, // window_rect.size.x, window_rect.size.y, // screen); GLXContext glx_context = glXCreateContext(dpy, v_info, NULL, GL_TRUE); //GC gc; glXMakeCurrent(dpy, win, glx_context); //glXMakeCurrent( AX_GLOBAL_DISPLAY, win, gc->GetGLX_GC() ); //Window win = XCreateSimpleWindow(dpy, RootWindow(dpy, s), 10, 10, 660, 200, 1, // BlackPixel(dpy, s), WhitePixel(dpy, s)); XSelectInput(dpy, win, StructureNotifyMask | ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | EnterWindowMask | LeaveWindowMask | FocusChangeMask ); // Show window. XMapWindow(dpy, win); //XFlush(dpy); XStoreName(dpy, win, "axLib"); //XSelectInput(dpy, win, ExposureMask | KeyPressMask); //XMapWindow(dpy, win); // #if defined(__APPLE_CC__) // XStoreName(dpy, win, "Geeks3D.com - X11 window under Mac OS X (Lion)"); // #else // XStoreName(dpy, win, "Geeks3D.com - X11 window under Linux (Mint 10)"); // #endif MainLoop(dpy, win, window_rect); XDestroyWindow(dpy, win); XCloseDisplay(dpy); return 0; }
OBSQTDisplay::OBSQTDisplay(QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags) { setAttribute(Qt::WA_PaintOnScreen); setAttribute(Qt::WA_StaticContents); setAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_DontCreateNativeAncestors); setAttribute(Qt::WA_NativeWindow); auto windowVisible = [this] (bool visible) { if (!visible) return; if (!display) { CreateDisplay(); } else { QSize size = GetPixelSize(this); obs_display_resize(display, size.width(), size.height()); } }; auto sizeChanged = [this] (QScreen*) { CreateDisplay(); QSize size = GetPixelSize(this); obs_display_resize(display, size.width(), size.height()); }; connect(windowHandle(), &QWindow::visibleChanged, windowVisible); connect(windowHandle(), &QWindow::screenChanged, sizeChanged); }
void CKSUsername_And_Password_Pane::Init() { mpPane = ge::IPane::Create(); mpPane->SetSize(ge::SSize(320,245)); tint32 iPosY = 0; CreateBitmap(ge::IControl::giNoID, IDB_Back_Sign_In, ge::SPos(0, 0)); iPosY += 60; // user name mpUser_Name_Txt = CreateDisplay(giCtrl_User_Name_Display, ge::SPos(23, 32), ge::SSize(197, 16), CreateFont(Generic128, IDF_Font_Fuxley_712, ge::SRGB(10, 10, 10)), true); mpUser_Name_Txt->SetHorzAlignment(ge::IText::HorzAlignLeft); mpUser_Name_Txt->SetClicksOutsideAsSuccess(); // password mpPassword_Txt = CreateDisplay(giCtrl_Password_Display, ge::SPos(23, 32+42), ge::SSize(197, 16), CreateFont(Generic128, IDF_Font_Fuxley_712, ge::SRGB(10, 10, 10)), true); mpPassword_Txt->SetHorzAlignment(ge::IText::HorzAlignLeft); mpPassword_Txt->SetClicksOutsideAsSuccess(); mpPassword_Txt->SetPassword(); // remember username and password mpRemember_Me_Button = Create2StateButton(giCtrl_Remember_Me, IDB_Button_Remember_Me, ge::SPos(23, 105), false); // cancel button CreateButton(giCtrl_Username_And_Password_Cancel, IDB_Button_Cancel, ge::SPos(119, 149), false); // ok button CreateButton(giCtrl_Username_And_Password_OK, IDB_Button_OK, ge::SPos(180, 149), false); }
void CKSImportGUIPane::Init() { mpPane = ge::IPane::Create(); mpPane->SetSize(ge::SSize(424,424)); CreateBitmap(ge::IControl::giNoID, IDB_Back_Import, ge::SPos(0, 0)); mpPop = NULL; //------------------------------------------------- // Scroll pane viewing the content in a "Folder" mpImport_File_Browser = new CKS_Import_File_Browser(this, GetGUI()); mpImport_File_Browser->SetInfo(); mpImport_File_Browser->Init(); mpPane->AddControl(mpImport_File_Browser->GetPane(), ge::SPos(8, 39)); Create_File_Browser_ScrollBar(); //------------------------------------------------- // Scroll pane viewing a list of files to add to te project mpImport_Files = new CKS_Import_Files(this, GetGUI()); mpImport_Files->SetInfo(); mpImport_Files->Init(); mpPane->AddControl(mpImport_Files->GetPane(), ge::SPos(216, 39)); Create_File_ScrollBar(); CreateButton(giCtrl_Remove_Import, IDB_Button_Move, ge::SPos(195, 345), false); CreateButton(giCtrl_Add_Import, IDB_Button_Add, ge::SPos(195, 369), false); // Stop CreateButton(giCtrl_Stop_Import, IDB_Button_Stop, ge::SPos(195, 369+24), false); // Play Create2StateButton(giCtrl_Play_Import, IDB_Button_Play, ge::SPos(195+28, 369+24), true); // Cancel / Export CreateButton(giCtrl_Cancel_Import, IDB_Button_Cancel, ge::SPos(292, 400), false); CreateButton(giCtrl_Import, IDB_Button_Import, ge::SPos(292 + 64, 400), false); tchar psz[1024]; CKSPlugIn* pPlugIn = dynamic_cast<CKSPlugIn*>(GetPlugIn()); //IFile::GetSystemDirectory(IFile::SystemDirDesktop, psz); pPlugIn->GetDefaultProjectFolder(psz); BrowseToDir(std::string(psz)); dynamic_cast<CKSPlugIn*>(GetGUI()->GetPlugIn())->SetPreviewCallback(dynamic_cast<CPreviewCallback*>(this)); ge::IText* pText = CreateDisplay(giControlType, ge::SPos(96, 333+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false); pText->SetHorzAlignment(ge::IText::HorzAlignLeft); pText = CreateDisplay(giControlBitDepth, ge::SPos(96, 347+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false); pText->SetHorzAlignment(ge::IText::HorzAlignLeft); pText = CreateDisplay(giControlSampleRate, ge::SPos(96, 361+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false); pText->SetHorzAlignment(ge::IText::HorzAlignLeft); pText = CreateDisplay(giControlChannels, ge::SPos(96, 375+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false); pText->SetHorzAlignment(ge::IText::HorzAlignLeft); } // Init
//{{{ GetManifestor //{{{ doxynote /// \brief access a manifestor - or create a new one if it doesn't exist /// \return Havana status code, HavanaNoError indicates success. //}}} HavanaStatus_t HavanaPlayer_c::GetManifestor (char* Media, char* Encoding, unsigned int SurfaceId, class Manifestor_c** Manifestor) { HavanaStatus_t Status = HavanaNoError; HavanaDisplay_c* Display = NULL; HAVANA_DEBUG("%s: %d\n", Media, SurfaceId); Status = CreateDisplay (Media, SurfaceId, &Display); if (Status != HavanaNoError) return Status; Status = Display->GetManifestor (this, Media, Encoding, SurfaceId, Manifestor); if (Status != HavanaNoError) DeleteDisplay (Media, SurfaceId); return Status; }
void CBitCrunchPane::Init() { mpPane = ge::IPane::Create(); mpPane->SetSize(ge::SSize(222, 106)); // BackDrop CreateBitmap(ge::IControl::giNoID, IDB_BitCrush, ge::SPos(0, 0)); tint32 iX = 18; // Bits CreateDisplay( giCtrl_Bit_Display, ge::SPos(iX, 86), ge::SSize(32, 12), CreateFont(Generic128, IDB_Scripto_Tight, ge::SRGB(0, 255, 0))); iX += 6; CreateKnob(giCtrl_Bit, IDB_BC_Dial, ge::SPos(iX, 52), 65); iX += 64; // Sample Rate CreateDisplay( giCtrl_SR_Display, ge::SPos(iX+4, 86), ge::SSize(32, 12), CreateFont(Generic128, IDB_Scripto_Tight, ge::SRGB(0, 255, 0))); iX += 6; CreateKnob(giCtrl_SR, IDB_BC_Dial, ge::SPos(iX, 52), 65); iX += 64; // Mix CreateDisplay( giCtrl_Mix_Display, ge::SPos(iX, 86), ge::SSize(32, 12), CreateFont(Generic128, IDB_Scripto_Tight, ge::SRGB(0, 255, 0))); iX += 6; CreateKnob(giCtrl_Mix, IDB_BC_Dial, ge::SPos(iX, 52), 65); }
void OBSQTDisplay::resizeEvent(QResizeEvent *event) { QWidget::resizeEvent(event); CreateDisplay(); if (isVisible() && display) { QSize size = GetPixelSize(this); obs_display_resize(display, size.width(), size.height()); } emit DisplayResized(); }
void CTrack_Info_Small::Init() { // Create the main pane mpPane = ge::IPane::Create(); mpPane->SetSize(gTrack_Info_Small); // Dummy mpSmall_Back_Drop = CreateBitmap(ge::IControl::giNoID, IDB_Back_Track_Info_Small, ge::SPos(0, 0)); mpSmall_Selected_Back_Drop = CreateBitmap(ge::IControl::giNoID, IDB_Back_Track_Info_Small_Selected, ge::SPos(0, 0)); // Hide selection backdrop mpSmall_Selected_Back_Drop->SetVisible(false); //-------------------------------------------- // Text label ge::IText* pText = CreateDisplay( giTrack_Info_Small_Channel_Text+ miCtrl_Offset, ge::SPos(5, 24), ge::SSize(118, 10), CreateFont(Generic128, IDB_Font_Minix_Tight, ge::SRGB(204, 204, 204)), true); pText->SetHorzAlignment(ge::IText::HorzAlignLeft); pText->SetClicksOutsideAsSuccess(); // Expand button ge::IMultiStateButton* pButton = Create2StateButton(giTrack_Info_Small_Expand_Button + miCtrl_Offset, IDB_Button_Expand, ge::SPos(2, 4), true); pButton->SetEventMouseUp(); // Arm button Create2StateButton(giTrack_Info_Small_Arm_Button + miCtrl_Offset, IDB_Button_Arm_Horizontal, ge::SPos(68, 4), true); // Mute button Create2StateButton(giTrack_Info_Small_Mute_Button + miCtrl_Offset, IDB_Button_Mute_Horizontal, ge::SPos(68+19, 4), true); //Solo Button Create2StateButton(giTrack_Info_Small_Solo_Button + miCtrl_Offset, IDB_Button_Solo_Horizontal, ge::SPos(68+19+18, 4), true); // Output meter, Left mpMeterOutL = CreatePeakMeter(ge::IControl::giNoID, ge::SPos(30, 6), 33, ge::IPeakMeter::Right); FindPane(mpMeterOutL)->CreateBitmap(ge::IControl::giNoID, IDB_Meter_Off_Top, ge::SPos(0, 0)); // Output meter, Right mpMeterOutR = CreatePeakMeter(ge::IControl::giNoID, ge::SPos(30, 12), 33, ge::IPeakMeter::Right); FindPane(mpMeterOutR)->CreateBitmap(ge::IControl::giNoID, IDB_Meter_Off_Bottom, ge::SPos(0, 0)); // Mouse-trap for activation of track - must be last to have effect mpMouseTrap = ge::IMouseTrap::Create(); mpMouseTrap->EnableOneTrap(ge::MouseDrag, true, true); mpMouseTrap->EnableOneTrap(ge::MouseDrop, true, true); mpPane->AddControl(mpMouseTrap, ge::SPos(0, 0)); mpMouseTrap->CloneRect(GetPane()); mpMouseTrap->AddListener(this); }
///---------------------------------------------------------------------------- ///Initializes this GraphicsApp instance ///---------------------------------------------------------------------------- bool GraphicsApp::InitInstance(HANDLE hInstance, LPCTSTR lpCmdLine, int iCmdShow) { if(!CreateDisplay()) { ShutDown(); return false; } //initilizes the graphics device InitGraphics(); //Initializes the data InitData(); return true; }
//----------------------------------------------------------------------------- // Name : InitInstance () // Desc : Initializes the entire Engine here. //----------------------------------------------------------------------------- bool CGameApp::InitInstance( LPCTSTR lpCmdLine, int iCmdShow ) { // Create the primary display device if (!CreateDisplay()) { ShutDown(); return false; } m_pBBuffer = new BackBuffer(m_hWnd, m_nViewWidth, m_nViewHeight); if(!m_imgBackground.LoadBitmapFromFile("data/background2.bmp", GetDC(m_hWnd))) return false; m_imgBackground.SetFilter(new CBoxFilter()); m_imgBackground.Resample(m_nViewWidth, m_nViewHeight); // Success! return true; }
//----------------------------------------------------------------------------- // Name : InitInstance () // Desc : Initialises the entire Engine here. //----------------------------------------------------------------------------- bool CDDGameApp::InitInstance( HANDLE hInstance, LPCTSTR lpCmdLine, int iCmdShow ) { // Create the primary display device if (!CreateDisplay()) { ShutDown(); return false; } // Build Objects if (!BuildSprites()) { ShutDown(); return false; } // Set up all required game states SetupGameState(); // Setup our rendering environment //SetupRenderStates(); // Success! return true; }
void Init( void ) { rdState.valid = true; RegisterCvars(); CreateDisplay(); glewExperimental = GL_TRUE; GLenum error = glewInit(); if ( error != GLEW_OK ) { throw( XSError( String::Format( "Failed to initialise GLEW: %s\n", glewGetErrorString( error ) ).c_str() ) ); } #ifdef RENDERER_DEBUG_OUTPUT if ( GLEW_ARB_debug_output ) { glEnable( GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB ); glDebugMessageCallbackARB( OnGLError, nullptr ); } #endif Backend::Init(); //FIXME: make these TextureManager/ShaderManager? Texture::Init(); ShaderProgram::Init(); #ifdef FBO_COMPOSITE // create composite shader static const VertexAttribute attributes[] = { { 0, "in_Position" }, { 1, "in_TexCoord" }, { 2, "in_Colour" }, }; if ( !compositeShader ) { compositeShader = new ShaderProgram( "composite", "composite", attributes, ARRAY_LEN( attributes ) ); } #endif Font::Init(); RenderCommand::Init(); glViewport( 0, 0, rdState.window.width, rdState.window.height ); }
int show_images(Fg_Struct *fg, int *nr, int num_imgs, int w, int h) { #if SHOW_DISP int i; int disp; unsigned long *img; disp = CreateDisplay(8, w, h); SetBufferWidth(disp, w, h); for(i = 0; i < num_imgs; i++) { if(nr[i] > FG_OK) { img = Fg_getImagePtr(fg, nr[i], PORT_A); DrawBuffer(disp, img, nr[i], "SimpleTiming"); Sleep(PAUSE); } } CloseDisplay(disp); #endif return FG_OK; }
void CKSAUXGUIPane::Init() { mpPane = ge::IPane::Create(); //mpPane->SetBackgroundColour(ge::SRGB(0, 0, 0)); mpPane->SetSize(gAUX); //------------------------------- // Backdrop for AUX CreateBitmap(ge::IControl::giNoID, IDB_Back_AUX, ge::SPos(0, 0)); //------------------------------- //-------------------------------- // ECHO //-------------------------------- Create2StateButton(giCtrl_Delay_Power, IDB_Button_Power, ge::SPos(25, 36), true); tint32 iX = 154+126; tint32 iY = 75; // Delay time CreateKnob(giCtrl_Delay_Time, IDB_Dial_Medium, ge::SPos(iX, iY), 65); iX += 64; CreateDisplay( giCtrl_Delay_Time_Display, ge::SPos(184, 65), ge::SSize(56, 12), CreateFont(Generic128, IDB_Font_Axel_Tight, ge::SRGB(0, 180, 0))); // Predlay CreateKnob(giCtrl_Delay_Feedback, IDB_Dial_Medium, ge::SPos(iX, iY), 65); iX += 64; CreateDisplay( giCtrl_Delay_Feedback_Display, ge::SPos(184, 77), ge::SSize(56, 12), CreateFont(Generic128, IDB_Font_Axel_Tight, ge::SRGB(0, 180, 0))); // Lo Filt CreateKnob(giCtrl_Delay_LP_Dampning, IDB_Dial_Medium, ge::SPos(iX, iY), 65); iX += 64; CreateDisplay( giCtrl_Delay_LP_Dampning_Display, ge::SPos(184, 89), ge::SSize(56, 12), CreateFont(Generic128, IDB_Font_Axel_Tight, ge::SRGB(0, 180, 0))); // High Filt CreateKnob(giCtrl_Delay_HP_Dampning, IDB_Dial_Medium, ge::SPos(iX, iY), 65); iX += 64; CreateDisplay( giCtrl_Delay_HP_Dampning_Display, ge::SPos(184, 101), ge::SSize(56, 12), CreateFont(Generic128, IDB_Font_Axel_Tight, ge::SRGB(0, 180, 0))); // Output meter, Left mpEcho_MeterOutL = CreatePeakMeter(ge::IControl::giNoID, ge::SPos(534, 151-88), 47, ge::IPeakMeter::Up); FindPane(mpEcho_MeterOutL)->CreateBitmap(ge::IControl::giNoID, IDB_Meter_Off_Left_AUX, ge::SPos(0, 0)); // Output meter, Right mpEcho_MeterOutR = CreatePeakMeter(ge::IControl::giNoID, ge::SPos(541, 151-88), 47, ge::IPeakMeter::Up); FindPane(mpEcho_MeterOutR)->CreateBitmap(ge::IControl::giNoID, IDB_Meter_Off_Right_AUX, ge::SPos(0, 0)); //-------------------------------- // REVERB //-------------------------------- Create2StateButton(giCtrl_Reverb_Power, IDB_Button_Power, ge::SPos(25, 124), true); iX = 152; iY = 165; // Reverb Size CreateKnob(giCtrl_Reverb_Size, IDB_Dial_Medium, ge::SPos(iX, iY), 65); iX += 64; // Predlay CreateKnob(giCtrl_Reverb_PDelay, IDB_Dial_Medium, ge::SPos(iX, iY), 65); iX += 64; // Damping CreateKnob(giCtrl_Reverb_Damp, IDB_Dial_Medium, ge::SPos(iX, iY), 65); iX += 64; // Reverb CreateKnob(giCtrl_Reverb_Panorama, IDB_Dial_Medium, ge::SPos(iX, iY), 65); iX += 64; // Reverb CreateKnob(giCtrl_Reverb_Color1, IDB_Dial_Medium, ge::SPos(iX, iY), 65); iX += 64; // Reverb CreateKnob(giCtrl_Reverb_Color2, IDB_Dial_Medium, ge::SPos(iX, iY), 65); iX += 64; // Output meter, Left mpReverb_MeterOutL = CreatePeakMeter(ge::IControl::giNoID, ge::SPos(534, 153), 47, ge::IPeakMeter::Up); FindPane(mpReverb_MeterOutL)->CreateBitmap(ge::IControl::giNoID, IDB_Meter_Off_Left_AUX, ge::SPos(0, 0)); // Output meter, Right mpReverb_MeterOutR = CreatePeakMeter(ge::IControl::giNoID, ge::SPos(541, 153), 47, ge::IPeakMeter::Up); FindPane(mpReverb_MeterOutR)->CreateBitmap(ge::IControl::giNoID, IDB_Meter_Off_Right_AUX, ge::SPos(0, 0)); }
Boolean PreLoadCube (int dsp, char *ptr, float min, float max, Boolean str, Boolean setworld) /*********************************************************************** * *_Title PreLoadCube - Calculates auto stretch and creates display * *_Args Type Variable I/O Description *_Parm int dsp I Display number *_Parm char *ptr I File name of image *_Parm float min I Minimum value for stretch *_Parm float max I Maximum value for stretch *_Parm Boolean str I If True, calculate stretch * If False, don't calculate stretch *_Parm Boolean setworld * *_DESC Pre stretch image and create display. If successful it * will load the "f" structure associated with the display and * return False. If an error occurs it will return True. * * *_HIST Jan 1 1996 Jeff Anderson, Original version * Apr 25 1997 Tracie Sucharski, Allow display of more than * one image on the TAE command line and allow * min/max values to be entered on command line. * Jan 14 1998 TLS, Print error message if file can't be opened. * Mar 24 1998 TLS, Copy original min/max values to actual * min/max values. * Dec 15 2001 Janet Barrett, Modified to work with the pc2d * program. *_END ************************************************************************/ { int i; static int firstime=2; DSPINFO *d; GBLdsp.free = dsp; if (OpenCube (dsp,ptr)) { sprintf (GBLerr.string,"%s can not be opened",ptr); u_error ("OPENERR",GBLerr.string,-1,1); return True; } GBLdsp.used[dsp] = True; GBLdsp.linked[dsp] = True; d = &GBLdsp.d[dsp]; d->band[0] = 1; d->band[1] = 0; d->band[2] = 0; d->scs_sl = 1; d->scs_ss = 1; d->scs_el = d->f.nl; d->scs_es = d->f.ns; for (i=0; i<MAX_BANDS; i++) d->avalid[i] = False; if (str) { d->autostr = True; d->manstr = False; d->prestr_minper = GBLdefault.prestr_lowper; d->prestr_maxper = GBLdefault.prestr_hiper; QviewWatch (xinfo.topShell,True); CalcAutoStr (dsp); QviewWatch (xinfo.topShell,False); /* else { d->autostr = False; d->manstr = True; d->rmin = min; d->rmax = max; d->gmin = 0; d->gmax = 255; d->bmin = 0; d->bmax = 255; d->rmin_real = d->rmin; d->rmax_real = d->rmax; d->gmin_real = d->gmin; d->gmax_real = d->gmax; d->bmin_real = d->bmin; d->bmax_real = d->bmax; }*/ } if (!str) { for (i=0;i<3;i++) d->avalid[i] = False; XSync(xinfo.display,False); CalcAutoStr(dsp); StretchReset (dsp); } LoadStrLut (dsp); if (firstime) { CreateDisplay (); firstime = firstime - 1; } else { if (setworld) { d->world = True; d->ss = d->scs_ss; d->sl = d->scs_sl; d->inc = ((double) (d->scs_el-d->scs_sl+1))/340.0; if ((d->scs_es-d->scs_ss+1)>(d->scs_el-d->scs_sl+1)) d->inc = ((double) (d->scs_es-d->scs_ss+1))/340.0; } d->read_tmp = False; LoadCube (dsp); } return False; }
int main(int argc, char* argv[]) #endif { #ifdef _XBOX int argc = 1; char *argv[] = {"default.xbe"}; #endif g_argc = argc; g_argv = argv; /* Set up arch hooks first. This may set up crash handling. */ HOOKS = MakeArchHooks(); CString g_sErrorString = ""; #if !defined(DEBUG) /* Always catch RageExceptions; they should always have distinct strings. */ try { /* RageException */ /* Tricky: for other exceptions, we want a backtrace. To do this in Windows, * we need to catch the exception and force a crash. The call stack is still * there, and gets picked up by the crash handler. (If we don't catch it, we'll * get a generic, useless "abnormal termination" dialog.) In Linux, if we do this * we'll only get main() on the stack, but if we don't catch the exception, it'll * just work. So, only catch generic exceptions in Windows. */ #if defined(_WINDOWS) try { /* exception */ #endif #endif /* Almost everything uses this to read and write files. Load this early. */ FILEMAN = new RageFileManager( argv[0] ); FILEMAN->MountInitialFilesystems(); /* Set this up next. Do this early, since it's needed for RageException::Throw. */ LOG = new RageLog(); /* Whew--we should be able to crash safely now! */ // // load preferences and mount any alternative trees. // PREFSMAN = new PrefsManager; ApplyLogPreferences(); WriteLogHeader(); /* Set up alternative filesystem trees. */ if( PREFSMAN->m_sAdditionalFolders != "" ) { CStringArray dirs; split( PREFSMAN->m_sAdditionalFolders, ",", dirs, true ); for( unsigned i=0; i < dirs.size(); i++) FILEMAN->Mount( "dir", dirs[i], "" ); } if( PREFSMAN->m_sAdditionalSongFolders != "" ) { CStringArray dirs; split( PREFSMAN->m_sAdditionalSongFolders, ",", dirs, true ); for( unsigned i=0; i < dirs.size(); i++) FILEMAN->Mount( "dir", dirs[i], "Songs" ); } MountTreeOfZips( ZIPS_DIR ); /* One of the above filesystems might contain files that affect preferences, eg Data/Static.ini. * Re-read preferences. */ PREFSMAN->ReadGlobalPrefsFromDisk(); ApplyLogPreferences(); #if defined(HAVE_SDL) SetupSDL(); #endif /* This needs PREFSMAN. */ Dialog::Init(); // // Create game objects // GAMESTATE = new GameState; /* This requires PREFSMAN, for PREFSMAN->m_bShowLoadingWindow. */ LoadingWindow *loading_window = MakeLoadingWindow(); if( loading_window == NULL ) RageException::Throw( "Couldn't open any loading windows." ); loading_window->Paint(); srand( time(NULL) ); // seed number generator /* Do this early, so we have debugging output if anything else fails. LOG and * Dialog must be set up first. It shouldn't take long, but it might take a * little time; do this after the LoadingWindow is shown, since we don't want * that to appear delayed. */ HOOKS->DumpDebugInfo(); #if defined(HAVE_TLS) LOG->Info( "TLS is %savailable", RageThread::GetSupportsTLS()? "":"not " ); #endif if( PREFSMAN->m_bFirstRun ) OnFirstRun(); CheckSettings(); GAMEMAN = new GameManager; THEME = new ThemeManager; ANNOUNCER = new AnnouncerManager; NOTESKIN = new NoteSkinManager; /* Set up the theme and announcer. */ ReadGamePrefsFromDisk(); if( PREFSMAN->m_iSoundWriteAhead ) LOG->Info( "Sound writeahead has been overridden to %i", PREFSMAN->m_iSoundWriteAhead ); SOUNDMAN = new RageSoundManager; SOUNDMAN->Init( PREFSMAN->GetSoundDrivers() ); SOUNDMAN->SetPrefs( PREFSMAN->m_fSoundVolume ); SOUND = new GameSoundManager; BOOKKEEPER = new Bookkeeper; LIGHTSMAN = new LightsManager(PREFSMAN->m_sLightsDriver); INPUTFILTER = new InputFilter; INPUTMAPPER = new InputMapper; INPUTQUEUE = new InputQueue; SONGINDEX = new SongCacheIndex; BANNERCACHE = new BannerCache; /* depends on SONGINDEX: */ SONGMAN = new SongManager(); SONGMAN->InitAll( loading_window ); // this takes a long time CRYPTMAN = new CryptManager; // need to do this before ProfileMan MEMCARDMAN = new MemoryCardManager; PROFILEMAN = new ProfileManager; PROFILEMAN->Init(); // must load after SONGMAN UNLOCKMAN = new UnlockSystem; NSMAN = new NetworkSyncManager( loading_window ); delete loading_window; // destroy this before init'ing Display ProcessArgsFirst(); DISPLAY = CreateDisplay(); DISPLAY->ChangeCentering( PREFSMAN->m_iCenterImageTranslateX, PREFSMAN->m_iCenterImageTranslateY, PREFSMAN->m_fCenterImageScaleX, PREFSMAN->m_fCenterImageScaleY ); TEXTUREMAN = new RageTextureManager(); TEXTUREMAN->SetPrefs( RageTextureManagerPrefs( PREFSMAN->m_iTextureColorDepth, PREFSMAN->m_iMovieColorDepth, PREFSMAN->m_bDelayedTextureDelete, PREFSMAN->m_iMaxTextureResolution, PREFSMAN->m_bForceMipMaps ) ); MODELMAN = new ModelManager; MODELMAN->SetPrefs( ModelManagerPrefs( PREFSMAN->m_bDelayedModelDelete ) ); StoreActualGraphicOptions( true ); SONGMAN->PreloadSongImages(); /* This initializes objects that change the SDL event mask, and has other * dependencies on the SDL video subsystem, so it must be initialized after DISPLAY. */ INPUTMAN = new RageInput; // These things depend on the TextureManager, so do them after! FONT = new FontManager; SCREENMAN = new ScreenManager; /* People may want to do something else while songs are loading, so do * this after loading songs. */ BoostAppPri(); ResetGame(); CodeDetector::RefreshCacheItems(); /* Initialize which courses are ranking courses here. */ SONGMAN->UpdateRankingCourses(); /* Run the second argcheck, you can do your other options here */ ProcessArgsSecond(); /* Run the main loop. */ GameLoop(); PREFSMAN->SaveGlobalPrefsToDisk(); SaveGamePrefsToDisk(); #if !defined(DEBUG) } catch( const RageException &e ) { /* Gracefully shut down. */ g_sErrorString = e.what(); } #endif SAFE_DELETE( SCREENMAN ); SAFE_DELETE( NSMAN ); /* Delete INPUTMAN before the other INPUTFILTER handlers, or an input * driver may try to send a message to INPUTFILTER after we delete it. */ SAFE_DELETE( INPUTMAN ); SAFE_DELETE( INPUTQUEUE ); SAFE_DELETE( INPUTMAPPER ); SAFE_DELETE( INPUTFILTER ); SAFE_DELETE( MODELMAN ); SAFE_DELETE( PROFILEMAN ); // PROFILEMAN needs the songs still loaded SAFE_DELETE( UNLOCKMAN ); SAFE_DELETE( CRYPTMAN ); SAFE_DELETE( MEMCARDMAN ); SAFE_DELETE( SONGMAN ); SAFE_DELETE( BANNERCACHE ); SAFE_DELETE( SONGINDEX ); SAFE_DELETE( SOUND ); /* uses GAMESTATE, PREFSMAN */ SAFE_DELETE( PREFSMAN ); SAFE_DELETE( GAMESTATE ); SAFE_DELETE( GAMEMAN ); SAFE_DELETE( NOTESKIN ); SAFE_DELETE( THEME ); SAFE_DELETE( ANNOUNCER ); SAFE_DELETE( BOOKKEEPER ); SAFE_DELETE( LIGHTSMAN ); SAFE_DELETE( SOUNDMAN ); SAFE_DELETE( FONT ); SAFE_DELETE( TEXTUREMAN ); SAFE_DELETE( DISPLAY ); Dialog::Shutdown(); SAFE_DELETE( LOG ); SAFE_DELETE( FILEMAN ); #if !defined(DEBUG) && defined(_WINDOWS) } catch( const exception &e ) { /* This can be things like calling std::string::reserve(-1), or out of memory. * This can also happen if we throw a RageException during a ctor, in which case * we want a crash dump. */ FAIL_M( e.what() ); } #endif if( g_sErrorString != "" ) HandleException( g_sErrorString ); SAFE_DELETE( HOOKS ); #ifndef _XBOX return 0; #endif }
void CMix_Buss::Init() { // Create the main pane mpPane = ge::IPane::Create(); mpPane->SetSize(gMix_Bus); mpPane->SetBackgroundColour(ge::SRGB(200,200,200)); // Top label CreateBitmap(ge::IControl::giNoID, IDB_Back_Mix_Buss_Lable, ge::SPos(0, 0)); //-------------------------------------------- // Text label ge::IText* pText = CreateDisplay( giCtr_Mix_Buss_Text+ miCtrl_Offset, ge::SPos(8, 24), ge::SSize(48, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(204, 204, 204)), true); pText->SetHorzAlignment(ge::IText::HorzAlignLeft); pText->SetClicksOutsideAsSuccess(); char psz[32]; sprintf(psz, "Bus %d", miID+1); pText->SetText(psz); //-------------------------------------------- // Track Aux/ Insert setup mpMix_Buss_AUX_Insert = new CMix_Buss_AUX_Insert(this, GetGUI()); mpMix_Buss_AUX_Insert->SetInfo(miID, miTimerID); mpMix_Buss_AUX_Insert->Init(); mpPane->AddControl(mpMix_Buss_AUX_Insert->GetPane(), ge::SPos(0, 54)); // Byttom part with slider CreateBitmap(ge::IControl::giNoID, IDB_Back_Mix_Buss_Volume, ge::SPos(0, 184)); // mpSelected_Back_Drop = CreateBitmap(ge::IControl::giNoID, IDB_Back_Track_Info_Big_Selected, ge::SPos(0, 0)); // mpSelected_Back_Drop->SetVisible(false); // Show insert button Create2StateButton(giCtr_Mix_Buss_Show_Insert_Button + miCtrl_Offset, IDB_Button_AUX_Insert, ge::SPos(36, 0), true); PreparePopups(); CreatePop(giCtr_Mix_Buss_Output_Popup+ miCtrl_Offset, IDB_Invisible_Button_16_64, mpOutput_Menu, ge::SPos(3, 255)); // Volume slider & display CreateSlider(giCtr_Mix_Buss_Volume_Slider + miCtrl_Offset, ge::SPos(88-64 , 21+184),ge::SSize(16,110), IDB_Slider_Handle_Volume); CreateDisplay( giCtr_Mix_Buss_Volume_Slider_Display + miCtrl_Offset, ge::SPos(4, 350), ge::SSize(56, 12), CreateFont(Generic128, IDB_AxelTight, ge::SRGB(0, 255, 0))); Create2StateButton(giCtr_Mix_Buss_Arm_Button + miCtrl_Offset, IDB_Button_Arm_Vertical, ge::SPos(3, 102+184), true); Create2StateButton(giCtr_Mix_Buss_Mute_Button + miCtrl_Offset, IDB_Button_Mute_Vertical, ge::SPos(3,102+16+184), true); Create2StateButton(giCtr_Mix_Buss_Solo_Button + miCtrl_Offset, IDB_Button_Solo_Vertical, ge::SPos(3,102+16+15+184), true); // Output meter, Left mpMeterOutL = CreatePeakMeter(ge::IControl::giNoID, ge::SPos(46, 215), 120, ge::IPeakMeter::Up); FindPane(mpMeterOutL)->CreateBitmap(ge::IControl::giNoID, IDB_Meter_Off_Left, ge::SPos(0, 0)); // Output meter, Right mpMeterOutR = CreatePeakMeter(ge::IControl::giNoID, ge::SPos(54, 215), 120, ge::IPeakMeter::Up); FindPane(mpMeterOutR)->CreateBitmap(ge::IControl::giNoID, IDB_Meter_Off_Right, ge::SPos(0, 0)); //mpPan = CreatePanner(giCtrl_Lopp_Start, ge::IControl::giNoID, NULL, IDB_Button_Pan_Handle, ge::SPos(3, 188), ge::SPos(0, 0), ge::SSize(59, 0), NULL); //mpPan->SetDirectMouseXlat(); // Panner CreatePanner( giCtr_Mix_Buss_Pan + miCtrl_Offset, ge::IControl::giNoID, NULL, IDB_Button_Pan_Handle, ge::SPos(3, 188), ge::SPos(0, 0), ge::SSize(59, 0), NULL ); // pPanner->SetDirectMouseXlat(true); // pPanner->SetJumpToMouseClickPos(true); }
void CKSExportForWebGUIPane::Init() { mpPlugIn = dynamic_cast<CKSPlugIn*>(GetPlugIn()); mpPane = ge::IPane::Create(); mpPane->SetSize(ge::SSize(541,582)); //------------------------------- // Backdrop for Export CreateBitmap(ge::IControl::giNoID, IDB_Back_Export_For_Web, ge::SPos(0, 0)); ge::SPos pos(160,30); // URL mpTextUrl = CreateDisplay( giCtrl_CC_License_URL_Txt, pos, ge::SSize(344, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), true); mpTextUrl->SetHorzAlignment(ge::IText::HorzAlignLeft); mpTextUrl->SetClicksOutsideAsSuccess(); // Author pos.iY += 20; mpTextAuthor = CreateDisplay( giCtrl_CC_License_Author_Txt, pos, ge::SSize(344, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), true); mpTextAuthor->SetHorzAlignment(ge::IText::HorzAlignLeft); mpTextAuthor->SetClicksOutsideAsSuccess(); // Status pos.iY += 20; mpTextStatus = CreateDisplay( giCtrl_CC_License_Status_Txt, pos, ge::SSize(344, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), true); mpTextStatus->SetHorzAlignment(ge::IText::HorzAlignLeft); mpTextStatus->SetClicksOutsideAsSuccess(); // Create2StateButton(giCtrl_Delay_Power, IDB_Button_Power, ge::SPos(25, 36), true); pos.iX = 32; pos.iY = 132; mpSetup_Radio_Button = CreateRadioButtonsGroup(giCtrl_CC_License_Radio_Button, ge::SPos(0,0) ); // Account button CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true); pos.iY += 84; CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true); pos.iY += 84; CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true); pos.iY = 132; pos.iX = 226; CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true); pos.iY += 84; CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true); pos.iY += 84; CreateRadioButton(ge::IControl::giNoID, IDB_Button_Radio, pos, mpSetup_Radio_Button, true); pos.iY = 162; pos.iX = 60; ge::SSize UrlSize(200, 18); // BY mpBY_URL = ge::IURL::Create(); mpBY_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[0]); mpBY_URL->SetSize(UrlSize); // mpBY_URL->ActivateHandCursor(); mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_URL), pos); pos.iY += 84; //BY SA mpBY_SA_URL = ge::IURL::Create(); mpBY_SA_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[1]); mpBY_SA_URL->SetSize(UrlSize); mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_SA_URL), pos); pos.iY += 84; //BY ND mpBY_SA_URL = ge::IURL::Create(); mpBY_SA_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[2]); mpBY_SA_URL->SetSize(UrlSize); mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_SA_URL), pos); pos.iY = 162; pos.iX = 250; // BY NC mpBY_URL = ge::IURL::Create(); mpBY_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[3]); mpBY_URL->SetSize(UrlSize); // mpBY_URL->ActivateHandCursor(); mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_URL), pos); pos.iY += 84; //BY NC SA mpBY_SA_URL = ge::IURL::Create(); mpBY_SA_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[4]); mpBY_SA_URL->SetSize(UrlSize); mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_SA_URL), pos); pos.iY += 84; //BY NC ND mpBY_SA_URL = ge::IURL::Create(); mpBY_SA_URL->Init(ge::IControl::giNoID, mpPlugIn->mapszLicenseUrls[5]); mpBY_SA_URL->SetSize(UrlSize); mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_SA_URL), pos); pos.iY = 563; pos.iX = 45; //Creative Commons mpBY_SA_URL = ge::IURL::Create(); mpBY_SA_URL->Init(ge::IControl::giNoID,(tchar*)"http://creativecommons.org/"); mpBY_SA_URL->SetSize(UrlSize); mpPane->AddControl(dynamic_cast<ge::IControl*>(mpBY_SA_URL), pos); Prepare_Popups(); // Compression ge::IDropDownListBox* pPop = CreatePop( giCtrl_Export_Compression_Popup, IDB_Button_Popup, mpCompression_Popup, ge::SPos(364, 521), mpPane); pPop->SetValue(meQuality); // Cancel / Export CreateButton(giCtrl_Cancel_ExportForWeb, IDB_Button_Cancel, ge::SPos(402, 550), false); CreateButton(giCtrl_ExportForWeb, IDB_Button_Export, ge::SPos(402+68, 550), false); mpLicense =CreateBitmapVU(ge::IControl::giNoID, IDB_License, ge::SPos(27, 368), 6); mpLicense->SetFrame(0); } // Init
void CRegion_GUI::Init() { // Create the main pane mpPane = ge::IPane::Create(); ge::SSize Size(miSize_X, miSize_Y ? giTrack_Size_Big-1: giTrack_Size_Small-1); mpPane->SetSize(Size); mpPane->SetAutomaticResize(true, ge::IControl::ResizeAbsoluteY ); // Small background mpRegion_Back_Small =CreateBitmapVU(ge::IControl::giNoID, IDB_Back_Region_Small, ge::SPos(0, 0), 11); mpRegion_Back_Small->SetSize(ge::SSize(miSize_X,giTrack_Size_Small-1)); mpRegion_Back_Small->SetAutomaticResize(true, ge::IControl::ResizeAbsoluteX); mpRegion_Back_Small->SetFrame(miColor); // Big background mpRegion_Back_Big =CreateBitmapVU(ge::IControl::giNoID, IDB_Back_Region_Big, ge::SPos(0, 0), 11); mpRegion_Back_Big->SetSize(ge::SSize(miSize_X,giTrack_Size_Big-1)); mpRegion_Back_Big->SetAutomaticResize(true, ge::IControl::ResizeAbsoluteX); mpRegion_Back_Big->SetFrame(miColor); mpLine_Start = CreateLine(ge::IControl::giNoID, ge::SPos(0,0), ge::SPos(0,giTrack_Size_Small-1) , ge::SRGB(128, 128, 128)); mpLine_End = CreateLine(ge::IControl::giNoID, ge::SPos(miSize_X-1,0), ge::SPos(miSize_X-1,giTrack_Size_Small-1) , ge::SRGB(128, 128, 128)); //-------------------------------------------- // Text label mpText = CreateDisplay( ge::IControl::giNoID, ge::SPos(2, 0), ge::SSize(118, 10), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(32, 32, 32)), false); mpText->SetHorzAlignment(ge::IText::HorzAlignLeft); mpText->SetText(mPsz); //-------------------------------------------- // Custom control mpControl = ge::ICustomControl::Create(); mpControl->Init(ge::IControl::giNoID, dynamic_cast<ge::ICustomControlCallback*>(this)); mpControl->SetSize(Size); mpPane->AddControl(dynamic_cast<ge::IControl*>(mpControl), ge::SPos(0, 0)); mpDrawPrimitives = ge::IDrawPrimitives::Create(); mpDrawPrimitives->Init(GetWindow()); //-------------------------------------------- // Volume mpRegion_Volume_Handle = new CTrack_Fade_Handle(this, GetGUI()); mpRegion_Volume_Handle->SetInfo(this, giRegion_Volume_Handle); mpRegion_Volume_Handle->Init(); mpPane->AddControl(mpRegion_Volume_Handle->GetPane(), ge::SPos(miSize_X-7, 30)); // Volume Line mpLine_Region_Volume = CreateLine(ge::IControl::giNoID, ge::SPos(miSize_X,0), ge::SPos(miSize_X,0) , ge::SRGB(0, 0, 0)); //-------------------------------------------- // Fade in mpFade_In_Handle = new CTrack_Fade_Handle(this, GetGUI()); mpFade_In_Handle->SetInfo(this, giFade_In_Handle); mpFade_In_Handle->Init(); mpPane->AddControl(mpFade_In_Handle->GetPane(), ge::SPos(0, 0)); // Line mpLine_Fade_In = CreateLine(ge::IControl::giNoID, ge::SPos(0,0), ge::SPos(0,0) , ge::SRGB(0, 0, 0)); //-------------------------------------------- // Fade out mpFade_Out_Handle = new CTrack_Fade_Handle(this, GetGUI()); mpFade_Out_Handle->SetInfo(this, giFade_Out_Handle); mpFade_Out_Handle->Init(); mpPane->AddControl(mpFade_Out_Handle->GetPane(), ge::SPos(miSize_X-7, 0)); // Line mpLine_Fade_Out = CreateLine(ge::IControl::giNoID, ge::SPos(miSize_X,0), ge::SPos(miSize_X,0) , ge::SRGB(0, 0, 0)); Update_Graphic(); }
void OBSQTDisplay::paintEvent(QPaintEvent *event) { CreateDisplay(); QWidget::paintEvent(event); }