The continuing development of the legendary VBA gameboy advance emulator.
Go to file
Rafael Kitover 7a7a72f2bd Mac OS X HiDPI fixes + other misc
Use a high-res surface on HiDPI (e.g. retina) Macs for the OpenGL
renderer, and scale window accordingly. Also fix fullscreen toggle not
working in HiDPI mode. And some other stuff.

Aside from the .app not being linked statically, the app is now fully
functional on Mac and ready to ship.

Full change details:

* add -DDEBUG or -DNDEBUG based on CMAKE_BUILD_TYPE (-DNDEBUG for
  Release and -DDEBUG for Debug)

* properly search for homebrew/macports/fink directories, and only add
  them if they exist

* fix building with wx debug support, when available

* use explicit OpenGL context on Mac too for new versions of wx

* add main_frame pointer in GameArea back to MainFrame, and a
  SetMainFrame(MainFrame* parent) public method to set it in guinit

* add full support for reading and writing double value config options
  (the GUI still needs to be updated for options that can take doubles,
  such as video_scale)

* change video_scale option (Display/Scale) to a double, putting a
  double value such as 3.6 in the config file works correctly

* add a HiDPIAware mixin class for GameArea and DrawingPanel, with the
  method HiDPIScaleFactor which returns the current window's
  backingScaleFactor

* change the GameArea sizing methods (DelBorder(), AdjustMinSize() and
  AdjustSize()) to divide the window size by the
  HiDPIAware::HiDPIScaleFactor so that the window is scaled properly

* change GameArea::ShowFullScreen to ignore fullscreen events for a
  maximized window on Mac, because maximized windows on OS X are
  actually native fullscreen windows

* change scale variables to double from int, and use std::ceil() to
  round scaled pixel or memory size values

* make a default base class DrawingPane::DrawingPanelInit() virtual
  method, call by all concrete class constructors based on the did_init
  flag

* call setWantsBestResolutionOpenGLSurface:YES on the view backing the
  wxGLCanvas for the OpenGL renderer (GLDrawingPanel) to get a high res
  OpenGL surface in HiDPI mode

* remove GLDrawingPanel::OnSize event, the OpenGL viewport resizes
  automatically without the need to call glViewport()

* do not hide the mouse pointer if the main frame has menus or dialogs
  open

* add variadic vbamDebug(const char* format, ...) function, active only
  #ifdef DEBUG, which sets the wx log target to STDERR and logs a
  message to it

* use full name of app "visualboyadvance-m" instead of "vbam" when
  getting configuration paths, this way the config is saved to
  ~/Library/Application Support/visualboyadvance-m rather than
  ~/Library/Application Support/vbam

* listen to the MENU_HIGHLIGHT_ALL event as well, as an extra way to
  check when the menus are open

* add public MainFrame::SetMenusOpened(bool state) method to force the
  main frame to change the internal menus_opened state, this is
  necessary because in HiDPI mode on Mac the keyboard accelerator for
  toggle fullscreen sends a menu open event, but not a menu close event,
  so on switch to fullscreen the state is changed to menus closed and
  the emu is unpaused

TODO:

* GUI option to change toggle fullscreen behavior between native and
  non-native fullscreen on Mac

* GUI support for double config values like Display/Scale

* add HiDPI support to simple renderer

* fix SDL sound, or disable the option

* fix Cairo suport on Mac, or disable the option

* use dynamic_cast<> to implement GetWindow() for DrawingPanel instead
  of pure virtual method, likewise for Delete()

* link .app statically by default so it can be shipped

* add Homebrew formula
2016-10-22 05:47:27 -07:00
CMakeScripts <wip> Migration to SDL2 made possible by galtgendo, gtk changes to follow. 2015-11-18 21:34:38 -05:00
data Added the Official No-Intro Nintendo Gameboy Advance Number (Date) file for the release numbering. 2015-05-16 07:48:02 +00:00
dependencies@76e2d57b89 added submodule for dependencies. 2015-09-19 11:58:26 -04:00
doc Fix some lintian warnings. Patch by sergio-br2. 2015-05-29 22:11:38 +00:00
fex Some formating things 2016-07-31 19:55:24 -04:00
po Translation update https://www.transifex.com/projects/p/vba-m/ 2015-06-29 23:30:33 +10:00
project initial dump of the dependencies into trunk, may look to changing it into a git submodule later. 2015-06-10 20:08:42 -04:00
src Mac OS X HiDPI fixes + other misc 2016-10-22 05:47:27 -07:00
.clang-format Small change: make `.clang-format` use C++11 Standard 2016-08-08 13:42:19 -07:00
.gitignore Fix for T2 2016-08-08 19:23:08 -07:00
.gitmodules added submodule for dependencies. 2015-09-19 11:58:26 -04:00
CMakeLists.txt Mac OS X HiDPI fixes + other misc 2016-10-22 05:47:27 -07:00
todo.md Some formating and markdown changes (fingers crossed) 2016-07-31 19:52:56 -04:00