Skip to content
Snippets Groups Projects
Select Git revision
  • 7c70c3b6e42c7558c8e5ac5c8c145e224f10acf7
  • master default protected
  • fix_Makefile.mingw#2
  • update_Makefile.mingw
  • fix_Makefile.mingw
  • fix_API_for_C_apps
  • fix_procinfo_mac
  • boinccmd_gpu_mode_always_until_sigterm
  • fgrp_osx_hotfix
  • fix_boinc_master@f8250782
  • eah_wrapper_improvements
  • diagnostics_win-hotfix
  • diagnostics_win-hotfix-old
  • current_fgrp_apps
  • testing_gw_apps
  • gw_app_darwin_15
  • current_brp_apps
  • current_brp_apps_android10
  • current_gfx_apps
  • current_server
  • current_gw_apps
  • previous_fgrp_apps
  • previous_gw_apps
  • testing_brp_apps
  • apps_FGRP3_1.07
  • apps_FGRP3_1.08
26 results

cs_prefs.cpp

Blame
  • WindowManager.h 1.41 KiB
    #ifndef WINDOWMANAGER_H_
    #define WINDOWMANAGER_H_
    
    #include <iostream>
    #include <string>
    #include <list>
    #include <cassert>
    
    #include <SDL.h>
    
    #include <util.h>
    
    #include "AbstractGraphicsEngine.h"
    
    using namespace std;
    
    class WindowManager
    {
    public:
    	WindowManager();
    	virtual ~WindowManager();
    	
    	bool initialize(const int width = 1024, const int height = 768);
    	void registerEventObserver(AbstractGraphicsEngine *engine);
    	void unregisterEventObserver(AbstractGraphicsEngine *engine);
    	void eventLoop();
    	
    	int windowWidth() const;
    	int windowHeight() const;
    	
    	void setWindowCaption(const string caption) const;
    	void setWindowIcon(const string filename) const;
    	void toggleFullscreen();
    
    private:
        // FIXME: work around static, otherwise event conflict when more than one instance
        static Uint32 timerCallbackRenderEvent(Uint32 interval, void *param);
        static Uint32 timerCallbackBOINCUpdateEvent(Uint32 interval, void *param);
        
        int m_DesktopWidth;
        int m_DesktopHeight;
        int m_DesktopBitsPerPixel;
        int m_CurrentWidth;
        int m_CurrentHeight;
        int m_WindowedWidth;
        int m_WindowedHeight;
        Uint32 m_VideoModeFlags;
        
        bool m_FullscreenModeAvailable;
        bool m_WindowedModeAvailable;
        
        SDL_Surface *m_DisplaySurface;
        
        enum EventCodes {
            RenderEvent,
            BOINCUpdateEvent
        };
        
        list<AbstractGraphicsEngine *> eventObservers;
    };
    
    #endif /*WINDOWMANAGER_H_*/