2003-09-25 16:20:34 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
2016-12-30 00:00:30 +00:00
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
2003-09-25 16:20:34 +00:00
|
|
|
// SSSS tt ee ee ll ll aa
|
|
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
// SS SS tt ee ll ll aa aa
|
|
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
|
|
//
|
2016-12-30 00:00:30 +00:00
|
|
|
// Copyright (c) 1995-2017 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
// and the Stella Team
|
2003-09-25 16:20:34 +00:00
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
2003-09-25 16:20:34 +00:00
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//============================================================================
|
|
|
|
|
2003-10-17 18:02:16 +00:00
|
|
|
#ifndef FRAMEBUFFER_HXX
|
|
|
|
#define FRAMEBUFFER_HXX
|
2003-09-25 16:20:34 +00:00
|
|
|
|
2008-12-12 15:51:07 +00:00
|
|
|
#include <map>
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2007-09-03 18:37:24 +00:00
|
|
|
class OSystem;
|
|
|
|
class Console;
|
2010-10-18 18:39:57 +00:00
|
|
|
class Settings;
|
2007-09-03 18:37:24 +00:00
|
|
|
|
|
|
|
namespace GUI {
|
|
|
|
class Font;
|
|
|
|
}
|
|
|
|
|
Added new rendering modes to FrameBufferSoft, which don't use dirty
rectangle merging. This makes the 'dirtyrects' option more relevant,
since now if it's turned off, dirty rectangles are not merged, and
the screen is updated with SDL_Flip() instead of SDL_UpdateRects().
This new functionality is very similar to how z26 works, but
experiments on my Linux system show it to be twice as fast on
average :) Dirty rectangle merging now defaults to off. I'm
leaving it in, since it benefits people in some cases. Basically,
non-dirty-rect support is optimal when many things are changing
onscreen at once, at the cost of more constant and generally slightly
higher CPU usage. Dirty-rect support is optimal at larger resolutions,
where it's usually at least twice as fast as without, but is suboptimal
at larger resolutions when lots of stuff is changing. At some point in
the future, maybe Stella itself can automatically switch modes depending
on which is faster at any point in time.
Added "[..]" previous directory functionality to BrowserWidget, the same
as already in the LauncherDialog. Thanks for Alex and Lou for the
reminder.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1197 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-10 17:04:34 +00:00
|
|
|
#include "EventHandler.hxx"
|
2008-06-19 12:01:31 +00:00
|
|
|
#include "Rect.hxx"
|
2013-05-09 14:22:34 +00:00
|
|
|
#include "Variant.hxx"
|
2014-05-12 23:34:25 +00:00
|
|
|
#include "FBSurface.hxx"
|
|
|
|
#include "TIASurface.hxx"
|
2017-07-26 22:33:39 +00:00
|
|
|
#include "TIAConstants.hxx"
|
2017-11-16 17:01:20 +00:00
|
|
|
#include "FrameBufferConstants.hxx"
|
2007-09-03 18:37:24 +00:00
|
|
|
#include "bspf.hxx"
|
2003-09-25 16:20:34 +00:00
|
|
|
|
2014-05-12 23:34:25 +00:00
|
|
|
// Contains all relevant info for the dimensions of a video screen
|
|
|
|
// Also takes care of the case when the image should be 'centered'
|
|
|
|
// within the given screen:
|
|
|
|
// 'image' is the image dimensions into the screen
|
|
|
|
// 'screen' are the dimensions of the screen itself
|
|
|
|
class VideoMode
|
|
|
|
{
|
|
|
|
friend class FrameBuffer;
|
|
|
|
|
|
|
|
public:
|
|
|
|
GUI::Rect image;
|
|
|
|
GUI::Size screen;
|
2014-09-01 21:17:33 +00:00
|
|
|
Int32 fsIndex;
|
2014-05-12 23:34:25 +00:00
|
|
|
uInt32 zoom;
|
|
|
|
string description;
|
|
|
|
|
|
|
|
public:
|
|
|
|
VideoMode();
|
2014-09-01 21:17:33 +00:00
|
|
|
VideoMode(uInt32 iw, uInt32 ih, uInt32 sw, uInt32 sh, Int32 full,
|
2014-05-12 23:34:25 +00:00
|
|
|
uInt32 z = 1, const string& desc = "");
|
|
|
|
|
|
|
|
friend ostream& operator<<(ostream& os, const VideoMode& vm)
|
|
|
|
{
|
2014-06-02 14:34:12 +00:00
|
|
|
os << "image=" << vm.image << " screen=" << vm.screen
|
2014-09-01 21:17:33 +00:00
|
|
|
<< " full= " << vm.fsIndex << " zoom=" << vm.zoom
|
2014-05-12 23:34:25 +00:00
|
|
|
<< " desc=" << vm.description;
|
|
|
|
return os;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2014-06-02 14:34:12 +00:00
|
|
|
void applyAspectCorrection(uInt32 aspect, bool stretch = false);
|
2014-05-12 23:34:25 +00:00
|
|
|
};
|
|
|
|
|
2003-09-25 16:20:34 +00:00
|
|
|
/**
|
2009-01-19 16:52:32 +00:00
|
|
|
This class encapsulates all video buffers and is the basis for the video
|
2005-02-21 02:23:57 +00:00
|
|
|
display in Stella. All graphics ports should derive from this class for
|
2003-10-26 19:40:39 +00:00
|
|
|
platform-specific video stuff.
|
|
|
|
|
2009-01-19 16:52:32 +00:00
|
|
|
The TIA is drawn here, and all GUI elements (ala ScummVM, which are drawn
|
|
|
|
into FBSurfaces), are in turn drawn here as well.
|
2003-09-25 16:20:34 +00:00
|
|
|
|
|
|
|
@author Stephen Anthony
|
|
|
|
*/
|
2003-10-17 18:02:16 +00:00
|
|
|
class FrameBuffer
|
2003-09-25 16:20:34 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-04-28 16:47:10 +00:00
|
|
|
enum {
|
2017-07-26 22:33:39 +00:00
|
|
|
kTIAMinW = 320u, kTIAMinH = TIAConstants::minViewableHeight,
|
2014-04-28 16:47:10 +00:00
|
|
|
kFBMinW = 640u, kFBMinH = 480u
|
|
|
|
};
|
|
|
|
|
2003-09-25 16:20:34 +00:00
|
|
|
/**
|
2003-10-17 18:02:16 +00:00
|
|
|
Creates a new Frame Buffer
|
2003-09-25 16:20:34 +00:00
|
|
|
*/
|
2014-05-12 23:34:25 +00:00
|
|
|
FrameBuffer(OSystem& osystem);
|
2015-12-29 21:28:10 +00:00
|
|
|
virtual ~FrameBuffer() = default;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
/**
|
2014-02-05 22:09:57 +00:00
|
|
|
Initialize the framebuffer object (set up the underlying hardware)
|
|
|
|
*/
|
|
|
|
bool initialize();
|
|
|
|
|
|
|
|
/**
|
|
|
|
(Re)creates the framebuffer display. This must be called before any
|
2003-10-26 19:40:39 +00:00
|
|
|
calls are made to derived methods.
|
|
|
|
|
2014-02-05 22:09:57 +00:00
|
|
|
@param title The title of the application / window
|
2005-05-06 22:50:15 +00:00
|
|
|
@param width The width of the framebuffer
|
|
|
|
@param height The height of the framebuffer
|
2010-07-22 15:41:46 +00:00
|
|
|
|
|
|
|
@return Status of initialization (see FBInitStatus 'enum')
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2014-02-05 22:09:57 +00:00
|
|
|
FBInitStatus createDisplay(const string& title, uInt32 width, uInt32 height);
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
/**
|
2005-02-21 02:23:57 +00:00
|
|
|
Updates the display, which depending on the current mode could mean
|
2009-01-19 16:52:32 +00:00
|
|
|
drawing the TIA, any pending menus, etc.
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
|
|
|
void update();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Shows a message onscreen.
|
|
|
|
|
|
|
|
@param message The message to be shown
|
2006-03-19 18:17:48 +00:00
|
|
|
@param position Onscreen position for the message
|
Revamped the result on floating pins for TIA reads. Previously, this was
controlled by 'tiafloat', which has now been removed. Now, all
undriven pins take on the last value on the databus. This fixes a bug
in those reads where bit 6 or bits 6 & 7 are also undriven (previously,
these bits would always be zero, and only bits 0-5 were from lastdatabus.
Added new commandline argument 'tiadriven', which defaults to false.
In this default case, relevant bits take on values from the databus.
If true, relevant bits still take on databus values, but some are
randomly driven high as well. This helps to expose bugs when
developers assume the values for undriven/floating bits.
Added 'uimessages' commandline argument and associated UI item. When
disabled, messages which are normally shown in-game are disabled.
Certain messages which indicate a serious error are still shown, however.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1900 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-11-10 20:12:50 +00:00
|
|
|
@param force Force showing this message, even if messages are disabled
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2006-03-19 18:17:48 +00:00
|
|
|
void showMessage(const string& message,
|
|
|
|
MessagePosition position = kBottomCenter,
|
2012-01-03 20:52:45 +00:00
|
|
|
bool force = false);
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2005-08-29 18:36:42 +00:00
|
|
|
/**
|
2008-05-20 13:42:50 +00:00
|
|
|
Toggles showing or hiding framerate statistics.
|
2005-08-29 18:36:42 +00:00
|
|
|
*/
|
2008-05-20 13:42:50 +00:00
|
|
|
void toggleFrameStats();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Shows a message containing frame statistics for the current frame.
|
|
|
|
*/
|
|
|
|
void showFrameStats(bool enable);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Enable/disable any pending messages. Disabled messages aren't removed
|
|
|
|
from the message queue; they're just not redrawn into the framebuffer.
|
|
|
|
*/
|
|
|
|
void enableMessages(bool enable);
|
2005-08-29 18:36:42 +00:00
|
|
|
|
2008-12-12 15:51:07 +00:00
|
|
|
/**
|
2014-11-09 15:10:47 +00:00
|
|
|
Allocate a new surface. The FrameBuffer class takes all responsibility
|
|
|
|
for freeing this surface (ie, other classes must not delete it directly).
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2014-05-14 22:04:59 +00:00
|
|
|
@param w The requested width of the new surface.
|
|
|
|
@param h The requested height of the new surface.
|
|
|
|
@param data If non-null, use the given data values as a static surface
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2014-11-09 15:10:47 +00:00
|
|
|
@return A pointer to a valid surface object, or nullptr.
|
2008-12-12 15:51:07 +00:00
|
|
|
*/
|
2014-12-13 21:00:33 +00:00
|
|
|
shared_ptr<FBSurface> allocateSurface(int w, int h, const uInt32* data = nullptr);
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2003-10-26 19:40:39 +00:00
|
|
|
/**
|
2008-06-19 12:01:31 +00:00
|
|
|
Returns the current dimensions of the framebuffer image.
|
|
|
|
Note that this will take into account the current scaling (if any)
|
|
|
|
as well as image 'centering'.
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
const GUI::Rect& imageRect() const { return myImageRect; }
|
2003-10-26 19:40:39 +00:00
|
|
|
|
|
|
|
/**
|
2008-06-19 12:01:31 +00:00
|
|
|
Returns the current dimensions of the framebuffer window.
|
|
|
|
This is the entire area containing the framebuffer image as well as any
|
|
|
|
'unusable' area.
|
2003-10-26 19:40:39 +00:00
|
|
|
*/
|
2014-04-28 16:47:10 +00:00
|
|
|
const GUI::Size& screenSize() const { return myScreenSize; }
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2014-02-05 22:09:57 +00:00
|
|
|
/**
|
2014-04-29 14:52:35 +00:00
|
|
|
Returns the current dimensions of the users' desktop.
|
2014-02-05 22:09:57 +00:00
|
|
|
*/
|
2014-04-29 14:52:35 +00:00
|
|
|
const GUI::Size& desktopSize() const { return myDesktopSize; }
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
/**
|
2014-03-07 22:12:39 +00:00
|
|
|
Get the supported renderers for the video hardware.
|
2014-02-05 22:09:57 +00:00
|
|
|
|
2014-03-07 22:12:39 +00:00
|
|
|
@return An array of supported renderers
|
2014-02-05 22:09:57 +00:00
|
|
|
*/
|
2014-03-07 22:12:39 +00:00
|
|
|
const VariantList& supportedRenderers() const { return myRenderers; }
|
2014-02-05 22:09:57 +00:00
|
|
|
|
2014-05-12 23:34:25 +00:00
|
|
|
/**
|
|
|
|
Get the supported TIA zoom levels (windowed mode) for the framebuffer.
|
|
|
|
*/
|
|
|
|
const VariantList& supportedTIAZoomLevels() const { return myTIAZoomLevels; }
|
|
|
|
|
2014-02-05 22:09:57 +00:00
|
|
|
/**
|
|
|
|
Get the font object(s) of the framebuffer
|
|
|
|
*/
|
|
|
|
const GUI::Font& font() const { return *myFont; }
|
|
|
|
const GUI::Font& infoFont() const { return *myInfoFont; }
|
|
|
|
const GUI::Font& smallFont() const { return *mySmallFont; }
|
|
|
|
const GUI::Font& launcherFont() const { return *myLauncherFont; }
|
|
|
|
|
2014-05-12 23:34:25 +00:00
|
|
|
/**
|
|
|
|
Get the TIA surface associated with the framebuffer.
|
|
|
|
*/
|
|
|
|
TIASurface& tiaSurface() const { return *myTIASurface; }
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
2014-04-28 16:47:10 +00:00
|
|
|
Enables/disables fullscreen mode.
|
2005-05-01 20:11:07 +00:00
|
|
|
*/
|
2014-04-28 16:47:10 +00:00
|
|
|
void setFullscreen(bool enable);
|
2005-05-01 20:11:07 +00:00
|
|
|
|
|
|
|
/**
|
2014-04-28 16:47:10 +00:00
|
|
|
Toggles between fullscreen and window mode.
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2014-04-28 16:47:10 +00:00
|
|
|
void toggleFullscreen();
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
/**
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
This method is called when the user wants to switch to the next available
|
2014-04-29 14:52:35 +00:00
|
|
|
windowed video mode.
|
|
|
|
direction = -1 means go to the next lower windowed video mode
|
|
|
|
direction = +1 means go to the next higher windowed video mode
|
2005-03-26 19:26:48 +00:00
|
|
|
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
@param direction Described above
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2014-04-29 14:52:35 +00:00
|
|
|
bool changeWindowedVidMode(int direction);
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-03-14 04:08:15 +00:00
|
|
|
/**
|
|
|
|
Sets the state of the cursor (hidden or grabbed) based on the
|
|
|
|
current mode.
|
|
|
|
*/
|
|
|
|
void setCursorState();
|
|
|
|
|
2011-06-07 13:40:59 +00:00
|
|
|
/**
|
|
|
|
Toggles the use of grabmouse (only has effect in emulation mode).
|
|
|
|
The method changes the 'grabmouse' setting and saves it.
|
|
|
|
*/
|
|
|
|
void toggleGrabMouse();
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
Set up the TIA/emulation palette for a screen of any depth > 8.
|
2005-05-05 00:10:49 +00:00
|
|
|
|
2015-09-13 23:23:12 +00:00
|
|
|
@param raw_palette The array of colors in R/G/B format
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
2014-06-02 14:34:12 +00:00
|
|
|
void setPalette(const uInt32* raw_palette);
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
|
Added new rendering modes to FrameBufferSoft, which don't use dirty
rectangle merging. This makes the 'dirtyrects' option more relevant,
since now if it's turned off, dirty rectangles are not merged, and
the screen is updated with SDL_Flip() instead of SDL_UpdateRects().
This new functionality is very similar to how z26 works, but
experiments on my Linux system show it to be twice as fast on
average :) Dirty rectangle merging now defaults to off. I'm
leaving it in, since it benefits people in some cases. Basically,
non-dirty-rect support is optimal when many things are changing
onscreen at once, at the cost of more constant and generally slightly
higher CPU usage. Dirty-rect support is optimal at larger resolutions,
where it's usually at least twice as fast as without, but is suboptimal
at larger resolutions when lots of stuff is changing. At some point in
the future, maybe Stella itself can automatically switch modes depending
on which is faster at any point in time.
Added "[..]" previous directory functionality to BrowserWidget, the same
as already in the LauncherDialog. Thanks for Alex and Lou for the
reminder.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1197 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-10 17:04:34 +00:00
|
|
|
/**
|
|
|
|
Informs the Framebuffer of a change in EventHandler state.
|
|
|
|
*/
|
2009-01-10 18:52:55 +00:00
|
|
|
void stateChanged(EventHandler::State state);
|
Added new rendering modes to FrameBufferSoft, which don't use dirty
rectangle merging. This makes the 'dirtyrects' option more relevant,
since now if it's turned off, dirty rectangles are not merged, and
the screen is updated with SDL_Flip() instead of SDL_UpdateRects().
This new functionality is very similar to how z26 works, but
experiments on my Linux system show it to be twice as fast on
average :) Dirty rectangle merging now defaults to off. I'm
leaving it in, since it benefits people in some cases. Basically,
non-dirty-rect support is optimal when many things are changing
onscreen at once, at the cost of more constant and generally slightly
higher CPU usage. Dirty-rect support is optimal at larger resolutions,
where it's usually at least twice as fast as without, but is suboptimal
at larger resolutions when lots of stuff is changing. At some point in
the future, maybe Stella itself can automatically switch modes depending
on which is faster at any point in time.
Added "[..]" previous directory functionality to BrowserWidget, the same
as already in the LauncherDialog. Thanks for Alex and Lou for the
reminder.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1197 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-10 17:04:34 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
2013-09-28 00:51:10 +00:00
|
|
|
// The following methods are system-specific and can/must be
|
|
|
|
// implemented in derived classes.
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
2003-10-17 18:02:16 +00:00
|
|
|
public:
|
2013-09-28 00:51:10 +00:00
|
|
|
/**
|
|
|
|
Shows or hides the cursor based on the given boolean value.
|
|
|
|
*/
|
|
|
|
virtual void showCursor(bool show) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Answers if the display is currently in fullscreen mode.
|
|
|
|
*/
|
|
|
|
virtual bool fullScreen() const = 0;
|
|
|
|
|
2007-09-01 23:31:18 +00:00
|
|
|
/**
|
2009-01-03 22:57:12 +00:00
|
|
|
This method is called to retrieve the R/G/B data from the given pixel.
|
|
|
|
|
|
|
|
@param pixel The pixel containing R/G/B data
|
|
|
|
@param r The red component of the color
|
|
|
|
@param g The green component of the color
|
|
|
|
@param b The blue component of the color
|
|
|
|
*/
|
2017-05-15 01:47:49 +00:00
|
|
|
virtual void getRGB(uInt32 pixel, uInt8* r, uInt8* g, uInt8* b) const = 0;
|
2009-01-03 22:57:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
This method is called to map a given R/G/B triple to the screen palette.
|
2007-09-01 23:31:18 +00:00
|
|
|
|
|
|
|
@param r The red component of the color.
|
|
|
|
@param g The green component of the color.
|
|
|
|
@param b The blue component of the color.
|
|
|
|
*/
|
2017-05-15 01:47:49 +00:00
|
|
|
virtual uInt32 mapRGB(uInt8 r, uInt8 g, uInt8 b) const = 0;
|
2007-09-01 23:31:18 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
/**
|
2014-06-13 13:35:41 +00:00
|
|
|
This method is called to get the specified ARGB data from the viewable
|
|
|
|
FrameBuffer area. Note that this isn't the same as any internal
|
|
|
|
surfaces that may be in use; it should return the actual data as it
|
|
|
|
is currently seen onscreen.
|
2008-06-13 13:14:52 +00:00
|
|
|
|
2014-06-13 13:35:41 +00:00
|
|
|
@param buffer The actual pixel data in ARGB8888 format
|
|
|
|
@param pitch The pitch (in bytes) for the pixel data
|
2014-06-19 16:45:07 +00:00
|
|
|
@param rect The bounding rectangle for the buffer
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
*/
|
2014-06-19 16:45:07 +00:00
|
|
|
virtual void readPixels(uInt8* buffer, uInt32 pitch, const GUI::Rect& rect) const = 0;
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
|
|
|
|
protected:
|
2014-02-05 22:09:57 +00:00
|
|
|
/**
|
|
|
|
This method is called to query and initialize the video hardware
|
|
|
|
for desktop and fullscreen resolution information.
|
|
|
|
*/
|
2014-11-08 21:27:36 +00:00
|
|
|
virtual void queryHardware(vector<GUI::Size>& mons, VariantList& ren) = 0;
|
2014-09-01 21:17:33 +00:00
|
|
|
|
|
|
|
virtual Int32 getCurrentDisplayIndex() = 0;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
/**
|
2014-05-12 23:34:25 +00:00
|
|
|
This method is called to change to the given video mode.
|
2008-06-19 12:01:31 +00:00
|
|
|
|
2014-02-19 15:34:22 +00:00
|
|
|
@param title The title for the created window
|
2008-06-19 12:01:31 +00:00
|
|
|
@param mode The video mode to use
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
|
2014-06-02 14:34:12 +00:00
|
|
|
@return False on any errors, else true
|
2014-04-28 16:47:10 +00:00
|
|
|
*/
|
2015-06-13 23:58:37 +00:00
|
|
|
virtual bool setVideoMode(const string& title, const VideoMode& mode) = 0;
|
2013-09-28 00:51:10 +00:00
|
|
|
|
2010-02-10 22:55:08 +00:00
|
|
|
/**
|
|
|
|
This method is called to invalidate the contents of the entire
|
|
|
|
framebuffer (ie, mark the current content as invalid, and erase it on
|
|
|
|
the next drawing pass).
|
|
|
|
*/
|
|
|
|
virtual void invalidate() = 0;
|
|
|
|
|
2008-12-12 15:51:07 +00:00
|
|
|
/**
|
2014-05-04 20:21:16 +00:00
|
|
|
This method is called to create a surface with the given attributes.
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2014-05-14 22:04:59 +00:00
|
|
|
@param w The requested width of the new surface.
|
|
|
|
@param h The requested height of the new surface.
|
|
|
|
@param data If non-null, use the given data values as a static surface
|
2008-12-12 15:51:07 +00:00
|
|
|
*/
|
2014-11-09 15:10:47 +00:00
|
|
|
virtual unique_ptr<FBSurface> createSurface(uInt32 w, uInt32 h,
|
|
|
|
const uInt32* data) const = 0;
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2013-09-28 00:51:10 +00:00
|
|
|
/**
|
|
|
|
Grabs or ungrabs the mouse based on the given boolean value.
|
|
|
|
*/
|
|
|
|
virtual void grabMouse(bool grab) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the icon for the main window.
|
|
|
|
*/
|
|
|
|
virtual void setWindowIcon() = 0;
|
|
|
|
|
2016-12-30 00:00:30 +00:00
|
|
|
/**
|
|
|
|
This method is called after any drawing is done (per-frame).
|
|
|
|
*/
|
2008-12-27 23:27:32 +00:00
|
|
|
virtual void postFrameUpdate() = 0;
|
2008-08-04 11:56:12 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
/**
|
|
|
|
This method is called to provide information about the FrameBuffer.
|
|
|
|
*/
|
2007-09-03 18:37:24 +00:00
|
|
|
virtual string about() const = 0;
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
|
2003-10-17 18:02:16 +00:00
|
|
|
protected:
|
2005-02-21 02:23:57 +00:00
|
|
|
// The parent system for the framebuffer
|
2014-05-12 23:34:25 +00:00
|
|
|
OSystem& myOSystem;
|
2003-10-26 19:40:39 +00:00
|
|
|
|
2014-05-12 23:34:25 +00:00
|
|
|
// Color palette for TIA and UI modes
|
2017-05-15 01:47:49 +00:00
|
|
|
uInt32 myPalette[256+kNumColors];
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
|
2003-10-26 19:40:39 +00:00
|
|
|
private:
|
2005-08-29 18:36:42 +00:00
|
|
|
/**
|
2008-05-20 13:42:50 +00:00
|
|
|
Draw pending messages.
|
2005-08-29 18:36:42 +00:00
|
|
|
*/
|
|
|
|
void drawMessage();
|
|
|
|
|
2014-05-12 23:34:25 +00:00
|
|
|
/**
|
|
|
|
Issues a 'free' and 'reload' instruction to all surfaces that the
|
|
|
|
framebuffer knows about.
|
|
|
|
*/
|
|
|
|
void resetSurfaces();
|
|
|
|
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
/**
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
Calculate the maximum level by which the base window can be zoomed and
|
|
|
|
still fit in the given screen dimensions.
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
*/
|
2008-06-19 12:01:31 +00:00
|
|
|
uInt32 maxWindowSizeForScreen(uInt32 baseWidth, uInt32 baseHeight,
|
2014-10-21 23:02:20 +00:00
|
|
|
uInt32 screenWidth, uInt32 screenHeight) const;
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
/**
|
2014-04-28 16:47:10 +00:00
|
|
|
Set all possible video modes (both windowed and fullscreen) available for
|
|
|
|
this framebuffer based on given image dimensions and maximum window size.
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
*/
|
2014-04-28 16:47:10 +00:00
|
|
|
void setAvailableVidModes(uInt32 basewidth, uInt32 baseheight);
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
/**
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
Returns an appropriate video mode based on the current eventhandler
|
|
|
|
state, taking into account the maximum size of the window.
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
|
2015-09-13 23:23:12 +00:00
|
|
|
@param fullscreen Whether to use a windowed or fullscreen mode
|
|
|
|
@return A valid VideoMode for this framebuffer
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
*/
|
2014-04-28 16:47:10 +00:00
|
|
|
const VideoMode& getSavedVidMode(bool fullscreen);
|
Added preliminary framework for using advanced scalers. Right now,
functionality is exactly the same as before; Alt-Equals goes to the
next valid scaler, and Alt-Minus goes to the previous one.
What were previously zoomed modes are now treated as scalers, named
'Zoom1x', 'Zoom2x', etc. Various scalexx and hqxx modes will also be made
available.
For now, and probably forever, these advanced scaling modes will only
be available for OpenGL, since if you don't have a card that can handle
GL well, the scalers will probably be too much anyway. Also, the advanced
scaling will not be available in UI mode, only OpenGL emulation mode.
The UI (Launcher, Debugger) and emulation modes are now scaled separately,
specified with the new settings 'scale_ui' and 'scale_tia'. The 'zoom'
setting has been removed.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1133 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-14 20:08:29 +00:00
|
|
|
|
2008-07-04 14:27:17 +00:00
|
|
|
private:
|
|
|
|
/**
|
|
|
|
This class implements an iterator around an array of VideoMode objects.
|
|
|
|
*/
|
|
|
|
class VideoModeList
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
VideoModeList();
|
2015-09-14 18:14:00 +00:00
|
|
|
VideoModeList(const VideoModeList&) = default;
|
|
|
|
VideoModeList& operator=(const VideoModeList&) = default;
|
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
void add(const VideoMode& mode);
|
2008-07-04 14:27:17 +00:00
|
|
|
void clear();
|
|
|
|
|
2014-11-07 23:28:40 +00:00
|
|
|
bool empty() const;
|
2008-07-04 14:27:17 +00:00
|
|
|
uInt32 size() const;
|
|
|
|
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
void previous();
|
2014-05-12 23:34:25 +00:00
|
|
|
const VideoMode& current() const;
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
void next();
|
2008-07-04 14:27:17 +00:00
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
void setZoom(uInt32 zoom);
|
2008-07-04 14:27:17 +00:00
|
|
|
|
2014-04-28 16:47:10 +00:00
|
|
|
friend ostream& operator<<(ostream& os, const VideoModeList& l)
|
|
|
|
{
|
2014-11-09 03:05:19 +00:00
|
|
|
for(const auto& vm: l.myModeList)
|
|
|
|
os << "-----\n" << vm << endl << "-----\n";
|
2014-04-28 16:47:10 +00:00
|
|
|
return os;
|
|
|
|
}
|
2008-07-04 14:27:17 +00:00
|
|
|
|
|
|
|
private:
|
2014-11-08 21:27:36 +00:00
|
|
|
vector<VideoMode> myModeList;
|
2008-07-04 14:27:17 +00:00
|
|
|
int myIdx;
|
|
|
|
};
|
|
|
|
|
2005-03-28 00:04:54 +00:00
|
|
|
private:
|
2006-12-11 00:15:34 +00:00
|
|
|
// Indicates the number of times the framebuffer was initialized
|
|
|
|
uInt32 myInitializedCount;
|
|
|
|
|
2007-01-30 17:13:10 +00:00
|
|
|
// Used to set intervals between messages while in pause mode
|
2017-10-14 10:22:21 +00:00
|
|
|
Int32 myPausedCount;
|
2007-01-30 17:13:10 +00:00
|
|
|
|
2008-06-19 12:01:31 +00:00
|
|
|
// Dimensions of the actual image, after zooming, and taking into account
|
|
|
|
// any image 'centering'
|
|
|
|
GUI::Rect myImageRect;
|
|
|
|
|
2013-09-28 00:51:10 +00:00
|
|
|
// Dimensions of the main window (not always the same as the image)
|
2014-04-28 16:47:10 +00:00
|
|
|
GUI::Size myScreenSize;
|
2008-06-19 12:01:31 +00:00
|
|
|
|
2014-04-29 14:52:35 +00:00
|
|
|
// Title of the main window/screen
|
|
|
|
string myScreenTitle;
|
|
|
|
|
2014-02-05 22:09:57 +00:00
|
|
|
// Maximum dimensions of the desktop area
|
2014-04-29 14:52:35 +00:00
|
|
|
GUI::Size myDesktopSize;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
2014-09-01 21:17:33 +00:00
|
|
|
// The resolution of the attached displays
|
|
|
|
// The primary display is first in the array
|
2014-11-08 21:27:36 +00:00
|
|
|
vector<GUI::Size> myDisplays;
|
2014-09-01 21:17:33 +00:00
|
|
|
|
2014-03-07 22:12:39 +00:00
|
|
|
// Supported renderers
|
|
|
|
VariantList myRenderers;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
// The font object to use for the normal in-game GUI
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<GUI::Font> myFont;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
// The info font object to use for the normal in-game GUI
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<GUI::Font> myInfoFont;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
// The font object to use when space is very limited
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<GUI::Font> mySmallFont;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
|
|
|
// The font object to use for the ROM launcher
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<GUI::Font> myLauncherFont;
|
2014-02-05 22:09:57 +00:00
|
|
|
|
2014-05-12 23:34:25 +00:00
|
|
|
// The TIASurface class takes responsibility for TIA rendering
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<TIASurface> myTIASurface;
|
2014-05-12 23:34:25 +00:00
|
|
|
|
2008-06-19 12:01:31 +00:00
|
|
|
// Used for onscreen messages and frame statistics
|
|
|
|
// (scanline count and framerate)
|
2006-03-19 18:17:48 +00:00
|
|
|
struct Message {
|
|
|
|
string text;
|
|
|
|
int counter;
|
|
|
|
int x, y, w, h;
|
2009-01-10 18:42:49 +00:00
|
|
|
MessagePosition position;
|
2009-01-03 22:57:12 +00:00
|
|
|
uInt32 color;
|
2014-11-15 18:29:13 +00:00
|
|
|
shared_ptr<FBSurface> surface;
|
2008-06-19 12:01:31 +00:00
|
|
|
bool enabled;
|
2006-03-19 18:17:48 +00:00
|
|
|
};
|
2008-06-19 12:01:31 +00:00
|
|
|
Message myMsg;
|
|
|
|
Message myStatsMsg;
|
2008-05-20 13:42:50 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
// The list of all available video modes for this framebuffer
|
|
|
|
VideoModeList* myCurrentModeList;
|
2014-09-01 21:17:33 +00:00
|
|
|
VideoModeList myWindowedModeList;
|
2014-11-08 21:27:36 +00:00
|
|
|
vector<VideoModeList> myFullscreenModeLists;
|
2008-07-04 14:27:17 +00:00
|
|
|
|
2014-05-12 23:34:25 +00:00
|
|
|
// Names of the TIA zoom levels that can be used for this framebuffer
|
|
|
|
VariantList myTIAZoomLevels;
|
|
|
|
|
2008-12-12 15:51:07 +00:00
|
|
|
// Holds a reference to all the surfaces that have been created
|
2014-11-15 18:29:13 +00:00
|
|
|
vector<shared_ptr<FBSurface>> mySurfaceList;
|
2008-12-12 15:51:07 +00:00
|
|
|
|
2014-09-03 13:27:33 +00:00
|
|
|
// Holds UI palette data (standard and classic colours)
|
|
|
|
static uInt32 ourGUIColors[2][kNumColors-256];
|
2015-04-26 19:02:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
// Following constructors and assignment operators not supported
|
|
|
|
FrameBuffer() = delete;
|
|
|
|
FrameBuffer(const FrameBuffer&) = delete;
|
|
|
|
FrameBuffer(FrameBuffer&&) = delete;
|
|
|
|
FrameBuffer& operator=(const FrameBuffer&) = delete;
|
|
|
|
FrameBuffer& operator=(FrameBuffer&&) = delete;
|
2005-03-28 00:04:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|